search for: emitloadoflvalue

Displaying 6 results from an estimated 6 matches for "emitloadoflvalue".

2007 Nov 07
3
[LLVMdev] RFC: llvm-convert.cpp Patch
...TreeType(TREE_TYPE(exp)) == (DestLoc != 0) || TREE_CODE(exp) == MODIFY_EXPR) && "Didn't pass DestLoc to an aggregate expr, or passed it to scalar!"); @@ -811,7 +811,7 @@ case STRING_CST: case REALPART_EXPR: case IMAGPART_EXPR: - Result = EmitLoadOfLValue(exp, DestLoc); + Result = EmitLoadOfLValue(exp, DestLoc, Alignment); break; case OBJ_TYPE_REF: Result = EmitOBJ_TYPE_REF(exp); break; case ADDR_EXPR: Result = EmitADDR_EXPR(exp); break; @@ -2524,7 +2524,8 @@ /// EmitLoadOfLValue - When an l-value expression is used in a...
2007 Nov 07
0
[LLVMdev] RFC: llvm-convert.cpp Patch
On Nov 6, 2007, at 5:45 PM, Bill Wendling wrote: > Hi all, > > This patch is to fix a problem on PPC64 where an unaligned memcpy is > generated. The testcase is this: > > $ cat testcase.c > void Qux() { > char Bar[11] = {0}; > } > > What happens is that we produce LLVM code like this: > > call void @llvm.memcpy.i64( i8* %event_list2, i8* getelementptr ([11
2007 Nov 07
7
[LLVMdev] RFC: llvm-convert.cpp Patch
Hi all, This patch is to fix a problem on PPC64 where an unaligned memcpy is generated. The testcase is this: $ cat testcase.c void Qux() { char Bar[11] = {0}; } What happens is that we produce LLVM code like this: call void @llvm.memcpy.i64( i8* %event_list2, i8* getelementptr ([11 x i8]* @C.103.30698, i32 0, i32 0), i64 11, i32 8 ) Notice that it has an 8-byte alignment. However, the Bar
2009 Jan 09
0
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...(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::EmitLoadOfLValue(tree > LValue LV = EmitLV(exp); > bool isVolatile = TREE_THIS_VOLATILE(exp); > const Type *Ty = ConvertType(TREE_TYPE(exp)); > - unsigned Alignment = expr_align(exp) / 8; > + unsigned Alignment = LV.getAlignment(); Here expr_align(exp) is correct I think. > @@ -296...
2008 Jul 22
2
[LLVMdev] BITS_BIG_ENDIAN in llvm-gcc
There are various functions in llvm-convert.cpp that depend on BITS_BIG_ENDIAN: TreeToLLVM::EmitLoadOfLValue() TreeToLLVM::EmitMODIFY_EXPR() InsertBitFieldValue() ProcessBitFieldInitialization() The comments say things like: // If this target has bitfields laid out in big-endian order, invert the bit // in the word if needed. // If this is a big-endian bit-field, take the top NumBitsToI...
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...TREE_OPERAND(exp, 0)); - case INDIRECT_REF: + case INDIRECT_REF: { // The lvalue is just the address. - return Emit(TREE_OPERAND(exp, 0), 0); + tree Op = TREE_OPERAND(exp, 0); + return LValue(Emit(Op, 0), expr_align(Op) / 8); + } } } @@ -2290,7 +2301,7 @@ Value *TreeToLLVM::EmitLoadOfLValue(tree LValue LV = EmitLV(exp); bool isVolatile = TREE_THIS_VOLATILE(exp); const Type *Ty = ConvertType(TREE_TYPE(exp)); - unsigned Alignment = expr_align(exp) / 8; + unsigned Alignment = LV.getAlignment(); if (TREE_CODE(exp) == COMPONENT_REF) if (const StructType *STy =...