search for: llvmbuilderref

Displaying 20 results from an estimated 23 matches for "llvmbuilderref".

2020 Apr 15
2
question on the signature of malloc
Hi all, consider the following function from Core.cpp in LLVM 9.0.0: LLVMValueRef LLVMBuildMalloc(LLVMBuilderRef B, LLVMTypeRef Ty, const char *Name) { Type* ITy = Type::getInt32Ty(unwrap(B)->GetInsertBlock()->getContext()); Constant* AllocSize = ConstantExpr::getSizeOf(unwrap(Ty)); AllocSize = ConstantExpr::getTruncOrBitCast(AllocSize, ITy); Instruction* Malloc = Ca...
2013 May 13
0
[LLVMdev] Problem with llvm-c
Hi James, On 13/05/13 00:25, James Courtier-Dutton wrote: > 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()
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
2008 Apr 10
0
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Dominic Hamon wrote: > Duncan Sands wrote: >>> Another option that was discussed in #llvm is to nuke LLVMBuilder >>> and rename LLVMFoldingBuilder to LLVMBuilder. If this was the case, >>> I'd argue for a flag in the Builder that could retain the old >>> non-folding functionality for debugging purposes. >>> >> >> this plan
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
.../Core.h > =================================================================== > --- include/llvm-c/Core.h (revision 50213) > +++ include/llvm-c/Core.h (working copy) > @@ -69,6 +69,7 @@ > typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef; > typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; > > + > /* Used to provide a module to JIT or interpreter. > * See the llvm::ModuleProvider class. > */ ? :) > @@ -441,6 +459,9 @@ > /* Operations on call sites */ > void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC); > unsigned LLVMGetInstructio...
2008 Apr 26
2
[LLVMdev] ParamAttr Patch - Alignment fix
...======================================================= > > --- include/llvm-c/Core.h (revision 50213) > > +++ include/llvm-c/Core.h (working copy) > > @@ -69,6 +69,8 @@ > > typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef; > > typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; > > > > +typedef struct LLVMOpaqueParamAttrs *LLVMParamAttrs; > > Please delete this, as it is unused. > > > +void LLVMInstrAddParamAttr(LLVMValueRef, unsigned index, > > LLVMParamAttr); > > +void LLVMInstrSetAlignment(LLVMValueRef, unsigned index, unsigned &...
2008 Apr 11
4
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
...constant fold if Ptr is a constant. + CallInst *CreateCall(Value *Callee, const char *Name = "") { + return Insert(CallInst::Create(Callee, Name)); You should be indenting by two spaces (I think Chris mentioned this). - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMFoldingBuilder, LLVMBuilderRef ) + DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder, LLVMBuilderRef ) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(PATypeHolder, LLVMTypeHandleRef ) Please add spaces so that these line up again. -<p>Well, that was easy :). In practice, we recommend always using ... +<p>W...
2008 Mar 04
1
[LLVMdev] [PATCH] Prefer to use *.opt ocaml executables as they are more efficient.
I noticed that the ocaml compilation isn't using the .opt executables if they're available. We might gain a slight optimization in ocaml compile time by optionally using them with this patch. --- autoconf/configure.ac | 18 +++++ configure | 195 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 188 insertions(+), 25 deletions(-) -------------- next part
2008 Mar 04
0
[LLVMdev] [PATCH] Cleanup the c and ocaml binding documentation.
...e [LLVMTypeHandleRef] to resolve this problem. See the > + * [llvm::AbstractTypeHolder] class. > */ > typedef struct LLVMOpaqueTypeHandle *LLVMTypeHandleRef; > > @@ -70,12 +70,12 @@ typedef struct LLVMOpaqueBasicBlock > *LLVMBasicBlockRef; > typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; > > /* Used to provide a module to JIT or interpreter. > - * See the llvm::ModuleProvider class. > + * See the [llvm::ModuleProvider] class. > */ > typedef struct LLVMOpaqueModuleProvider *LLVMModuleProviderRef; > > /* Used to provide a module to JIT or interpreter. > -...
2008 Apr 10
3
[LLVMdev] LLVMBuilder vs LLVMFoldingBuilder
Duncan Sands wrote: >> Another option that was discussed in #llvm is to nuke LLVMBuilder and >> rename LLVMFoldingBuilder to LLVMBuilder. If this was the case, I'd >> argue for a flag in the Builder that could retain the old non-folding >> functionality for debugging purposes. >> > > this plan sounds good to me. However it's not clear to me how
2008 Mar 04
1
[LLVMdev] [PATCH] Cleanup the c and ocaml binding documentation.
--- bindings/ocaml/llvm/llvm.ml | 2 +- bindings/ocaml/llvm/llvm.mli | 2 +- bindings/ocaml/llvm/llvm_ocaml.c | 2 +- include/llvm-c/Core.h | 32 +++++++++++++++++++------------- 4 files changed, 22 insertions(+), 16 deletions(-) -------------- next part -------------- A non-text attachment was scrubbed... Name: 316a84e85ed2363551149e65a227c8e7c8192624.diff Type:
2012 Apr 25
2
[LLVMdev] Crash in JIT
...lueRef xParam = LLVMGetParam(func, 1); LLVMSetValueName(xParam, "x"); LLVMValueRef bParam = LLVMGetParam(func, 2); LLVMSetValueName(bParam, "b"); LLVMBasicBlockRef entryBB; entryBB = LLVMAppendBasicBlockInContext(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"); LLVMVal...
2008 Apr 26
0
[LLVMdev] ParamAttr Patch - Alignment fix
.../Core.h > =================================================================== > --- include/llvm-c/Core.h (revision 50213) > +++ include/llvm-c/Core.h (working copy) > @@ -69,6 +69,8 @@ > typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef; > typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; > > +typedef struct LLVMOpaqueParamAttrs *LLVMParamAttrs; Please delete this, as it is unused. > +void LLVMInstrAddParamAttr(LLVMValueRef, unsigned index, > LLVMParamAttr); > +void LLVMInstrSetAlignment(LLVMValueRef, unsigned index, unsigned > align); > +void LLVMInstrRe...
2013 Sep 30
1
[LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
Attached is what I got thus far. What I'm struggling with is proper integration in build system. What is in there is just wild guesses from my side, both on autoconf and cmake variants. It would be great if someone with proper knowledge of the buildsystems could have a look. Also I'm not sure how to properly handle compilation on msvc - clearly "-std=c11 -Wstrict-prototypes" is
2008 Apr 24
2
[LLVMdev] ParamAttr Patch - Alignment fix
Hi.. Updated so you now set alignment through LLVMInstrSetAlignment. Anders Johnsen -------------- next part -------------- A non-text attachment was scrubbed... Name: ParamAttr.patch Type: text/x-diff Size: 7420 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080424/cb72b4bb/attachment.patch>
2012 Apr 25
0
[LLVMdev] Crash in JIT
...LLVMValueRef xParam = LLVMGetParam(func, 1); LLVMSetValueName(xParam, "x"); LLVMValueRef bParam = LLVMGetParam(func, 2); LLVMSetValueName(bParam, "b"); LLVMBasicBlockRef entryBB; entryBB = LLVMAppendBasicBlockInContext(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 retIns...
2010 Aug 12
3
[LLVMdev] LLVM-C: Calling functions contained in other libraries
...; <i8*> [#uses=1] ret i8* %myCall } Where am I going wrong here? To add some code to my previous question: LLVMTypeRef i8Ptr(void) { return LLVMPointerType(LLVMInt8Type(), 0); } LLVMValueRef d(LLVMModuleRef module) { LLVMValueRef result; LLVMBasicBlockRef block; LLVMBuilderRef builder = LLVMCreateBuilder(); LLVMValueRef fullUsername = LLVMAddFunction(module, "NSFullUserName", LLVMFunctionType(LLVMPointerType(LLVMInt8Type(), 0), NULL, 0, 0)); LLVMSetLinkage(fullUsername, LLVMExternalLinkage); result = LLVMAddFunction(module, "MyFunctio...
2011 Jul 09
1
[LLVMdev] getting and setting array indices c interface
I really can't figure out how to get and set array indices from the c interface. so to get an element I'm calling tindex = *fn\SymbolTable(*index\name) index = LLVMBuildLoad(builder,tindex,"index") arr = *fn\SymbolTable(*array\name) arrptr = LLVMBuildLoad(Builder,arr,"arrayptr") tmp = LLVMBuildGEP(Builder,arrptr,index,0,"ptr") ptr =
2012 Sep 27
0
[LLVMdev] Possible bug or misunderstanding of feature LLVMConstIntOfString
...rMainFuncType = LLVMFunctionType(LLVMInt32Type(), vpMainFuncTypes, 2, 0); LLVMValueRef vFnMain = LLVMAddFunction(modCEx, "main", rMainFuncType); LLVMSetFunctionCallConv(vFnMain, LLVMCCallConv); LLVMBasicBlockRef bEntry = LLVMAppendBasicBlock(vFnMain, "entry"); LLVMBuilderRef bldr = LLVMCreateBuilder(); LLVMPositionBuilderAtEnd(bldr, bEntry); // "C" printf function; LLVMTypeRef vpFnPrintfArgsType[] = { LLVMPointerType(LLVMInt8Type(), 0) }; LLVMTypeRef vFnPrintfType = LLVMFunctionType(LLVMInt32Type(), vpFnPrintfArgsType, 1, 1); LLVMValueRef...
2008 Apr 26
2
[LLVMdev] ParamAttr Patch - Alignment fix
...======================================================= > > --- include/llvm-c/Core.h (revision 50213) > > +++ include/llvm-c/Core.h (working copy) > > @@ -69,6 +69,7 @@ > > typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef; > > typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; > > > > + > > > > /* Used to provide a module to JIT or interpreter. > > * See the llvm::ModuleProvider class. > > */ > > ? :) > > > @@ -441,6 +459,9 @@ > > /* Operations on call sites */ > > void LLVMSetInstructionCallConv(LLVM...