similar to: [LLVMdev] Copy instruction from one function to another

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Copy instruction from one function to another"

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 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 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 Jul 26
0
[LLVMdev] LLVM ERROR : Invalid instruction
Looks like the CPP backend doesn’t know how to deal with exception handling. It’s complaining that it can’t handle a landingpad instruction. -Jim On Jul 26, 2013, at 1:49 PM, Abhinash Jain <omnia at mailinator.com> wrote: > #include <string> > #include <string.h> > #include <iostream> > #include <stdio.h> > using namespace std; > > void
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
2013 Oct 14
0
[LLVMdev] Generating New Functions
On 10/14/13 5:53 AM, Abhinash Jain wrote: > 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
2013 Jun 10
3
[LLVMdev] Getting the memory address of all operands on an expression
How to get memory address of all operands which constitutes an expression ? eg. a=b+c; (want to know the memory address of b and c)...... Since I want this at run time, So at assembly level this expression will become something like as follows:- Load r1, M[b] Load r2, M[c] r3=r1+r2 store M[a],r3 Now what i want to do is that, at every store instruction, I should get the memory address of all
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 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 Jul 25
0
[LLVMdev] Passing String to an external function in llvm
On Thu, Jul 25, 2013 at 9:07 AM, Abhinash Jain <omnia at mailinator.com> wrote: > Hi All, > > On my llvm pass I have some variable named "expr" which is being declared as > :- > string expr; // or char *expr; // I don't understand this question - these are C++ declarations, not LLVM declarations (not to mention LLVM IR doesn't have
2013 Jul 25
0
[LLVMdev] Passing String to an external function in llvm
On Thu, Jul 25, 2013 at 10:12 AM, Abhinash Jain <omnia at mailinator.com> wrote: > 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
2013 Sep 01
0
[LLVMdev] Distinguishing Pointer Variable and Ordinary Variable
Check it's type to see if it's a pointer or not? On 1 September 2013 12:31, Abhinash Jain <omnia at mailinator.com> wrote: > 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
2013 Jul 25
0
[LLVMdev] Passing String to an external function in llvm
On Thu, Jul 25, 2013 at 11:07 AM, Abhinash Jain <omnia at mailinator.com> wrote: > 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.
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 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
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 =
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 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
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