search for: llvmbuildadd

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

2013 May 13
0
[LLVMdev] Problem with llvm-c
...t.bc' > > define i32 @test2() { > EntryBlock: > %1 = add i32 1, 2 > ret i32 %1 > } > > I.e. With the "add" in there. > llvm appears to be doing some optimization on it, to remove the add. if you used LLVMConstAdd to create the add, then don't, use LLVMBuildAdd instead. If you were using LLVMBuildAdd, then use a builder than doesn't do automatic constant folding. Ciao, Duncan. > Is there any way to switch off the optimization by adding something to > the ll.c file? > I will be using the llvm-c api more fully, and I wish to make sure > t...
2013 May 12
2
[LLVMdev] Problem with llvm-c
Hi, I have the following program (attached) I produces, using the llvm-c API, this: ; ModuleID = './llvm-test.bc' define i32 @test2() { EntryBlock: ret i32 3 } But, I want it to produce this: ; ModuleID = './llvm-test.bc' define i32 @test2() { EntryBlock: %1 = add i32 1, 2 ret i32 %1 } I.e. With the "add" in there. llvm appears to be doing some optimization on
2012 Apr 25
2
[LLVMdev] Crash in JIT
...BlockInContext(llvm, func, "entry"); LLVMBuilderRef builder; builder = LLVMCreateBuilderInContext(llvm); LLVMPositionBuilderAtEnd(builder, entryBB); LLVMValueRef mx; mx = LLVMBuildMul(builder, mParam, xParam, "mx"); LLVMValueRef y; y = LLVMBuildAdd(builder, mx, bParam, "y"); LLVMValueRef retInst; retInst = LLVMBuildRet(builder, y); (void) retInst; LLVMDisposeBuilder(builder); LLVMLinkInJIT(); LLVMLinkInInterpreter(); LLVMInitializeNativeTarget(); LLVMDumpModule(module);...
2012 Apr 25
0
[LLVMdev] Crash in JIT
...pendBasicBlockInContext(llvm, func, "entry"); LLVMBuilderRef builder; builder = LLVMCreateBuilderInContext(llvm); LLVMPositionBuilderAtEnd(builder, entryBB); LLVMValueRef mx; mx = LLVMBuildMul(builder, mParam, xParam, "mx"); LLVMValueRef y; y = LLVMBuildAdd(builder, mx, bParam, "y"); LLVMValueRef retInst; retInst = LLVMBuildRet(builder, y); (void) retInst; LLVMDisposeBuilder(builder); LLVMLinkInJIT(); LLVMLinkInInterpreter(); LLVMInitializeNativeTarget(); LLVMDumpModule(module); /* Now run it!...
2017 Jan 25
2
mcjit C interface problems
...ype(LLVMInt32Type(), param_types, 2, 0); LLVMValueRef sum = LLVMAddFunction(mod, "sum", ret_type); LLVMBasicBlockRef entry = LLVMAppendBasicBlock(sum, "entry"); LLVMBuilderRef builder = LLVMCreateBuilder(); LLVMPositionBuilderAtEnd(builder, entry); LLVMValueRef tmp = LLVMBuildAdd(builder, LLVMGetParam(sum, 0), LLVMGetParam(sum, 1), "tmp"); LLVMBuildRet(builder, tmp); char* error = NULL; LLVMVerifyModule(mod, LLVMAbortProcessAction, &error); LLVMDisposeMessage(error); LLVMExecutionEngineRef engine; error = NULL; LLVMLinkInMCJIT(); LLVMInitiali...
2011 Jun 18
1
[LLVMdev] loop only executes once
...LLVMIntSGT, PD, Two, "cond1") LLVMBuildCondBr(Builder, CondInst1, WhileBB, EWhileBB) //WhileBB LLVMPositionBuilderAtEnd(Builder, WhileBB) //c = a + b// //b = a// //a = c// //argx-1// PA = LLVMBuildLoad(Builder,A,"pA")// PB = LLVMBuildLoad(Builder,B,"pB")// AddAB = LLVMBuildAdd(Builder,PA,PB,"addab") LLVMBuildStore(Builder,AddAB,C)// LLVMBuildStore(Builder,PA,B)// LLVMBuildStore(Builder,AddAB,A)// sub = LLVMBuildSub(Builder,PD,One,"sub") LLVMBuildStore(Builder,sub,D)// LLVMBuildBr(Builder,ElseBB)// //Ewhile LLVMPositionBuilderAtEnd(Builder, EWhileBB...