similar to: [LLVMdev] Inserting a function call using LLVM

Displaying 20 results from an estimated 20000 matches similar to: "[LLVMdev] Inserting a function call using LLVM"

2012 Oct 08
0
[LLVMdev] Inserting a function call using LLVM
Hi Teja, > I am new to LLVM and interested in using LLVM to work on a research project for > my Master's degree. > My idea is following - > > 1. I have a simple C program basic.c - > #include <stdio.h> > int main() { > printf("Hello World"); > return 0; > } > > 2. I will generate IR byte code for this basic.c using - > llvm-gcc
2010 Apr 21
2
[LLVMdev] Function pointers bitcasted to varargs
Hi all, I had the following function that used function pointers with void arguments, typedef void (*FP)(); void foo() { printf("hello world from foo\n"); } int main() { FP fp; fp = foo; (*fp)(); } The corresponding bitcode, with no optimizations is target datalayout =
2011 Jun 29
2
[LLVMdev] hello world error
Hi All, I am using llvm-2.9 to cross compile to alpha. I know that alpha is in experimental stage, but i can not get even the "Hello World" program to run on it. Here is what happens, the bitcode file for the hello world program is as follow: ; ModuleID = 'hello.bc' target datalayout =
2009 Nov 16
2
[LLVMdev] lli -force-interpreter complains about external function
Hi: When I try to execute lli -force-interpreter=true hello.bc, it gave the following error: LLVM ERROR: Tried to execute an unknown external function: i32 (i8*)* puts I think the error is because C library is not being linked with the byte code, but I was not able to find any helpful instruction in lli's document. Can you please teach me how to do it? Thanks Xu The hello.bc is
2010 Apr 21
0
[LLVMdev] Function pointers bitcasted to varargs
Do you compile this as C? In C, unlike in C++, empty parenthesis do not mean "no arguments", they mean "no prototype", which is typically treated the same way as varargs in calling conventions. To declare function with no arguments do typedef void (*FP)(void); Eugene On Wed, Apr 21, 2010 at 10:22 PM, Arushi Aggarwal <arushi987 at gmail.com> wrote: > Hi all, > >
2011 Jun 29
0
[LLVMdev] hello world error
Hi, I found that machine dead code elimination, does not respect the calling convention of alpha and eliminates r16, which was set correctly during code generation. I verified it with -print-after-all. Does anybody have a patch for this? On Wed, Jun 29, 2011 at 11:12 AM, Ankit Sethia <asethia at eecs.umich.edu>wrote: > Hi All, > > I am using llvm-2.9 to cross compile to alpha. I
2012 Feb 06
2
[LLVMdev] misc questions on opt and bitcode
Hi Eric, Here's the C code (example.c): include <stdio.h> int main() { printf("testing\n"); } Here's the LLVM IR (from llvm-gcc): ModuleID = 'example.c' target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple =
2010 May 13
4
[LLVMdev] How to get the variable mapping between the source and llvm bytecode
Hi, I want to know the variable mapping between the source and llvm bytecode. It seems that current llvm debugging information cannot provide this mapping directly. Here is my examples (llvm 2.7). In this exmaple, I want to know the mapping: tmp<--->%4. But current llvm's debugging information can only provide that the instruction "%4 = add nsw i32 %3, 2" is at line 3 in
2011 Oct 05
2
[LLVMdev] LLVM IR is a compiler IR
All, I should have chimed in earlier, but have been working on two more side-channel variants of this conversation. At the beginning the PNaCl team was strongly pushing for trying to keep platform ABI compatibility on all platforms while taking one portable bitcode stream as input. During the discussions we've had over the past few weeks it became obvious that that is simply not tractable,
2010 May 13
0
[LLVMdev] How to get the variable mapping between the source andllvm bytecode
Hi, I want to get the mapping between C source's variables and bytecode variables. It seems that llvm doesn't provide this mapping, so I think a walk-around method is to get the instruction's mapping. I have to use llvm-gcc, not clang. Any advice? Thanks. Best, Kecheng 2010-05-13 From: Eli Friedman Date: 2010-05-13 15:38:36 To: Kecheng Cc: llvmdev Subject: Re: [LLVMdev] How
2012 Feb 06
0
[LLVMdev] misc questions on opt and bitcode
On Feb 5, 2012, at 11:32 AM, Arpan Sen wrote: > For the very simple example below, I get Unknown instruction error from lli and llvm-dis, while llc does not print anything. Not sure what is that I am missing here. My llvm-gcc version is i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) > 1-39-155-188:pastebin Babai$ llvm-gcc example.c
2010 Oct 19
0
[LLVMdev] Structure memory layout
On 19 October 2010 07:57, Jin Gu Kang <jaykang10 at imrc.kist.re.kr> wrote: > Frist, I have been implementing common type for struct type on bitcode > at compilation time using llvm-gcc and then changing common type to target > specific types at code generation time using llc (reconstruct StructLayout). Hi Jin, Apart from bitfields and unions, the struct type is pretty much target
2010 Oct 19
4
[LLVMdev] Structure memory layout
Hi LLVM members, I have been working to make target independent memory layout for struct type(Aggregate type) in my team. I think that struct type has different memory layouts according to each target system in current LLVM. To implement target dependent concept for struct type, Frist, I have been implementing common type for struct type on bitcode at compilation time using llvm-gcc and then
2011 Aug 19
2
[LLVMdev] How to halt a program
Guys, I would like to instrument the bytecode that LLVM produces with assertions. I have written the instrumentation code manually, but I do not know how to halt the program in case the assertion is false. I took a look into the bytecode that LLVM produces for a program like: #include <stdlib.h> int main() { exit(1); } And it is like this: define i32 @main() nounwind { entry:
2011 Feb 15
3
[LLVMdev] Structure Types and ABI sizes
Hi all, We're hitting some walls here when generating the correct structure layout for specific C++ ABI requirements, and I was wondering how much StructLayout could help. For instance, the ABI has some complicated rules on the size of derived classes (http://www.codesourcery.com/public/cxx-abi/abi.html#class-types) and LLVM struct type cannot reflect that in full. Example: // CHECK:
2010 May 14
2
[LLVMdev] How to get the variable mapping between the sourceandllvm bytecode
Eli, Thanks very much for your reply. That's what I want to know. It works for this example. But I usually have to deal with the optimized bytecode with "-O". See the example: ************** C source ************** int h (int j, int i) { int tmp; tmp = j+i+2; return tmp; } +++++++++++++++++++++++++++++++++++++ .ll file: ; ModuleID = 'simplecase.c' target
2012 Feb 05
2
[LLVMdev] misc questions on opt and bitcode
Hi, For the very simple example below, I get *Unknown instruction error from lli and llvm-dis*, while* llc does not print anything*. Not sure what is that I am missing here. My llvm-gcc version is i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) 1-39-155-188:pastebin Babai$ cat example.c #include <stdio.h> void hello() {
2011 Aug 19
0
[LLVMdev] How to halt a program
Victor Campos wrote: > Guys, > > I would like to instrument the bytecode that LLVM produces with > assertions. I have written the instrumentation code manually, but I do > not know how to halt the program in case the assertion is false. I took > a look into the bytecode that LLVM produces for a program like: > > #include <stdlib.h> > int main() { >
2011 Nov 03
5
[LLVMdev] LLVM problem, please do not ignore
Dear sir or madam, I am a 4-th year student at Yerevan State University, Armenia; and I am studying LLVM in order to write my Bachelor thesis. I am trying to write an llvm pass that just removes all "Add" commands and gives some statstics. Nevertheless, I get this segmentation fault: ................some rows about functions, that are not changed by my pass. The errors occurs after it
2009 Jun 29
4
[LLVMdev] Limitations of Alias Analysis?
Hi, all According to the document "LLVM Alias Analysis Infrastructure", I evaluated the AA performance by using the paramenters '-basicaa -ds-aa -anders-aa'. The source code 'test.c' is listed as follow: //------------=== Source code ===------------// #include<stdlib.h> typedef struct { int x; int y; } Location; Location* getNewLocation(int x, int y) {