search for: addtmp

Displaying 20 results from an estimated 26 matches for "addtmp".

2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...in(x)*sin(x) + cos(x)*cos(x); Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp %calltmp2 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp2 %addtmp = fadd double %multmp, %multmp4 ret double %addtmp } I find that when I run the code, the calls to sin and cos aren't optimized and, instead, I end up with: define double @foo(double %x) { entry: %calltmp = call double @sin(double %x) %calltmp1 = call double @sin(double %x) %mul...
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...in(x)*sin(x) + cos(x)*cos(x); Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp %calltmp2 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp2 %addtmp = fadd double %multmp, %multmp4 ret double %addtmp } I find that when I run the code, the calls to sin and cos aren't optimized and, instead, I end up with: define double @foo(double %x) { entry: %calltmp = call double @sin(double %x) %calltmp1 = call double @sin(double %x) %mul...
2010 Nov 12
4
[LLVMdev] C Backend's future
Chris Lattner <clattner at apple.com> writes: > On Nov 5, 2010, at 7:11 AM, Kirk Kelsey wrote: > >> I'm wondering what the longer term plans are for the C Backend. I >> understand it's not actively developed, even deprecated. What I'm not >> clear about is whether it's something that is viewed as non-vital and >> should just as well go away, or
2015 Jan 16
2
[LLVMdev] Function calls only being JIT'd once by Kaleidoscope with MCJIT?
...or working on this. Sorry it took me so long to get around to > looking at it. > > I've just tested the patch out on Top-of-tree and I see: > > ready> def foo(x y) x+y; > ready> Read function definition: > define double @foo(double %x, double %y) { > entry: > %addtmp = fadd double %x, %y > ret double %addtmp > } > > ready> foo(1,2); > ready> Evaluated to 3.000000 > ready> foo(3,4); > ready> LLVM ERROR: Program used extern function '_foo' which could not be > resolved! > > Have you seen the same thing? If not,...
2014 Dec 26
2
[LLVMdev] Function calls only being JIT'd once by Kaleidoscope with MCJIT?
Hi all, Starting from Chapter 4 of the Kaleidoscope tutorial (where the JIT support is added), there's some strange behaviour, ready> def foo(x y) x+y; ready> Read function definition: define double @foo(double %x, double %y) { entry: %addtmp = fadd double %x, %y ret double %addtmp } ready> foo(1, 2); ready> Evaluated to 3.000000 ready> foo(3, 4); ready> Evaluated to 3.000000 You can see that foo(3, 4) is not being computed correctly. Well actually, it appears to not be getting compiled. It seems like the Kaleidoscope tu...
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
...x) + cos(x)*cos(x); Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp %calltmp2 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp2 %addtmp = fadd double %multmp, %multmp4 ret double %addtmp }": In my case, the CSE does not work, although it does work for the example in 4.3: "ready> def foo(x) sin(x)*sin(x) + cos(x)*cos(x); ready> Read function definition: define double @foo(double %x)...
2018 Jul 20
2
LLVM FunctionType cannot be returned as VectorType?
...//////////////////////////////////////////////////////// define <4 x i64> @tpchq6(<4 x i64> %leaf7, <4 x i64> %leaf8, <4 x i64> %leaf9, <4 x i64> %leaf10, <4 x i64> %leaf11, <4 x i64> %leaf12, <4 x i64> %leaf13, <4 x i64> %leaf14) { entry: %addtmp = add <4 x i64> %leaf14, %leaf13 %leaf8.neg = sub <4 x i64> zeroinitializer, %leaf8 %xortmp = xor <4 x i64> %addtmp, %leaf11 %addtmp1 = add <4 x i64> %leaf8.neg, %leaf7 %subtmp = add <4 x i64> %addtmp1, %leaf9 %addtmp2 = add <4 x i64> %subtmp, %lea...
2013 Mar 17
0
[LLVMdev] LLVM ERROR: Program used external function 'X.foo' which could not be resolved!
...t; = mul i32 %"argument read", 5 store i32 %"Code::Op::Mul", i32* %g %read = load i32* %g %"calling function" = call i32 @X.foo(i32 %read) store i32 %"calling function", i32* %h %"argument read1" = load i32* %bar %read2 = load i32* %h %addtmp = add i32 %"argument read1", %read2 ret i32 %addtmp } define i32 @X.foo(i32) { %g = alloca i32 %bar = alloca i32 store i32 %0, i32* %bar %"argument read" = load i32* %bar %addtmp = add i32 %"argument read", 2 store i32 %addtmp, i32* %g %"argument...
2015 Mar 10
4
[LLVMdev] noob IR builder question
...ng to now bring in some concepts from the Kaleidoscope tutorial, namely adding expressions the the IR that is dumped out. I’ve added the following snippets: Value *c1 = ConstantFP::get(context, APFloat(1.0)); Value *c2 = ConstantFP::get(context, APFloat(3.0)); builder.CreateFAdd(c1, c2, "addtmp”); expecting to see an add instruction in the dump, but nothing is added. This seems to be pretty strait from the kaleidoscope examples but I am missing something here I am sure. Here is the full program: 1 using namespace llvm; 2 3 llvm::Module *module; 4 llvm::IRBuilder<> builde...
2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...ouble @foo(double %x) readonly { entry: %calltmp = call double @sin(double %x) %calltmp1 = call double @sin(double %x) %multmp = fmul double %calltmp, %calltmp1 %calltmp2 = call double @cos(double %x) %calltmp3 = call double @cos(double %x) %multmp4 = fmul double %calltmp2, %calltmp3 %addtmp = fadd double %multmp, %multmp4 ret double %addtmp }
2018 Jul 23
2
LLVM FunctionType cannot be returned as VectorType?
...//// /////////////////////////////// The generated IR: define <4 x i64> @tpchq6(<4 x i64> %leaf7, <4 x i64> %leaf8, <4 x i64> %leaf9, <4 x i64> %leaf10, <4 x i64> %leaf11, <4 x i64> %leaf12, <4 x i64> %leaf13, <4 x i64> %leaf14) #0 { entry: %addtmp = add <4 x i64> %leaf8, %leaf7 %addtmp1 = add <4 x i64> %addtmp, %leaf9 %addtmp4 = add <4 x i64> %addtmp1, %leaf10 %addtmp2 = add <4 x i64> %addtmp4, %leaf11 %addtmp3 = add <4 x i64> %addtmp2, %leaf12 %addtmp5 = add <4 x i64> %addtmp3, %leaf13 %addtmp...
2008 Mar 31
5
[LLVMdev] Additional Optimization I'm Missing?
...double* %deaths ; <double> [#uses=1] %subtmp = sub double %births9, %deaths10 ; <double> [#uses=1] store double %subtmp, double* %net_change %population11 = load double* %population ; <double> [#uses=1] %net_change12 = load double* %net_change ; <double> [#uses=1] %addtmp = add double %population11, %net_change12 ; <double> [#uses=1] store double %addtmp, double* %population_next br label %updatestocks updatestocks: ; preds = %forbody %population_next13 = load double* %population_next ; <double> [#uses=1] store double %population_next13, double*...
2010 Nov 15
6
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...h (deleting unreachable blocks, etc). OurFPM.add(createCFGSimplificationPass()); It does simplify _some_ things. For example: ready> def simplifyThis(x) (x*2)+(2*x); Read function definition: define double @simplifyThis(double %x) readonly { entry: %multmp = fmul double %x, 2.000000e+00 %addtmp = fadd double %multmp, %multmp ret double %addtmp } > -----Original Message----- > From: Duncan Sands [mailto:baldrick at free.fr] > Sent: Monday, November 15, 2010 2:57 PM > To: llvmdev at cs.uiuc.edu > Subject: Re: [LLVMdev] Optimization of calls to functions without side >...
2018 Jul 23
2
LLVM FunctionType cannot be returned as VectorType?
...ed IR: > > > > define <4 x i64> @tpchq6(<4 x i64> %leaf7, <4 x i64> %leaf8, <4 x i64> > %leaf9, <4 x i64> %leaf10, <4 x i64> %leaf11, <4 x i64> %leaf12, <4 x i64> > %leaf13, <4 x i64> %leaf14) #0 { > > entry: > > %addtmp = add <4 x i64> %leaf8, %leaf7 > > %addtmp1 = add <4 x i64> %addtmp, %leaf9 > > %addtmp4 = add <4 x i64> %addtmp1, %leaf10 > > %addtmp2 = add <4 x i64> %addtmp4, %leaf11 > > %addtmp3 = add <4 x i64> %addtmp2, %leaf12 > > %addtmp5...
2012 Dec 13
2
[LLVMdev] Fwd: error while linking modules with exception handling demo code
...noreturn declare i32 @_Unwind_Resume(i8*) noreturn declare i32 @ourPersonality(i32, i32, i64, i8*, i8*) declare i32 @llvm.eh.typeid.for(i8*) nounwind readnone define i32 @foo(i32) { %g = alloca i32 %bar = alloca i32 store i32 %0, i32* %bar %"argument read" = load i32* %bar %addtmp = add i32 %"argument read", 2 store i32 %addtmp, i32* %g %"argument read1" = load i32* %bar %read = load i32* %g %"Code::Op::Mul" = mul i32 %"argument read1", %read ret i32 %"Code::Op::Mul" } this is module Y, which is where foo2 is gener...
2019 Jan 24
2
LLVM Kaleidoscope : Compiling to Object Code - Segmentation Fault
...Read function definition: > define double @average(double %x, double %y) { > entry: >   %y2 = alloca double >   %x1 = alloca double >   store double %x, double* %x1 >   store double %y, double* %y2 >   %x3 = load double, double* %x1 >   %y4 = load double, double* %y2 >   %addtmp = fadd double %x3, %y4 >   %multmp = fmul double %addtmp, 5.000000e-01 >   ret double %multmp > } > > > Any  ideas what you might be doing differently that I could do to try > to reproduce the failure you're seeing? > > On Thu, Jan 24, 2019 at 9:36 AM preejackie via...
2019 Jan 24
2
LLVM Kaleidoscope : Compiling to Object Code - Segmentation Fault
Hi all :) I'm new to llvm! I'm going through the kaleidoscope : compiling llvm IR to object code tutorial, code in the listings breaks and causes a segmentation fault. After some investigation through gdb, probably this constructor call, causing the segfault. |Program received signal SIGSEGV, Segmentation fault.|| ||0x00000000004afee0 in
2019 Apr 01
2
Instruction Execution With Hard Limitation at Runtime
I am trying to give a quota of how many instructions can be run to a program. So create a simple function as below: define void @add_gas(i64 %gasCost) { __virtual_entry: %0 = load i64, i64* @__WAVM__XX__gGasUsed ### I am sure it exists, same as the __WAVM__XX__gGasLimit %addtmp = add i64 %0, %gasCost %1 = load i64, i64* @__WAVM__XX__gGasLimit %cmptmp = icmp sgt i64 %addtmp, %1 br i1 %cmptmp, label %then, label %ifcont then: ; preds = %__virtual_entry call void @exit(i32 1024) ret void ifcont:...
2015 Jan 16
3
[LLVMdev] Function calls only being JIT'd once by Kaleidoscope with MCJIT?
...t; looking at it. >>> >>> I've just tested the patch out on Top-of-tree and I see: >>> >>> ready> def foo(x y) x+y; >>> ready> Read function definition: >>> define double @foo(double %x, double %y) { >>> entry: >>> %addtmp = fadd double %x, %y >>> ret double %addtmp >>> } >>> >>> ready> foo(1,2); >>> ready> Evaluated to 3.000000 >>> ready> foo(3,4); >>> ready> LLVM ERROR: Program used extern function '_foo' which could not be >&gt...
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Hi Rob, > Hmm ... I tried setting that right after Function::Create but I still get the same result (though flagged with "readonly") did you run the gvn pass (preceded by basic-aa)? Ciao, Duncan.