Displaying 18 results from an estimated 18 matches for "multmp".
2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...mple that optimizes calls to functions without side effects. Specifically,
ready> extern sin(x);
ready> extern cos(x);
ready> def foo(x) sin(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, inst...
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...ample that optimizes calls to functions without side effects. Specifically,
ready> extern sin(x);
ready> extern cos(x);
ready> def foo(x) sin(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, inst...
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
2010 Nov 15
6
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...s());
// Simplify the control flow graph (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...
2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...ction::Create but I still get the same result (though flagged with "readonly")
declare double @sin(double) readonly
declare double @cos(double) readonly
define double @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
}
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
...e @sin(double 1.000000e+00)",
though, inspite of the same optimizations as in your listing...
- "ready> def foo(x) sin(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
}":
In my case, the CSE does not work, although it does work for the
example...
2008 Mar 31
5
[LLVMdev] Additional Optimization I'm Missing?
...[#uses=1]
%forcond4 = fcmp olt double %time2, %OS_end3 ; <i1> [#uses=1]
br i1 %forcond4, label %forbody, label %forafter
forbody: ; preds = %forcond
%birth_rate5 = load double* %birth_rate ; <double> [#uses=1]
%population6 = load double* %population ; <double> [#uses=1]
%multmp = mul double %birth_rate5, %population6 ; <double> [#uses=1]
store double %multmp, double* %births
%population7 = load double* %population ; <double> [#uses=1]
%multmp8 = mul double 1.000000e-01, %population7 ; <double> [#uses=1]
store double %multmp8, double* %deaths
%bir...
2010 Jun 22
1
[LLVMdev] Using llc to compile a .ll into a .s for ARM
...eone could point in the right direction. What I want to do is with
the kaleidoscope tutorial code, take the IR from a run where I've just done
"
def test(x) 42.0*x;
"
resulting in the file test.ll
"
; ModuleID = 'my cool jit'
define double @test(double %x) {
entry:
%multmp = fmul double %x, 4.200000e+01 ; <double> [#uses=1]
ret double %multmp
}
"
and the use llvm-ar to compile that test.ll to a test.bc and then compile
that to a .S which I can pass to the Android NDK to compile.
I've tried (to cut a long day short!)
Compiling llvm with the...
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.
2019 Jan 24
2
LLVM Kaleidoscope : Compiling to Object Code - Segmentation Fault
...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 llvm-dev
> <llvm-dev at lists.l...
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...s());
// Simplify the control flow graph (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...
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
...leting 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...
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
2007 Nov 05
0
[LLVMdev] 'Implementing a language with LLVM' tutorial
...ml
I was a bit confused at first because the AST node classes are called
ASTs. Instead of saying "ExprAST node" all the time, who not just call
the class ExprNode or ExprAstNode?
http://llvm.org/docs/tutorial/LangImpl3.html
case '<':
L = Builder.CreateFCmpULT(L, R, "multmp");
Should this be something like "cmptmp"?
Also, you mention zero-argument functions, but it doesn't look like
you can parse function calls with zero arguments.
http://llvm.org/docs/tutorial/LangImpl5.html
At this point, you are probably starting to think "on no!
Should b...
2007 Nov 05
5
[LLVMdev] 'Implementing a language with LLVM' tutorial
On Mon, 5 Nov 2007, Aaron Gray wrote:
>> Anyone have thoughts or feedback? :)
>
> Nice job. The only bit that is not immediately clear is the 'Proto'
> variable, but is clear when looking through the code at the end of the page.
Where in the tutorial? What would you suggest that I say?
> Could do with a link to the LLVMBuilder class reference material.
I added a link
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...->Codegen();
Value *R = RHS->Codegen();
if (L == 0 || R == 0) return 0;
switch (Op) {
case '+': return Builder.CreateAdd(L, R, "addtmp");
case '-': return Builder.CreateSub(L, R, "subtmp");
case '*': return Builder.CreateMul(L, R, "multmp");
case '<':
L = Builder.CreateFCmpULT(L, R, "cmptmp");
// Convert bool 0/1 to double 0.0 or 1.0
return Builder.CreateUIToFP(L,
Type::getDoubleTy(getGlobalContext()), "booltmp");
default: return ErrorV("invalid binary operator");
}
}...
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...*R = RHS->Codegen();
> if (L == 0 || R == 0) return 0;
>
> switch (Op) {
> case '+': return Builder.CreateAdd(L, R, "addtmp");
> case '-': return Builder.CreateSub(L, R, "subtmp");
> case '*': return Builder.CreateMul(L, R, "multmp");
> case '<':
> L = Builder.CreateFCmpULT(L, R, "cmptmp");
> // Convert bool 0/1 to double 0.0 or 1.0
> return Builder.CreateUIToFP(L,
> Type::getDoubleTy(getGlobalContext()), "booltmp");
> default: return ErrorV("invalid binary...
2010 Feb 17
1
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
...>> if (L == 0 || R == 0) return 0;
>>
>> switch (Op) {
>> case '+': return Builder.CreateAdd(L, R, "addtmp");
>> case '-': return Builder.CreateSub(L, R, "subtmp");
>> case '*': return Builder.CreateMul(L, R, "multmp");
>> case '<':
>> L = Builder.CreateFCmpULT(L, R, "cmptmp");
>> // Convert bool 0/1 to double 0.0 or 1.0
>> return Builder.CreateUIToFP(L,
>> Type::getDoubleTy(getGlobalContext()), "booltmp");
>> default: return Err...