Displaying 20 results from an estimated 900 matches similar to: "[LLVMdev] Passing String to an external function in llvm"
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
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 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 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
@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
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 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 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 Jul 26
0
[LLVMdev] LLVM ERROR : Invalid instruction
On Jul 26, 2013, at 6:48 PM, Abhinash Jain <omnia at mailinator.com> wrote:
> Is there anyway to resolve it???
1. Teach the cpp backend how to handle it.
2. Compile with -fno-exceptions to turn off exceptions.
--
Stephen Checkoway
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 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 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
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
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
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
2006 Oct 10
1
[LLVMdev] tblgen multiclasses
> > Basically, flag operands are a hack used to handle resources that
> are not
> > accurately modeled in the scheduler (e.g. condition codes, explicit
> > register assignments, etc). The basic idea of the flag operand is
> that
> > they require the scheduler to keep the "flagged" nodes stuck
> together in
> > the output machine instructions.
>
2011 Oct 12
6
[LLVMdev] Integer to string
Hi,
I need to convert an integer into a string. I would normally do that in C++ by using the StringStream class, but the LLVM coding standards discourage using that class. The same coding standards suggest to use llvm:StringStream instead, but I cannot find that class anywhere; furthermore, the header file where it was supposed to be (according to the coding standards) doesn't even exist.
Is
2011 Oct 12
0
[LLVMdev] Integer to string
Hi Pablo,
Can you provide a link to the document containing a reference to
llvm::StringStream? I've looked in both the llvm coding standards,
and llvm programming manual for versions: ToT (3.0), 2.9 (which
seems to be the same as ToT), and 2.8. Obviously my search is
missing something.
Thanks in advance
Garrison
On Oct 12, 2011, at 8:18, Pablo Barrio wrote:
> Hi,
>
> I need
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
2005 Nov 23
2
[LLVMdev] llvm-ranlib: Bus Error in regressions + fix
Evan Jones wrote:
> On Nov 23, 2005, at 8:16, Evan Jones wrote:
>
>> (4) Write the foreignST into the TmpArchive file. Is there any reason
>> that this isn't possible? Then the final archive would be created in a
>> single pass, and it could just be moved into place.
>
>
> Ah. I see: It needs to be written in order to compute the offsets.
Exactly.
>