search for: type_align

Displaying 7 results from an estimated 7 matches for "type_align".

2019 Dec 29
2
__c11_atomic builtins' input requirements
...# define _LIBCPP_HAS_GCC_ATOMIC_IMP #endif To implement atomic_ref, it might be cleaner to use the gcc builtins. By doing so, we avoid depending on the internals of the c11 atomic builtins. The required alignment of referenced variables would always be the first power of 2 >= max(type_size, type_alignment). Alternatively, we could use the c11 atomic builtins when available if it is enough to require that the input reference is aligned as the atomic type would be. What are your thoughts? Regards, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists...
2009 Jan 09
0
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...l later I suppose. > + case LABEL_DECL: { > + Value *Ptr = TreeConstantToLLVM::EmitLV_LABEL_DECL(exp); > + return LValue(Ptr, DECL_ALIGN(exp) / 8); > + } > + case COMPLEX_CST: { > + Value *Ptr = TreeConstantToLLVM::EmitLV_COMPLEX_CST(exp); > + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); > + } > + case STRING_CST: { > + Value *Ptr = TreeConstantToLLVM::EmitLV_STRING_CST(exp); > + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); > + } These are all equivalent to using expr_align, right? > @@ -2290,7 +2301,7 @@ Value *TreeToLLVM::...
2009 Jun 03
1
[LLVMdev] RFA: Alignment of Strings
...llvm-gcc.src/gcc/llvm-convert.cpp (working copy) @@ -7418,6 +7418,8 @@ TAI ? TAI->getStringConstantPrefix() : ".str", TheModule); + GV->setAlignment(TYPE_ALIGN(TREE_TYPE(exp))); + if (SlotP) *SlotP = GV; #ifdef LLVM_CSTRING_SECTION // For Darwin, try to put it into the .cstring section.
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...LValue(TreeConstantToLLVM::EmitLV_STRING_CST(exp)); + case LABEL_DECL: { + Value *Ptr = TreeConstantToLLVM::EmitLV_LABEL_DECL(exp); + return LValue(Ptr, DECL_ALIGN(exp) / 8); + } + case COMPLEX_CST: { + Value *Ptr = TreeConstantToLLVM::EmitLV_COMPLEX_CST(exp); + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); + } + case STRING_CST: { + Value *Ptr = TreeConstantToLLVM::EmitLV_STRING_CST(exp); + return LValue(Ptr, TYPE_ALIGN(TREE_TYPE(exp)) / 8); + } // Type Conversion. case VIEW_CONVERT_EXPR: return EmitLV_VIEW_CONVERT_EXPR(exp); @@ -1165,9 +1174,11 @@ LValue TreeT...
2007 Oct 26
2
[LLVMdev] RFC: llvm-convert.cpp Patch
...ment of the source pointer. So, we + // need to make sure that it's has at least its alignment. + tree new_exp = copy_node(TREE_OPERAND(exp, 1)); + unsigned NewAlignment = expr_align(new_exp) / 8; + Alignment = (Alignment < NewAlignment) ? Alignment : NewAlignment; + TYPE_ALIGN(TREE_TYPE(new_exp)) = Alignment; + + switch (TREE_CODE(new_exp)) { + case VAR_DECL: + case PARM_DECL: + case RESULT_DECL: + DECL_ALIGN (new_exp) = Alignment * 8; + break; + default: + break; + } + + Emit(new_exp, LV.Ptr); } else { // Need to do a vo...
2007 Oct 26
0
[LLVMdev] RFC: llvm-convert.cpp Patch
...we > + // need to make sure that it's has at least its alignment. > + tree new_exp = copy_node(TREE_OPERAND(exp, 1)); > + unsigned NewAlignment = expr_align(new_exp) / 8; > + Alignment = (Alignment < NewAlignment) ? Alignment : > NewAlignment; > + TYPE_ALIGN(TREE_TYPE(new_exp)) = Alignment; > + > + switch (TREE_CODE(new_exp)) { > + case VAR_DECL: > + case PARM_DECL: > + case RESULT_DECL: > + DECL_ALIGN (new_exp) = Alignment * 8; > + break; > + default: > + break; > + } > + > + Em...
2020 Jun 04
2
[cfe-dev] Clang/LLVM function ABI lowering (was: Re: [RFC] Refactor Clang: move frontend/driver/diagnostics code to LLVM)
On 4 Jun 2020, at 0:54, James Y Knight via llvm-dev wrote: > While MLIR may be one part of the solution, I think it's also the case > that > the function-ABI interface between Clang and LLVM is just wrong and > should > be fixed -- independently of whether Clang might use MLIR in the > future. > > I've mentioned this idea before, I think, but never got around to