similar to: [LLVMdev] get the value of a Constant in LLVM IR

Displaying 20 results from an estimated 1100 matches similar to: "[LLVMdev] get the value of a Constant in LLVM IR"

2013 Sep 24
2
[LLVMdev] get the address in memory where an instruction lives
Hi, i want to get the address in memory of an instruction pointer and use it as a key in my tables. i iterate over the instructions in LLVM IR like this: for (Module::iterator fi = Mod->begin(), fi_end = Mod->end(); fi != fi_end; ++fi) { for (inst_iterator I = inst_begin(fi), E = inst_end(fi); I != E; ++I) { Instruction *ii = dyn_cast<Instruction>(&*I);
2013 Aug 29
2
[LLVMdev] unique id for a llvm Instruction‏
what if another pointer points to the same instruction? Is this possible to happen? Eirini -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130829/ad6ba4bb/attachment.html>
2013 Sep 24
1
[LLVMdev] get the address in memory where an instruction lives
On 24.09.2013, at 17:38, Eirini Psallida <eirini.psallida at gmail.com <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>> wrote: >* Hi, *>* i want to get the address in memory of an instruction pointer and use it as a key in my tables.*>* i iterate over the instructions in LLVM IR like this:*>* for (Module::iterator fi = Mod->begin(), fi_end = Mod->end(); fi !=
2012 Jan 27
3
[LLVMdev] How to get the string value?
Thanks Duncan, Yes, it is a ConstantExpr! Thank you! Now trying to find a clue in ConstantExpr's functions to get that string :-) Regards, Welson On Thu, Jan 26, 2012 at 9:04 PM, Duncan Sands <baldrick at free.fr> wrote: > Hi Welson Sun, > > > Hi, if I have some LLVM code like this: > > > > @.str = private unnamed_addr constant [7 x i8]
2013 Jul 01
1
[LLVMdev] Problem with building llvm and running project
Hello, i am new to LLVM and i want to create my own project with a cpp file which calls llvm functions and then run it. I download clang source, llvm source and compiler-rt source. I tried to configure and build llvm using this http://llvm.org/docs/GettingStarted.html#getting-started-with-llvm but it failed because .h files included on top of the Hello.cpp couldn't found. Can you tell me
2013 Aug 29
0
[LLVMdev] unique id for a llvm Instruction
> > > what if another pointer points to the same instruction? > You can have many pointers to the same instruction. However, the address in memory where that instruction lives is unique. Instruction pointers (or Value pointers) are thus commonly used as keys in hash tables or similar. Instructions or Values are almost never copied, so that you won't find the same instruction at
2017 Sep 08
5
Performance of large llvm::ConstantDataArrays
I'm running into some pretty bad performance in llc.exe when compiling some large neural networks into code that contains some very large llvm::ConstantDataArrays, some are { size=102,760,448 }. There's a small about of actual code for processing the network, but the assembly is mostly global data. I'm finding that llc.exe memory spikes up around 30 gigabytes and the job takes 20-30
2013 Mar 07
1
[LLVMdev] array of pointers
                              The getInitializer() method of a GlobalVariable returns 4 pointers like below. [4 x i32*] [i32* getelementptr inbounds ([256 x i32]* @CRC24ATable, i32 0, i32 0), i32* getelementptr inbounds ([256 x i32]* @CRC24BTable, i32 0, i32 0), i32* getelementptr inbounds ([256 x i32]* @CRC16Table, i32 0, i32 0), i32* getelementptr inbounds ([256 x i32]* @CRC8Table, i32 0,
2015 May 27
2
[LLVMdev] convert GetElemtPtr result to pointer on element?
Hi Tim, I forgot to say that I try to do all this in the LLVM API, not IR. I read in a bc'ed program and try to edit it using the API. Alex Tim Northover wrote: >> But I can not succeed in using the getGetElementPtr result in >> constructing an initalizer for another global value (which expects a >> ConstantFP* and not a ConstantExpr*). > > The result of a
2017 Sep 10
2
Performance of large llvm::ConstantDataArrays
On Sat, Sep 9, 2017 at 10:18 PM, Chris Lattner via llvm-dev < llvm-dev at lists.llvm.org> wrote: > > On Sep 7, 2017, at 11:06 PM, Chris Lovett via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > I'm running into some pretty bad performance in llc.exe when compiling > some large neural networks into code that contains some very large llvm::ConstantDataArrays,
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
2013 Jul 10
2
[LLVMdev] lower-lever IR (A-normal form)
Hi, i would like to ask you, if i can get a lower-level representation than the llvm IR.For example, having the following instruction in the llvm IR, call void @llvm.memcpy.i32(i8* %19, i8* getelementptr inbounds ([2 x [2 x [3 x i8]]]* @main.s, i32 0, i32 0, i32 0, i32 0), i32 12, i32 1) i would like to get something like this (in A-normal form (without nested instructions):%temp = i8*
2017 Dec 17
2
Removing constants from a constant array?
Hi, I’m currently writing a LLVM pass and would like to modify a constant array based on some basic analysis. Is there any way to simply remove entries (`llvm::Constant`) from an array (`llvm::ConstantArray`)? Replacing all uses with an undefined value doesn’t work as the array is terminated by an undefined value, subsequent elements thus are ignored at runtime. I’d rather avoid re-creating the
2006 Mar 27
1
[LLVMdev] could you give me some advice ?
excuse me for bother you again . a little supplement Constant* c = findValue(m,"E1$entry"); Constant* c2 = findValue(m,"E1$str"); I can get string object from c2 string s = cast<ConstantArray>(c2)->getAsString(); but it is not applicable for c string s= cast<ConstantArray>(c)->getAsString(); // Assert Fail because c is ConstantExpr::GetElementPtr
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
2011 Oct 20
2
[LLVMdev] common type at compile time?
I'm a bit confused. For the Type did you mean something like: ArrayType *type = ArrayType::get(Type::getInt8PtrTy(M.getContext()), 4); This does not work, it gives me ""Wrong type in array element initializer" at runtime. Also it doesn't look like ConstantExpr inherits ConstantArray, so I'm not sure how I could use this instead. Thanks On Thu, Oct 20, 2011 at
2012 Sep 05
2
[LLVMdev] llvm::ConstantArray::get(llvm::LLVMContext&, llvm::StringRef, bool) deprecated?
Hi all; I have been trying to use the llvm::ConstantArray::get(llvm::LLVMContext&, llvm::StringRef, bool) function but seems it has been deprecated. ProfileDependence.cpp:68:73: error: no matching function for call to ‘llvm::ConstantArray::get(llvm::LLVMContext&, llvm::StringRef, bool)’ ProfileDependence.cpp:68:73: note: candidate is:
2011 Oct 20
3
[LLVMdev] common type at compile time?
I'm trying to create a ConstantArray(whose contents will be of types Function*, GlobalVariable *) so I can immediately create a new GlobalVariable(that will be in its own section). I'm doing this so I have these address stored. In order to create this ConstantArray I need a valid ArrayType, but I'm not sure what to use for the element type. I want this to be done at compile time, so I
2010 Jul 16
2
[LLVMdev] Strange behavior when converting arrays to strings
Hello, I found saw some strange behavior (to me) when converting constant arrays to strings. Consider the following example: std::string Text = "HelloWorld"; unsigned TextLengthBefore = Text.length(); ConstantArray *pArray = dyn_cast<ConstantArray>(llvm::ConstantArray::get(pModule->getContext(), Text, true)); unsigned NumElements = pArray->getNumOperands(); Text =
2009 Jul 04
2
[LLVMdev] Pool Allocation Segfaulting with opt
Hi, I'm trying to run the pool allocation pass through opt, and I'm running into problems. It segfaults frequently; for example, it does this when the input is a simple Hello World program: [simmon12 at apoc testcases]$ opt -load /home/vadve/simmon12/llvm/llvm/projects/llvm-poolalloc/Debug/lib/libLLVMDataStructure.so -load