search for: decl_user_align

Displaying 9 results from an estimated 9 matches for "decl_user_align".

2007 Nov 07
7
[LLVMdev] RFC: llvm-convert.cpp Patch
...ase.c.t03.generic Qux () { static char C.0[11] = {0}; char Bar[11]; Bar = C.0; } Anyway, it turns out that the gimplifier was generating the correct alignment, but it was being overridden in assemble_variable(): /* On some machines, it is good to increase alignment sometimes. */ if (! DECL_USER_ALIGN (decl)) { #ifdef DATA_ALIGNMENT align = DATA_ALIGNMENT (TREE_TYPE (decl), align); #endif #ifdef CONSTANT_ALIGNMENT => if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != error_mark_node) align = CONSTANT_ALIGNMENT (DECL_INITIAL (decl), align); #endif } By set...
2007 Nov 07
0
[LLVMdev] RFC: llvm-convert.cpp Patch
...] = {0}; > char Bar[11]; > > Bar = C.0; > } > > Anyway, it turns out that the gimplifier was generating the correct > alignment, but it was being overridden in assemble_variable(): > > /* On some machines, it is good to increase alignment sometimes. */ > if (! DECL_USER_ALIGN (decl)) > { > #ifdef DATA_ALIGNMENT > align = DATA_ALIGNMENT (TREE_TYPE (decl), align); > #endif > #ifdef CONSTANT_ALIGNMENT > => if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != > error_mark_node) > align = CONSTANT_ALIGNMENT (DECL_IN...
2007 Nov 07
0
[LLVMdev] RFC: llvm-convert.cpp Patch
...0[11] = {0}; > char Bar[11]; > > Bar = C.0; > } > > Anyway, it turns out that the gimplifier was generating the correct > alignment, but it was being overridden in assemble_variable(): > > /* On some machines, it is good to increase alignment sometimes. */ > if (! DECL_USER_ALIGN (decl)) > { > #ifdef DATA_ALIGNMENT > align = DATA_ALIGNMENT (TREE_TYPE (decl), align); > #endif > #ifdef CONSTANT_ALIGNMENT > => if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != > error_mark_node) > align = CONSTANT_ALIGNMENT (DECL_INITI...
2007 Nov 07
3
[LLVMdev] RFC: llvm-convert.cpp Patch
...Bar = C.0; >> } >> >> Anyway, it turns out that the gimplifier was generating the correct >> alignment, but it was being overridden in assemble_variable(): >> >> /* On some machines, it is good to increase alignment >> sometimes. */ >> if (! DECL_USER_ALIGN (decl)) >> { >> #ifdef DATA_ALIGNMENT >> align = DATA_ALIGNMENT (TREE_TYPE (decl), align); >> #endif >> #ifdef CONSTANT_ALIGNMENT >> => if (DECL_INITIAL (decl) != 0 && DECL_INITIAL (decl) != >> error_mark_node) >> align...
2007 Nov 07
0
[LLVMdev] RFC: llvm-convert.cpp Patch
...Johannesen wrote: >> >> Not sure I'm getting it, is this Bar itself or the constructed C.0 >> that's getting realigned? >> > It's C.0 that's getting realigned. OK then, it looks like other people have made the points I was going to, but briefly: Using DECL_USER_ALIGN is wrong; that is for user-specified alignments, and if you use it for something else, you'll break that. The alignment on memcpy needs to take both the source & destination into account. You seem to have gotten this far. Unfortunately that bit of llvm- convert is a maze of recursive...
2009 Jan 09
0
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...Ty = PointerType::getUnqual(Ty); > - return BitCastToType(Decl, PTy); > + unsigned Alignment = Ty->isSized() ? TD.getABITypeAlignment(Ty) : 1; Can't you just use expr_align here? That said, I'm not sure what this case is doing. > + if (DECL_ALIGN_UNIT(exp)) { > + if (DECL_USER_ALIGN(exp) || Alignment < > (unsigned)DECL_ALIGN_UNIT(exp)) > + Alignment = DECL_ALIGN_UNIT(exp); > + } > + > + return LValue(BitCastToType(Decl, PTy), Alignment); Since I don't know what this case handles, I can't comment on this. > LValue ArrayAddrLV = Emit...
2007 Nov 07
1
[LLVMdev] RFC: llvm-convert.cpp Patch
Hi, > I don't get it Bill. llvm should be making memcpy with the right > alignment regardless of how Bar is formed. Changing the alignment of > bar papers over this problem, but we will still get improper alignment > for other cases. Also, DECL_USER_ALIGN isn't appropriate to tweak > here... the user isn't playing around with __attribute__((aligned)) the fundamental problem is that the DestLoc argument to Emit doesn't come with alignment (or volatility for that matter). When emitting an aggregate into DestLoc only the alignment of...
2007 Nov 07
1
[LLVMdev] RFC: llvm-convert.cpp Patch
On 11/7/07, Dale Johannesen <dalej at apple.com> wrote: > > OK then, it looks like other people have made the points I was going > to, but briefly: > > Using DECL_USER_ALIGN is wrong; that is for user-specified > alignments, and if > you use it for something else, you'll break that. > Okay. > The alignment on memcpy needs to take both the source & destination > into account. I agree. But I was thinking that there was a more fundamental problem,...
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...L(tree exp) // type void. if (Ty == Type::VoidTy) Ty = StructType::get(NULL, NULL); const PointerType *PTy = PointerType::getUnqual(Ty); - return BitCastToType(Decl, PTy); + unsigned Alignment = Ty->isSized() ? TD.getABITypeAlignment(Ty) : 1; + if (DECL_ALIGN_UNIT(exp)) { + if (DECL_USER_ALIGN(exp) || Alignment < (unsigned)DECL_ALIGN_UNIT(exp)) + Alignment = DECL_ALIGN_UNIT(exp); + } + + return LValue(BitCastToType(Decl, PTy), Alignment); } LValue TreeToLLVM::EmitLV_ARRAY_REF(tree exp) { @@ -5932,22 +5950,23 @@ LValue TreeToLLVM::EmitLV_ARRAY_REF(tree // of ElementTy...