similar to: [LLVMdev] Getting the memory address of all operands on an expression

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Getting the memory address of all operands on an expression"

2013 Jun 11
0
[LLVMdev] Getting the memory address of all operands on an expression
Hi Abhinash, On 10/06/13 23:05, Abhinash Jain wrote: > How to get memory address of all operands which constitutes an expression ? in LLVM IR, the operands of most expression are registers, so don't have a memory address. In short, you can't always succeed. However in cases where the operands do come from memory in a fairly direct way, you can find out what the memory is using the
2013 Jun 18
3
[LLVMdev] Getting the memory address of all operands on an expression
> in LLVM IR, the operands of most expression are registers, so don't have a memory address. Yes I agree with your this statement, But before becoming part of the expressions, the registers will actually fetch some value from memory, through Load operations. as shown in example "r3=r1+r2" will be the expression, where registers such as r1 and r2 contains (fetch) the values from
2013 Jun 18
0
[LLVMdev] Getting the memory address of all operands on an expression
On Mon, Jun 17, 2013 at 11:49 PM, Abhinash Jain <omnia at mailinator.com>wrote: > > But before becoming part of the expressions, the registers will actually > fetch some value from memory, through Load operations. > This is not true; the virtual registers need not be loaded from memory. You may find <
2013 Jun 19
2
[LLVMdev] Getting the memory address of all operands on an expression
In short if suppose i have some expression as a=b+c-d*e, and with the help of LLVM pass i want to make a string like this:- "[Hexadecimal address of 'b'] [opcode of +] [Hexadecimal address of 'c'] [opcode of -] [Hexadecimal address of 'd'] [opcode of *] [Hexadecimal address of 'e']". Than how can i make it................ -- View this message in
2013 Oct 19
2
[LLVMdev] Name of Virtual Registers
How can I get the name of the virtual Registers present on an instruction. eg. %add18 = add nsw i32 %mul17, %37 in this case I want to extract the name of the virutal registers as "add18", "mul17","37". This can easily be done in the case of store Instruction eg. store i32 %add20, i32* %t, align 4 in this case functions like
2014 May 24
2
[LLVMdev] How to count the number of **LLVM** instructions executed dynamically
Hi, I wanted to count the number of "*LLVM*" instruction executed dynamically in any program. Have already tried "lli -stats -force-interpreter filename.bc", but it's not giving any information related to instruction count. lli --version output:- LLVM version 3.4svn DEBUG build with assertions. Default target: x86_64-unknown-linux-gnu Host CPU: corei7 -- View
2013 Jun 19
0
[LLVMdev] Getting the memory address of all operands on an expression
On 19/06/13 03:12, Abhinash Jain wrote: > In short if suppose i have some expression as a=b+c-d*e, and with the help > of LLVM pass i want to make a string like this:- > > "[Hexadecimal address of 'b'] [opcode of +] [Hexadecimal address of 'c'] > [opcode of -] [Hexadecimal address of 'd'] [opcode of *] [Hexadecimal > address of 'e']".
2013 Jul 26
2
[LLVMdev] LLVM ERROR : Invalid instruction
@Jim Grosbach, Is there anyway to resolve it??? -- View this message in context: http://llvm.1065342.n5.nabble.com/LLVM-ERROR-Invalid-instruction-tp59856p59865.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2013 Mar 14
2
[LLVMdev] Get underlying object for Machine level memory operation
Hi, I am writing a pass that works at machine level and runs as last pass in llc (just before converting llvm specific machine instructions into target specific instructions) In this pass I am trying to get underlying object for memory operations. It turns out that due to various optimizations on machine instructions, the memory operand in the operation is not always getelementptr (for e.g., it
2013 Jul 25
2
[LLVMdev] Passing String to an external function in llvm
Hi All, On my llvm pass I have some variable named "expr" which is being declared as :- string expr; // or char *expr; // Now I want to pass this "expr" to some external function. How can I do this?? Similarly, How can I pass variable "var" to an external function which is being decalred as :- Vector<int> var; Any help will be
2013 Jul 26
2
[LLVMdev] LLVM ERROR : Invalid instruction
#include <string> #include <string.h> #include <iostream> #include <stdio.h> using namespace std; void foo(string str) { } int main() { string str="aa"; foo(str); return 0; } 1. clang++ -c -emit-llvm foo.cpp -o foo.ll 2. llc -march=cpp -o foo.ll.cpp foo.ll (at the execution of this command its giving an error as "Invalid Instruction") May I know why
2013 Mar 14
0
[LLVMdev] Get underlying object for Machine level memory operation
You can use the GetUnderlyingObjects function (notice the S at the end of the name) to collect zero or more underlying objects. This method is similar to GetUnderlyingObject except that it can look through phi and select instructions and return multiple objects. On Mar 14, 2013, at 4:15 AM, rahul <rahul3527 at gmail.com> wrote: > Hi, > > I am writing a pass that works at
2013 Sep 01
2
[LLVMdev] Distinguishing Pointer Variable and Ordinary Variable
C Code :- int main() { int a=10,c; int *b; c=20; *b=a; return 0; } IR of above code :- define i32 @main() #0 { entry: 1. %retval = alloca i32, align 4 2. %a = alloca i32, align 4 3. %c = alloca i32, align 4 4. %b = alloca i32*, align 8 5. store i32 0, i32* %retval 6. store i32 10, i32* %a, align 4 7. store i32 20, i32* %c, align 4 8. %0 = load i32* %a, align 4 9. %1 = load i32** %b,
2013 Jul 25
2
[LLVMdev] Passing String to an external function in llvm
I did some computation through llvm pass, and store those computed values on string. eg. :- stringstream lhs; lhs << instr->getOperand(1); // 'instr' is some instruction string lhsvar=lhs.str(); Now I want to pass this 'lhsvar' to the external function, so how can i do this??? This is just the part of a code to make you understand. if you say I can even provide the
2013 Oct 14
2
[LLVMdev] Generating New Functions
How can I generate a new function at compile time and insert some instruction onto it, through llvm pass. eg. 1) %y = alloca i32, align 4 2) %z = alloca i32, align 4 3) %t = alloca i32, align 4 4) %2 = load i32* %y, align 4 5) %3 = load i32* %z, align 4 6) %add = add nsw i32 %2, %3 7) %4 = load i32* %t, align 4 8) %add1 = add nsw i32 %add, %4 9) store i32 %add1, i32* %x, align 4
2013 Jul 25
2
[LLVMdev] Passing String to an external function in llvm
Thanx for the response. %x = alloca i32, align 4 %y = alloca i32, align 4 %a = alloca i32, align 4 %t = alloca i32, align 4 1. %10 = load i32* %x, align 4 2. %11 = load i32* %y, align 4 3. %div = sdiv i32 %10, %11 4. %12 = load i32* %a, align 4 5. %mul4 = mul nsw i32 %div, %12 6. store i32 %mul4, i32* %t, align 4 a. %mul4 = mul nsw i32 %div, %12 b. %div = sdiv i32 %10, %11 c. %10 =
2016 May 04
4
Conditional tablegen expressions with math ops?
In our generated asm code we've got a constraint such that two registers in a ternary op have to be in different "banks", best illustrated with an example: add r1,r2,r1 # r1 <- r2 + r1 The problem here is that the first operand (the receiver of the value) is in the same "bank" as the 3rd operand (r1 again). This will cause an extra cycle to be burned. As it turns
2013 Jul 25
2
[LLVMdev] Passing String to an external function in llvm
I have one file named hashtable.cpp whose link is "http://pastebin.com/Cq2Qy50C" and one llvm pass named testing.cpp whose link is "http://pastebin.com/E3RemxLF" Now on this testing.cpp pass I have computed the string named "expr" which I want to pass to the function named hashtable(string) in hashtable.cpp (on line 106 of testing.cpp) > looking at simple
2013 Sep 01
2
[LLVMdev] Distinguishing Pointer Variable and Ordinary Variable
Sorry I have actually edited the post. I did check its type by using isa<PointerType>(cast<AllocaInst>(instr->getOperand(1))->getAllocatedType()) but it is only detecting i32** %b on line 8 of IR as a pointer type. Whereas I also want to detect the i32* %1 on line 11 of IR as a pointer type. So how can I do this?? -- View this message in context:
2013 Jul 25
1
[LLVMdev] Passing String to an external function in llvm
> OK - seems you might want to take a few steps back & understand how > C++ code is written/structured generally (and/or take a look at other > parts of the compiler). You'll need a header file with the declaration > of your function & you can include that header file in the > hashtable.cpp and testing.cpp - if that sentence doesn't make sense to > you yet, please