Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] How to Get Path Profile and Print it"
2012 Jul 05
0
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
Problem solved. I was building llvm in a separate llvm-build directory. I
built it within the llvm-src directory (which kept all the llvm .so and my
pass' .so in the llvm-src/Release+Asserts/lib directory) to solve the
problem.
Can anyone tell me what's the difference between writing a pass as a
"struct" (as in the tutorial) and as a "class" (as most developers do)?
2012 Jul 05
1
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
Hi,
> Problem solved. I was building llvm in a separate llvm-build directory. I
> built it within the llvm-src directory (which kept all the llvm .so and my
> pass' .so in the llvm-src/Release+Asserts/lib directory) to solve the
> problem.
I do not fully understand what you mean, there should be no difference
on building out of source AFAIK.
> Can anyone tell me what's
2013 Nov 05
1
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
Thanks for the reply.
For the source code:
int main()
{
int a = 0;
int *p;
p = &a;
call_arnamoy(p);
int *p1;
p1 = p;
return 1;
}
The bit code:
%retval = alloca i32, align 4
%a = alloca i32, align 4
%p = alloca i32*, align 8
%p1 = alloca i32*, align 8
store i32 0, i32* %retval
store i32 0, i32* %a, align 4
store i32* %a, i32** %p, align 8
%0 = load i32** %p, align 8
%call = call i32
2012 Sep 07
1
[LLVMdev] Get the filename on which a pass is running?
Hi;
I was wondering how can I get the name of the bitcode file on which I am
running the pass. I am making my pass as a loadable module. And if I run
my pass like this -
opt -S -loops -load /home/arnie/llvm-clang/llvm/Release+Asserts/lib/XYZ.so
-xyz <b.bc> b1.bc
I want to get b.bc in the pass.
Thank you;
--
Arnamoy Bhattacharyya
Athabasca Hall 143
Department of Computing Science -
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:
2012 Jun 16
2
[LLVMdev] What's Going Wrong with GCC 4.6.3 + dragonegg 3.1
Hi all;
Problem: Running a bitcode file produced by llvm-gcc (gcc 4.6.3 + dragonegg
3.1 + llvm 3.1) with lli (Ubuntu 12.04)
*llvm-gcc:*
llvm-gcc -c hello.c -emit-llvm -o hello.bc
lli hello.bc
output:
lli: hello.bc:1:1: error: expected top-level entity
ELF@4(
*clang:*
clang -c hello.c -emit-llvm -o hello.bc
lli hello.bc
output:
hello world
hello.c:
#include <stdio.h>
int main() {
2012 May 20
1
[LLVMdev] Error While Inserting New Instruction to LLVM IR
Hello;
I wanted to insert two new terminator instructions in LLVM IR. I modified
the necessary files (as mentioned in the tutorial in LLVM site and some
more to meet the new structure of LLVM, (e.g no Lexer.l now, we have
LLLexer.cpp. Again in the tutorial, files like LLVMBitCodes.h,
include/llvm-c/core.h that need to be modified are not mentioned) But I am
getting the error while building
2013 Nov 05
0
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
I think I understood the problem you're trying to solve. I didn't, however,
understand the problems you are having (maybe you're not running mem2reg?).
I do have a little piece of code that I think does (more or less) what you
want.
Take a look at it, try understanding it, and see if it helps you out.
You might have to change it a bit since you're replacing uses after an
2012 May 18
3
[LLVMdev] Adding a New Instruction to LLVM IR
Hello;
I was planning to add a new instruction to the LLVM IR (and later to MIPS
backend) for TLS(Thread level speculation) support. For this I tried to
follow the steps described in http://llvm.org/docs/ExtendingLLVM dot
html#instruction.
But I could not find any llvm/lib/AsmParser/Lexer.l
and llvm/lib/AsmParser/llvmAsmParser.y file in both the svn repository and
the source code downloaded
2012 Jun 16
0
[LLVMdev] What's Going Wrong with GCC 4.6.3 + dragonegg 3.1
Arnamoy Bhattacharyya wrote:
> Hi all;
>
> Problem: Running a bitcode file produced by llvm-gcc (gcc 4.6.3 +
> dragonegg 3.1 + llvm 3.1) with lli (Ubuntu 12.04)
>
> /llvm-gcc:/
>
> llvm-gcc -c hello.c -emit-llvm -o hello.bc
> lli hello.bc
>
> output:
> lli: hello.bc:1:1: error: expected top-level entity
> ELF@4(
>
> /clang:/
>
> clang -c hello.c
2012 Jun 20
3
[LLVMdev] Is Loop Dependence Analysis Printing Correct Stats?
Hi;
I was playing with the -lda pass of LLVM on the following program-
#include <stdio.h>
void main()
{
int a[10];
int i;
for(i = 0; i < 4; i ++)
{
a[i] = a[i-1]+1;
}
}
I run the following commands -
clang a.c -emit-llvm -S
opt -analyze -stats -lda a.s
The output is -
Printing analysis 'Loop Dependence Analysis':
Loop at depth 1, header block: %for.cond
Load/store
2012 Jul 04
1
[LLVMdev] Correct Way to Build an LLVM Pass
Hi;
I wrote an LLVM transformation pass and I put my code inside the
llvm-src/lib/Transforms/my-pass directory. I want to know what is the
correct method for compiling it and building my plugin for the pass. After
reading the http://llvm.org/docs/WritingAnLLVMPass.html page, I felt that I
have to keep my pass inside the above said directory. But when I run make
from inside my-pass directory
2012 Sep 05
1
[LLVMdev] Calling a function with a pointer to a global char array as argument
Hello;
Thanks to Eli for the pointer to the ConstantDataArray::getString()
fucntion. Now I am trying to declare a global char array with the content
"hi" and call a function "print" (which takes a char pointer and return an
insteger.
I am doing the following in the code -
Function Creation:
PointerType* array =
PointerType::get(IntegerType::getInt8Ty(getGlobalContext())
2012 Jun 18
1
[LLVMdev] Any Work Done/ Going on for OpenMP Support in Clang?
Hello;
I saw a discussion went i the llvm mailing list about work on supporting
OpenMP in Clang (llvm-gcc already supports that).(
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-January/046640.html)
I just want to know, anybody has made any progress in it? It would be
really helpful for me.
Thanks a lot;
--
Arnamoy Bhattacharyya
Athabasca Hall 143
Department of Computing Science -
2012 Jul 05
3
[LLVMdev] "symbol lookup error" while running a Simple Loop Pass
Hello;
I wrote this simple loop pass to collect the number of instructions in each
loop of the program. The code is as follows-
#define DEBUG_TYPE "loopinst"
#include "llvm/Pass.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Instructions.h"
#include
2013 Oct 25
1
[LLVMdev] Question About Function Cloning
Thanks Tim for the pointer.
Now I am trying to create two global variables, and call functions
with the pointer to them.
Though I can create two global integers, could anyone please tell me
how do I create a pointer to a global variable (not an array) in the
IR? I know GetElementPtr can be used in case of array but what about
I want a pointer to just an integer and call my function with it?
2013 Oct 29
1
[LLVMdev] Getting TargetData and TargetLibraryInfo for determining Malloc size
Hello;
I was trying to use the computeArraySize() function from the
MemoryBuiltins.cpp file. It requires two arguments DataLayout *TD and
const TargetLibraryInfo *TLI. Can anyone tell me how to get the
TargetLibraryInfo? I am getting the DataLayout using:
DataLayout *TD;
TD = new DataLayout(&M);
I hope that's the right way of getting it.
Thanks a lot;
--
Arnamoy Bhattacharyya
2013 Oct 30
1
[LLVMdev] Setting called value for an indirect function call
Hello;
I am trying to clone some call instructions in the IR and then set the
call destination of those call instructions to my own library
functions that happens to have the same arguments and return types of
the original callee.
It works perfectly for direct calls using setCalledFunction(). But
when the function call is indirect, is there a way to set the callee?
Something like
2013 Nov 05
2
[LLVMdev] Identifying the instructions that uses a pointer used as a function argument
Hello all;
So here is my goal:
*** If there is a Call instruction to myFunction(int * val), I need to
identify all the instructions that uses val in the IR and replace the
uses with a newly created pointer. I will also be changing the
argument of myFunction to the new pointer.
int * val = malloc/calloc;
...
myFunction(val);
....
*val = 45;
becomes==
int * val = malloc/calloc;
int * val1 =
2012 Jun 16
1
[LLVMdev] How to Run OpenMP application Using "lli"
Hi;
Both -fplugin-arg-dragonegg-emit-ir and -flto works for creating llvm
bitcode that can be run with lli. Thanks to Nick for the suggestion.
Now, trying to run an OpenMP hello world program.
llvm-gcc -fopenmp p_hello.c -flto -S -o p_hello.ll
lli p_hello.ll
output: LLVM ERROR: Program used external function 'GOMP_parallel_start'
which could not be resolved!
I am guessing that I have