search for: casttotyp

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

Did you mean: casttotype
2006 Mar 03
0
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
...mcpy.i32" : "llvm.memcpy.i64"; + MemCpy = TheModule->getOrInsertFunction(Name, Type::VoidTy, SBP, + SBP, IntPtr, Type::UIntTy, NULL); + } std::vector<Value*> Ops; Ops.push_back(CastToType(DestPtr, SBP)); Ops.push_back(CastToType(SrcPtr, SBP)); - Ops.push_back(CastToType(Size, Type::UIntTy)); + Ops.push_back(CastToType(Size, IntPtr)); Ops.push_back(ConstantUInt::get(Type::UIntTy, Align)); new CallInst(MemCpy, Ops, "", CurBB); } @@ -811,14 +815,17 @@ void TreeTo...
2006 Mar 02
4
[LLVMdev] Re: Re: New GCC4-based C/C++/ObjC front-end for LLVM
On Thu, 2 Mar 2006, Vladimir Prus wrote: >>> The instructions seem to have one path wrong. It says to get: >> >> I'll put together a tarball today. That will be easier than dealing with >> a patch, and it will include a bunch of bugfixes since the previous email. > Further into process, I get this error: > In file included from
2006 Sep 12
1
[LLVMdev] ICE in LLVM GCC4 Front End
...tSize == Offset) { - // If this is a subtract, we want to step backwards. - if (Opc == Instruction::Sub) - EltOffset = -EltOffset; - Constant *C = ConstantSInt::get(Type::LongTy, EltOffset); - Value *V = new GetElementPtrInst(LHS, C, "tmp", CurBB); - return CastToType(V, TREE_TYPE(exp)); + // If EltSize exactly divides Offset, then we know that we can turn + // this into a getelementptr instruction. + int64_t EltOffset = Offset/EltSize; + if (EltOffset*EltSize == Offset) { + // If this is a subtract, we want to step backwards. +...
2007 Apr 20
2
[LLVMdev] llvm-gcc Bug, Looking for Advice on Fix
...ing llvm-gcc. The culprit is in TreeToLLVM::EmitMemCpy: void TreeToLLVM::EmitMemCpy(Value *DestPtr, Value *SrcPtr, Value *Size, unsigned Align) { const Type *SBP = PointerType::get(Type::Int8Ty); const Type *IntPtr = TD.getIntPtrType(); Value *Ops[4] = { CastToType(Instruction::BitCast, DestPtr, SBP), CastToType(Instruction::BitCast, SrcPtr, SBP), CastToSIntType(Size, IntPtr), ConstantInt::get(Type::Int32Ty, Align) }; new CallInst(Intrinsic::getDeclaration(TheModule, (IntPtr == Type::Int32Ty) ?...
2007 Nov 07
3
[LLVMdev] RFC: llvm-convert.cpp Patch
...LV = EmitLV(exp); bool isVolatile = TREE_THIS_VOLATILE(exp); const Type *Ty = ConvertType(TREE_TYPE(exp)); - unsigned Alignment = expr_align(exp) / 8; + unsigned DstAlign = expr_align(exp) / 8; if (!LV.isBitfield()) { if (!DestLoc) { @@ -2548,17 +2549,17 @@ Value *Ptr = CastToType(Instruction::BitCast, LV.Ptr, PointerType::get(Ty)); LoadInst *LI = Builder.CreateLoad(Ptr, isVolatile, "tmp"); - LI->setAlignment(Alignment); + LI->setAlignment(DstAlign); return LI; } else { EmitAggregateCopy...
2007 Nov 07
0
[LLVMdev] RFC: llvm-convert.cpp Patch
> How about this patch then? How about this one :) It passes alignment and volatility around with DestLoc. It's not finished because I noticed some bugs in how CopyAggregate and ZeroAggregate handle alignment (problem points marked with "QQ"). Also, I noticed potential problems with how we handle call arguments and return results (what if they are strangely aligned/volatile?),
2009 Jan 09
2
[LLVMdev] RFC: Store alignment should be LValue alignment, not source alignment
...TERNAL ERROR: Referencing decl that hasn't been laid out"); abort(); @@ -5924,7 +5936,13 @@ LValue TreeToLLVM::EmitLV_DECL(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), Alignme...
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