similar to: [LLVMdev] ConstantExpr Evaluation

Displaying 20 results from an estimated 8000 matches similar to: "[LLVMdev] ConstantExpr Evaluation"

2011 Sep 24
2
[LLVMdev] Reading Static Values
Hi, I'm currently trying to translate LLVM IR language to VPO .dec file specification. I'm using LLVM source parser in the same way that it is used in tools llc or llvm-as. One issue I'm having is I cannot find any static values. For example, in a global declaration i.e. '@a = global i32 7, align 4' I cannot get '7' from the parsed structure. Similarly (sort
2011 Oct 28
1
[LLVMdev] ConstantExpr Handling?
Hi, I was wondering how exactly LLVM handles the ConstantExpr, specifically GEP ConstantExpr, in code generation. From what I'm reading, translating these Constant Expressions into Instructions can slow the code, so I'd like to be able to handle ConstantExpr in the same way that LLVM code generation does. Thanks, Brandon
2012 Jul 01
0
[LLVMdev] ConstantExpr refactoring
Renato Golin wrote: > Hi all, > > It's been a long time, and I'm probably going to kill myself, but I > want to try it anyway. I don't think that turning off folding of constants is the right place to start. To implement this, start by adding new constants that are going to replace the existing ones. A good rule of thumb is "whatever the relocations in a given
2012 Jun 29
6
[LLVMdev] ConstantExpr refactoring
Hi all, It's been a long time, and I'm probably going to kill myself, but I want to try it anyway. Bug 10368 [1] tells me that ConstantExpr shouldn't automatically fold, and that this is source of many problems (most notably with traps) and code duplication. However, I'm a bit lost... There seem to be constant folding in many places like ConstantExpr::get*() uses
2013 Sep 06
1
[LLVMdev] How to get the exact integer from a Value
Thank you, Chuck! It works. And, please forgive my greed : ), another question: I found that: In IR of llvm which generated by my testing code, there is a Inst said " getelementptr inbounds [5 x i32]* %idxarr, i32 0, i64 3". The idxarr is my array name, and I think Inst means getting the ptr of the 4th (3+1) element of array "idxarr", am I right? So the question is: how can
2012 Jul 04
2
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
Evening, I was writing some code that tried to insert calls to the llvm.annotation intrinsic function, which has a signature of (i32, i8*, i8*, i32). The code is below. void addAnnotation( BasicBlock *block, Function *F) { string foo = "foo"; string bar = "barr"; Type *charTy = Type::getInt8Ty(block->getContext()); ArrayType *s1Ty =
2009 Sep 23
2
[LLVMdev] DebugFactory
On Sep 22, 2009, at 4:49 PM, Talin wrote: > > // Calculate the size of the specified LLVM type. > Constant * DebugInfoBuilder::getSize(const Type * type) { > Constant * one = ConstantInt::get(Type::Int32Ty, 1); > return ConstantExpr::getPtrToInt( > ConstantExpr::getGetElementPtr( > ConstantPointerNull::get(PointerType::getUnqual(type)), >
2011 Nov 10
2
[LLVMdev] Possible Phi Removal Pass?
Looking through this mailing list's archives, I've found that the most common fix attempted for removing phi instructions is to use the reg2mem pass. However I'm also finding that this does no guarantee the removal of all phi instructions. I want to write a pass to remove phi instructions without changing register/memory usage. Does this sort of translation of phi
2011 May 18
0
[LLVMdev] access array problem
Hi Tan Guangming, > I want to access an array in my instrumentation code. For example: > > GlobalVariable: > int *counter; //counter the number of load/store operations in run-time > int *counterArray; //record the load/store addresses strictly speaking these are not arrays, they are pointers. Also, you have written them in some kind of C-style idiom. What are the declarations
2011 May 18
3
[LLVMdev] access array problem
Hi, I want to access an array in my instrumentation code. For example: GlobalVariable: int *counter; //counter the number of load/store operations in run-time int *counterArray; //record the load/store addresses //increase the counter if a load/store is performed std::vector<Constant *>index(2); index[0] = Constant::getNullvalue(Type:getInt32Ty(Context)); index[1] =
2007 May 11
2
[LLVMdev] identifing mallocs with constant sizes
I am writing some code to identify malloc instructions with constant request sizes and to determine the request size if it is constant. I have two questions. 1) If a malloc is for an array allocation and the array size is a ConstantExpr, how can I obtain the value of the ConstantExpr? 2) I am using the following logic to determine if the malloc is for a constant request size and to
2004 Jun 17
4
[LLVMdev] generating instructions with embedded ConstantExprs from within LLVM
How is this done? Everything logical I have tried has failed, here was one attempt: Constant *C = (Constant*) ConstantArray::get(inst2string(I)); //fucnction defined elsewhere //generates a correct Global string GlobalVariable *str = new GlobalVariable(C->getType(), true, GlobalValue::InternalLinkage, C, mkStrName( strNumber++ ), &M); std::vector<Value*>
2011 May 18
2
[LLVMdev] access array problem
于 2011/5/18 14:29, Duncan Sands 写道: > Hi Tan Guangming, > >> I want to access an array in my instrumentation code. For example: >> >> GlobalVariable: >> int *counter; //counter the number of load/store operations in run-time >> int *counterArray; //record the load/store addresses > strictly speaking these are not arrays, they are pointers. Also, you have
2012 Jul 04
0
[LLVMdev] Bogus assert in VMCore/Instructions.cpp CallInst::Create?
Andrew Ruef wrote: > Evening, > > I was writing some code that tried to insert calls to the > llvm.annotation intrinsic function, which has a signature of (i32, > i8*, i8*, i32). The code is below. > > void addAnnotation( BasicBlock *block, Function *F) > { > string foo = "foo"; > string bar = "barr"; > > Type
2007 May 11
0
[LLVMdev] identifing mallocs with constant sizes
Ryan M. Lefever wrote: > I am writing some code to identify malloc instructions with constant > request sizes and to determine the request size if it is constant. I > have two questions. > > 1) If a malloc is for an array allocation and the array size is a > ConstantExpr, how can I obtain the value of the ConstantExpr? > The only way I know of is to determine what type
2015 May 26
2
[LLVMdev] convert GetElemtPtr result to pointer on element?
Hi all, I'm still struggling with getElementPtr. I have a global variable (array of doubles). I can use ConstantExpr::getGetElementPtr(myGlobalVariable, indices) and use the result as argument of e.g. a function. I read the GEP docu and know that I need anextra leading '0' index to dereference the global's pointer. So far so good. But I can not succeed in using the
2011 May 18
0
[LLVMdev] access array problem
Hi Guangming Tan, >>> GlobalVariable: >>> int *counter; //counter the number of load/store operations in run-time >>> int *counterArray; //record the load/store addresses >> strictly speaking these are not arrays, they are pointers. Also, you have >> written them in some kind of C-style idiom. What are the declarations in >> LLVM IR? > const Type
2009 Sep 22
0
[LLVMdev] DebugFactory
On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com>wrote: > On Tue, Sep 22, 2009 at 9:21 AM, Devang Patel <devang.patel at gmail.com> > wrote: > > On Tue, Sep 22, 2009 at 12:14 AM, Talin <viridia at gmail.com> wrote: > >> So, one feature of the late, lamented DebugInfoBuilder that I am missing > >> quite badly, and which is not
2011 Aug 01
1
[LLVMdev] SwitchInst::addCase with BlockAddress
Nella citazione lunedì 1 agosto 2011 08:13:12, Eli Friedman ha scritto: > On Sun, Jul 31, 2011 at 7:36 AM, Carlo Alberto Ferraris > <cafxx at strayorange.com> wrote: >> I'm trying to figure out how to feed a blockaddress to a switch condition >> AND destination (basically emulating an indirectbr via a switch; I know it's >> not a good approach, I'm just
2012 Dec 18
1
[LLVMdev] target specific ways to extend ConstantExpr
That's an interesting idea. What are the essential differences between the new subclass and ConstantExpr? Will it end up like ConstantExpr? Or you want it to be ConstantExpr 'done right'? Thanks. Yuan -----Original Message----- From: Eli Friedman [mailto:eli.friedman at gmail.com] Sent: Monday, December 17, 2012 5:40 PM To: Yuan Lin Cc: Chris Lattner; llvmdev at cs.uiuc.edu