search for: malloccall

Displaying 5 results from an estimated 5 matches for "malloccall".

2015 Jan 27
2
[LLVMdev] Create a call to function malloc using LLVM API
...etPointerElementType(); Type* ITy = Type::getInt32Ty(getGlobalContext()); Constant* AllocSize = ConstantExpr::getSizeOf(tpp) AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy); CallInst::CreateMalloc(arg_alloc, ITy, tpp, AllocSize); } But the generated LLVM IR seems incorrect: %malloccall = tail call i8* bitcast (i8* (i64)* @malloc to i8* (i32)*)(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32)) I don't quite understand the arguments of the function CallInst::CreateMalloc. Is the second argument type of p and the third one type of the element that p points to? The...
2019 Jun 28
2
Instcombine Creating Illegal Code? (in LLVM 7)
...red something that seems to me to be a bug -- or at least something that I don't understand. Take the following valid simple program and run -instcombine on it declare i8* @malloc(i64) define void @caller() { entry: call void @callee() ret void } define fastcc void @callee() { entry: %malloccall = call i8* @malloc(i64 9) store i8 0, i8* %malloccall ret void } It get's transformed into the following invalid code after the optimization (now having an illegal store): ; ModuleID = 'blarg.ll' source_filename = "blarg.ll" declare i8* @malloc(i64) define void @calle...
2010 Sep 07
0
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
On Sep 7, 2010, at 8:03 AM, F van der Meeren wrote: > Hello, > > I have a question, what is wrong with the following code? > > declare void @llvm.memcpy.p0i64.p0i64.i8(i64*, i64*, i8, i32, i1) nounwind > > ... > > call void @llvm.memcpy.p0i64.p0i64.i8(i64* %19, i64* %21, i8 %17, i32 0, i1 false) > > ... > > > According to the compiler this is the
2010 Sep 07
2
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
...i32 0, i32 0 ; <i64**> [#uses=1] %9 = load i64** %8 ; <i64*> [#uses=1] %10 = trunc i64 %7 to i32 ; <i32> [#uses=1] %mallocsize = mul i32 %10, ptrtoint (i64* getelementptr (i64* null, i32 1) to i32) ; <i32> [#uses=1] %malloccall = tail call i8* @malloc(i32 %mallocsize) ; <i8*> [#uses=1] %11 = bitcast i8* %malloccall to i64* ; <i64*> [#uses=1] call void @llvm.memcpy.p0i64.p0i64.i64(i64* %9, i64* %11, i64 %7, i32 0, i1 false) br label %exit Any ideas on what I am doing wrong here ? On 07 Sep...
2010 Sep 07
4
[LLVMdev] Intrinsic prototype has incorrect number of arguments!
Hello, I have a question, what is wrong with the following code? declare void @llvm.memcpy.p0i64.p0i64.i8(i64*, i64*, i8, i32, i1) nounwind ... call void @llvm.memcpy.p0i64.p0i64.i8(i64* %19, i64* %21, i8 %17, i32 0, i1 false) ... According to the compiler this is the error, but I seem to miss where exactly my fault is. Intrinsic prototype has incorrect number of arguments! void (i64*,