search for: webcompil

Displaying 18 results from an estimated 18 matches for "webcompil".

Did you mean: webcompile
2012 Feb 02
0
[LLVMdev] Why extra 4 bytes on stack ???
...>   ret i32 %2 > } > > Question : Why there is  extra 4 bytes on stack i.e  "%1 = alloca i32, align > 4"  ??? > > Thanks > Umesh > For some reason even the simplest "int main() { return 0; }" program allocates those four bytes: ; ModuleID = '/tmp/webcompile/_29079_0.bc' 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-S128" target triple = "x86_64-unknown-linux-gnu" define i32 @main() nounwind uwtable { %1 = allo...
2011 Jul 25
3
[LLVMdev] function failing to run in Jit
...efine i32 @foo(i32 %a, i32 %b) { Entry: %mul = mul i32 %b, %a %ptr = getelementptr inbounds [1000 x i32]* @MyArray, i32 0, i32 %a store i32 %mul, i32* %ptr, align 4 ret i32 %a } Comparing it to the web compiled c equivalent I can't see any relevant difference. ; ModuleID = '/tmp/webcompile/_925_0.bc' 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 = "x86_64-linux-gnu" @array = common global [1000 x i32] zeroinitializer, align 32 ;...
2012 Feb 02
3
[LLVMdev] Why extra 4 bytes on stack ???
Hi There , Again ,I'm newbie to LLVM and please pardon me ..if you guys feel that ,the below question is very basic :) Here i go ,compiled the below sample with clang i.e *clang enum.c -S -emit-llvm* and there respective file are $ cat enum.c int main() { enum type{one=1,two,three} s; s = one; return s; } $ cat enum.s ; ModuleID = 'enum.c' target datalayout =
2013 Apr 25
1
[LLVMdev] Allocate memory for a class
Hi! When I allocate memory for a structure, in _Znwm (operator new) function I need to specify size. How can I determine this information dynamically? ; ModuleID = '/tmp/webcompile/_12211_0.bc' 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-S128" target triple = "x86_64-unknown-linux-gnu" %class.A = type { i32, float } define i32 @main(...
2007 Feb 05
1
[LLVMdev] Misc optimization issue
This is from 'early JIT tests' thread on comp.lang.misc. Given :- int ltst(int x) { int i, j; j=0; for(i=0; i<x; i++)j++; return(j); } This is from the online LLVM compiler. AND It does not seem to optimize it down ! ; ModuleID = '/tmp/webcompile/_24843_0.bc' target datalayout = "e-p:32:32" target endian = little target pointersize = 32 target triple = "i686-pc-linux-gnu" implementation ; Functions: int %ltst(int %x) { entry: %x = cast int %x to uint ; <uint> [#uses=1] %tmp13 = setgt int %x, 0 ; <bool&g...
2011 Jun 28
2
[LLVMdev] Box removal
...VM compiler: -------- #include <stdio.h> #include <stdlib.h> typedef struct Foo { int *x; int x2; }Foo; int main(int argc, char **argv) { Foo *f = (Foo *)malloc(sizeof(Foo)); f->x = (int *)malloc(sizeof(int)); *f->x = 10; return *f->x; } ---- Output: ; ModuleID = '/tmp/webcompile/_28006_0.bc' 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 = "x86_64-linux-gnu" define i32 @main(i32 %argc, i8** nocapture %argv) nounwind { e...
2011 Jul 25
0
[LLVMdev] function failing to run in Jit
...ul = mul i32 %b, %a > %ptr = getelementptr inbounds [1000 x i32]* @MyArray, i32 0, i32 %a > store i32 %mul, i32* %ptr, align 4 > ret i32 %a > } > > Comparing it to the web compiled c equivalent I can't see any relevant > difference. > > ; ModuleID = '/tmp/webcompile/_925_0.bc' > 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 = "x86_64-linux-gnu" > > @array = common global [1000 x i32] zero...
2009 May 30
3
[LLVMdev] Getting started (Windows)
...id not come with any documentation on what they are and how to use them) I used the online code generator (http://llvm.org/demo/index.cgi) to compile hello world: #include <stdio.h> int main() { printf("hello world\n"); return 0; } Copied it's output ; ModuleID = '/tmp/webcompile/_3997_0.bc' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i386-pc-linux-gnu" @.str = internal constant [12 x i8] c"hello world\00" ; <[12 x i8]*>...
2009 Jan 06
2
[LLVMdev] LLVM Optmizer
...x + 1; } else { varx = vary + 1; vary = paraml; } varx = varx + parami + paraml; for( nI = 1 ; nI <= paraml; nI++) { varx = varx + parami + 1 ; vary = varx + nI; } vary = varx + 5; varx = vary + paraml; return varx ; } Generates the IR : ; ModuleID = '/tmp/webcompile/_9908_0.bc' target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" target triple = "i386-pc-linux-gnu" define i32 @TESTE2(i32 %parami, i32 %paraml, double %paramd) nounwind readnone { entr...
2011 Feb 04
3
[LLVMdev] Data layout of structs
...al = i; curr->next = head; head = curr; } curr = head; while(curr) { curr = curr->next; } } ------------ end C example ------------- The output I get from the LLVM web interface is: ------------ start LLVM output ------------- ; ModuleID = '/tmp/webcompile/_27083_0.bc' 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 = "x86_64-linux-gnu" %struct.item = type { i32, %struct.item* } define void @test(...
2012 Feb 25
3
[LLVMdev] Missed optimization on array initialization
...Consider the following, simplified, C snippet: extern void bar(int*); void foo(int a) { int ar[100] = {a}; if (a) return; bar(ar); } Ideally, the array initialization should be sank after the return, but in Clang/LLVM 3.0 this doesn't happen: ; ModuleID = '/tmp/webcompile/_11079_0.bc' 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-S128" target triple = "x86_64-unknown-linux-gnu" define void @_Z3fooi(i32 %a) uwtable { %a...
2009 May 30
0
[LLVMdev] Getting started (Windows)
Hi, > Copied it's output > ; ModuleID = '/tmp/webcompile/_3997_0.bc' > target datalayout = > "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32" > target triple = "i386-pc-linux-gnu" > @.str = internal constant [12 x i8] c"hello world\00" ;...
2007 Apr 04
0
[LLVMdev] For a small help
...oo > output = obj.testObject(input); // I want to create this instruction > > Thanks, > Ferad > You can use the LLVM demo page ( http://llvm.org/demo/index.cgi ) to find out what LLVM code is generated for some C++ code. For example, the above produces: ; ModuleID = '/tmp/webcompile/_6207_0.bc' target datalayout = "e-p:32:32" target endian = little target pointersize = 32 target triple = "i686-pc-linux-gnu" %struct.TestClass = type { ubyte } implementation ; Functions: void %_Z4funcv() { entry: %obj = alloca %struct.TestClass, align 1 ; <%str...
2011 Aug 17
2
[LLVMdev] Non "folding" Stack Allocation
...r*); void function(bool b) { char b1[1 * 1024]; if( b ) { char b2[1 * 1024]; doSomething(b1, b2); } else { char b3[512 * 1024]; doSomething(b1, b3); } } Certainly nothing spectacular. I was however quite surprised by the output: ; ModuleID = '/tmp/webcompile/_28066_0.bc' 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 = "x86_64-unknown-linux-gnu" define void @_Z8functionb(i1 zeroext %b) { entry: %b...
2011 Dec 13
4
[LLVMdev] Failure to optimize ? operator
...= 5*x*x*x+2*x*x+3*x+1; if (x > 0) return 0; else return y; } int f2(int x) { int y = 5*x*x*x+2*x*x+3*x+1; return x > 0 ? 0 : y; } ================================================================ Output from llvm disassembler targeting LLVM assembly ; ModuleID = '/tmp/webcompile/_11262_0.bc' 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 = "x86_64-unknown-linux-gnu" define i32 @f1(i32 %x) nounwind readnone { ; <label...
2011 Mar 22
2
[LLVMdev] -emit-llvm on ubuntu is broken
...ain, .Ltmp0-main .type .L.str, at object .section .rodata.str1.1,"aMS", at progbits,1 .L.str: .asciz "hello world\n" .size .L.str, 13 .section .note.GNU-stack,"", at progbits That's what I am trying to get: ; ModuleID = '/tmp/webcompile/_7829_0.bc' 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 = "x86_64-linux-gnu" @.str = private constant [12 x i8] c"hello world\00",...
2007 Apr 04
4
[LLVMdev] For a small help
Hi, I want to ask for a small help for creating an instruction that calls e member method of an object. I suppose that this is not a headache but I am impatient in learning :) I would be very thankful if you can show me an example snippet code that does this in LLVM. Below is described my case. Let's say I have a class TestClass class TestClass { int testMethod(int a); } and I want to
2009 Jun 13
4
[LLVMdev] ML types in LLVM
Good afternoon! I'm trying to write an LLVM codegen for a Standard ML compiler (MLton). So far things seem to match up quite nicely, but I have hit two sticking points. I'm hoping LLVM experts might know how to handle these two cases better. 1: In ML we have some types that are actually one of several possible types. Expressed in C this might be thought of as a union. The codegen only