From 8230c40430a1325b5cc5bc0221931487b4bd573c Mon Sep 17 00:00:00 2001 From: rdivacky Date: Wed, 3 Mar 2010 17:27:15 +0000 Subject: Update LLVM to 97654. --- docs/tutorial/LangImpl3.html | 44 +++++++++++++++++++-------------------- docs/tutorial/LangImpl4.html | 28 ++++++++++++------------- docs/tutorial/LangImpl5.html | 4 ++-- docs/tutorial/LangImpl7.html | 20 +++++++++--------- docs/tutorial/OCamlLangImpl3.html | 34 +++++++++++++++--------------- docs/tutorial/OCamlLangImpl4.html | 28 ++++++++++++------------- docs/tutorial/OCamlLangImpl5.html | 4 ++-- docs/tutorial/OCamlLangImpl7.html | 20 +++++++++--------- 8 files changed, 91 insertions(+), 91 deletions(-) (limited to 'docs/tutorial') diff --git a/docs/tutorial/LangImpl3.html b/docs/tutorial/LangImpl3.html index a628145..80c9fc2 100644 --- a/docs/tutorial/LangImpl3.html +++ b/docs/tutorial/LangImpl3.html @@ -170,7 +170,7 @@ internally (APFloat has the capability of holding floating point constants of Arbitrary Precision). This code basically just creates and returns a ConstantFP. Note that in the LLVM IR that constants are all uniqued together and shared. For this reason, the API -uses "the Context.get..." idiom instead of "new foo(..)" or "foo::Create(..)".

+uses the "foo::get(...)" idiom instead of "new foo(..)" or "foo::Create(..)".

@@ -323,10 +323,10 @@ really talks about the external interface for a function (not the value computed
 by an expression), it makes sense for it to return the LLVM Function it
 corresponds to when codegen'd.

-

The call to Context.get creates +

The call to FunctionType::get creates the FunctionType that should be used for a given Prototype. Since all function arguments in Kaleidoscope are of type double, the first line creates -a vector of "N" LLVM double types. It then uses the Context.get +a vector of "N" LLVM double types. It then uses the Functiontype::get method to create a function type that takes "N" doubles as arguments, returns one double as a result, and that is not vararg (the false parameter indicates this). Note that Types in LLVM are uniqued just like Constants are, so you @@ -535,8 +535,7 @@ ready> 4+5; Read top-level expression: define double @""() { entry: - %addtmp = add double 4.000000e+00, 5.000000e+00 - ret double %addtmp + ret double 9.000000e+00 }

@@ -544,7 +543,8 @@ entry:

Note how the parser turns the top-level expression into anonymous functions for us. This will be handy when we add JIT support in the next chapter. Also note that the code is very literally -transcribed, no optimizations are being performed. We will +transcribed, no optimizations are being performed except simple constant +folding done by IRBuilder. We will add optimizations explicitly in the next chapter.

@@ -554,12 +554,12 @@ ready> def foo(a b) a*a + 2*a*b + b*b; Read function definition: define double @foo(double %a, double %b) { entry: - %multmp = mul double %a, %a - %multmp1 = mul double 2.000000e+00, %a - %multmp2 = mul double %multmp1, %b - %addtmp = add double %multmp, %multmp2 - %multmp3 = mul double %b, %b - %addtmp4 = add double %addtmp, %multmp3 + %multmp = fmul double %a, %a + %multmp1 = fmul double 2.000000e+00, %a + %multmp2 = fmul double %multmp1, %b + %addtmp = fadd double %multmp, %multmp2 + %multmp3 = fmul double %b, %b + %addtmp4 = fadd double %addtmp, %multmp3 ret double %addtmp4 } @@ -576,7 +576,7 @@ define double @bar(double %a) { entry: %calltmp = call double @foo( double %a, double 4.000000e+00 ) %calltmp1 = call double @bar( double 3.133700e+04 ) - %addtmp = add double %calltmp, %calltmp1 + %addtmp = fadd double %calltmp, %calltmp1 ret double %addtmp } @@ -612,18 +612,18 @@ ready> ^D define double @""() { entry: - %addtmp = add double 4.000000e+00, 5.000000e+00 + %addtmp = fadd double 4.000000e+00, 5.000000e+00 ret double %addtmp } define double @foo(double %a, double %b) { entry: - %multmp = mul double %a, %a - %multmp1 = mul double 2.000000e+00, %a - %multmp2 = mul double %multmp1, %b - %addtmp = add double %multmp, %multmp2 - %multmp3 = mul double %b, %b - %addtmp4 = add double %addtmp, %multmp3 + %multmp = fmul double %a, %a + %multmp1 = fmul double 2.000000e+00, %a + %multmp2 = fmul double %multmp1, %b + %addtmp = fadd double %multmp, %multmp2 + %multmp3 = fmul double %b, %b + %addtmp4 = fadd double %addtmp, %multmp3 ret double %addtmp4 } @@ -631,7 +631,7 @@ define double @bar(double %a) { entry: %calltmp = call double @foo( double %a, double 4.000000e+00 ) %calltmp1 = call double @bar( double 3.133700e+04 ) - %addtmp = add double %calltmp, %calltmp1 + %addtmp = fadd double %calltmp, %calltmp1 ret double %addtmp } @@ -1263,7 +1263,7 @@ int main() { Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ + Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $ diff --git a/docs/tutorial/LangImpl4.html b/docs/tutorial/LangImpl4.html index 85e48c5..4520c46 100644 --- a/docs/tutorial/LangImpl4.html +++ b/docs/tutorial/LangImpl4.html @@ -65,7 +65,7 @@ ready> def test(x) 1+2+x; Read function definition: define double @test(double %x) { entry: - %addtmp = add double 3.000000e+00, %x + %addtmp = fadd double 3.000000e+00, %x ret double %addtmp } @@ -80,8 +80,8 @@ ready> def test(x) 1+2+x; Read function definition: define double @test(double %x) { entry: - %addtmp = add double 2.000000e+00, 1.000000e+00 - %addtmp1 = add double %addtmp, %x + %addtmp = fadd double 2.000000e+00, 1.000000e+00 + %addtmp1 = fadd double %addtmp, %x ret double %addtmp1 } @@ -113,9 +113,9 @@ ready> def test(x) (1+2+x)*(x+(1+2)); ready> Read function definition: define double @test(double %x) { entry: - %addtmp = add double 3.000000e+00, %x - %addtmp1 = add double %x, 3.000000e+00 - %multmp = mul double %addtmp, %addtmp1 + %addtmp = fadd double 3.000000e+00, %x + %addtmp1 = fadd double %x, 3.000000e+00 + %multmp = fmul double %addtmp, %addtmp1 ret double %multmp } @@ -240,8 +240,8 @@ ready> def test(x) (1+2+x)*(x+(1+2)); ready> Read function definition: define double @test(double %x) { entry: - %addtmp = add double %x, 3.000000e+00 - %multmp = mul double %addtmp, %addtmp + %addtmp = fadd double %x, 3.000000e+00 + %multmp = fmul double %addtmp, %addtmp ret double %multmp } @@ -363,8 +363,8 @@ ready> def testfunc(x y) x + y*2; Read function definition: define double @testfunc(double %x, double %y) { entry: - %multmp = mul double %y, 2.000000e+00 - %addtmp = add double %multmp, %x + %multmp = fmul double %y, 2.000000e+00 + %addtmp = fadd double %multmp, %x ret double %addtmp } @@ -411,10 +411,10 @@ Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin( double %x ) - %multmp = mul double %calltmp, %calltmp + %multmp = fmul double %calltmp, %calltmp %calltmp2 = call double @cos( double %x ) - %multmp4 = mul double %calltmp2, %calltmp2 - %addtmp = add double %multmp, %multmp4 + %multmp4 = fmul double %calltmp2, %calltmp2 + %addtmp = fadd double %multmp, %multmp4 ret double %addtmp } @@ -1126,7 +1126,7 @@ int main() { Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-02-11 20:15:20 +0100 (Thu, 11 Feb 2010) $ + Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $ diff --git a/docs/tutorial/LangImpl5.html b/docs/tutorial/LangImpl5.html index f80f3f3..3256c40 100644 --- a/docs/tutorial/LangImpl5.html +++ b/docs/tutorial/LangImpl5.html @@ -678,7 +678,7 @@ loop: ; preds = %loop, %entry ; body %calltmp = call double @putchard( double 4.200000e+01 ) ; increment - %nextvar = add double %i, 1.000000e+00 + %nextvar = fadd double %i, 1.000000e+00 ; termination test %cmptmp = fcmp ult double %i, %n @@ -1771,7 +1771,7 @@ int main() { Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-02-11 20:15:20 +0100 (Thu, 11 Feb 2010) $ + Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $ diff --git a/docs/tutorial/LangImpl7.html b/docs/tutorial/LangImpl7.html index 1a779ba..3d24739 100644 --- a/docs/tutorial/LangImpl7.html +++ b/docs/tutorial/LangImpl7.html @@ -557,12 +557,12 @@ then: ; preds = %entry else: ; preds = %entry %x3 = load double* %x1 - %subtmp = sub double %x3, 1.000000e+00 + %subtmp = fsub double %x3, 1.000000e+00 %calltmp = call double @fib( double %subtmp ) %x4 = load double* %x1 - %subtmp5 = sub double %x4, 2.000000e+00 + %subtmp5 = fsub double %x4, 2.000000e+00 %calltmp6 = call double @fib( double %subtmp5 ) - %addtmp = add double %calltmp, %calltmp6 + %addtmp = fadd double %calltmp, %calltmp6 br label %ifcont ifcont: ; preds = %else, %then @@ -595,11 +595,11 @@ then: br label %ifcont else: - %subtmp = sub double %x, 1.000000e+00 + %subtmp = fsub double %x, 1.000000e+00 %calltmp = call double @fib( double %subtmp ) - %subtmp5 = sub double %x, 2.000000e+00 + %subtmp5 = fsub double %x, 2.000000e+00 %calltmp6 = call double @fib( double %subtmp5 ) - %addtmp = add double %calltmp, %calltmp6 + %addtmp = fadd double %calltmp, %calltmp6 br label %ifcont ifcont: ; preds = %else, %then @@ -625,11 +625,11 @@ entry: br i1 %ifcond, label %else, label %ifcont else: - %subtmp = sub double %x, 1.000000e+00 + %subtmp = fsub double %x, 1.000000e+00 %calltmp = call double @fib( double %subtmp ) - %subtmp5 = sub double %x, 2.000000e+00 + %subtmp5 = fsub double %x, 2.000000e+00 %calltmp6 = call double @fib( double %subtmp5 ) - %addtmp = add double %calltmp, %calltmp6 + %addtmp = fadd double %calltmp, %calltmp6 ret double %addtmp ifcont: @@ -2158,7 +2158,7 @@ int main() { Chris Lattner
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-02-11 20:15:20 +0100 (Thu, 11 Feb 2010) $ + Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $ diff --git a/docs/tutorial/OCamlLangImpl3.html b/docs/tutorial/OCamlLangImpl3.html index b335147..c69f644 100644 --- a/docs/tutorial/OCamlLangImpl3.html +++ b/docs/tutorial/OCamlLangImpl3.html @@ -484,7 +484,7 @@ ready> 4+5; Read top-level expression: define double @""() { entry: - %addtmp = add double 4.000000e+00, 5.000000e+00 + %addtmp = fadd double 4.000000e+00, 5.000000e+00 ret double %addtmp } @@ -503,12 +503,12 @@ ready> def foo(a b) a*a + 2*a*b + b*b; Read function definition: define double @foo(double %a, double %b) { entry: - %multmp = mul double %a, %a - %multmp1 = mul double 2.000000e+00, %a - %multmp2 = mul double %multmp1, %b - %addtmp = add double %multmp, %multmp2 - %multmp3 = mul double %b, %b - %addtmp4 = add double %addtmp, %multmp3 + %multmp = fmul double %a, %a + %multmp1 = fmul double 2.000000e+00, %a + %multmp2 = fmul double %multmp1, %b + %addtmp = fadd double %multmp, %multmp2 + %multmp3 = fmul double %b, %b + %addtmp4 = fadd double %addtmp, %multmp3 ret double %addtmp4 } @@ -525,7 +525,7 @@ define double @bar(double %a) { entry: %calltmp = call double @foo( double %a, double 4.000000e+00 ) %calltmp1 = call double @bar( double 3.133700e+04 ) - %addtmp = add double %calltmp, %calltmp1 + %addtmp = fadd double %calltmp, %calltmp1 ret double %addtmp } @@ -561,18 +561,18 @@ ready> ^D define double @""() { entry: - %addtmp = add double 4.000000e+00, 5.000000e+00 + %addtmp = fadd double 4.000000e+00, 5.000000e+00 ret double %addtmp } define double @foo(double %a, double %b) { entry: - %multmp = mul double %a, %a - %multmp1 = mul double 2.000000e+00, %a - %multmp2 = mul double %multmp1, %b - %addtmp = add double %multmp, %multmp2 - %multmp3 = mul double %b, %b - %addtmp4 = add double %addtmp, %multmp3 + %multmp = fmul double %a, %a + %multmp1 = fmul double 2.000000e+00, %a + %multmp2 = fmul double %multmp1, %b + %addtmp = fadd double %multmp, %multmp2 + %multmp3 = fmul double %b, %b + %addtmp4 = fadd double %addtmp, %multmp3 ret double %addtmp4 } @@ -580,7 +580,7 @@ define double @bar(double %a) { entry: %calltmp = call double @foo( double %a, double 4.000000e+00 ) %calltmp1 = call double @bar( double 3.133700e+04 ) - %addtmp = add double %calltmp, %calltmp1 + %addtmp = fadd double %calltmp, %calltmp1 ret double %addtmp } @@ -1085,7 +1085,7 @@ main () Chris Lattner
Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ + Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $ diff --git a/docs/tutorial/OCamlLangImpl4.html b/docs/tutorial/OCamlLangImpl4.html index 451ab11..4a72f65 100644 --- a/docs/tutorial/OCamlLangImpl4.html +++ b/docs/tutorial/OCamlLangImpl4.html @@ -72,8 +72,8 @@ ready> def test(x) 1+2+x; Read function definition: define double @test(double %x) { entry: - %addtmp = add double 1.000000e+00, 2.000000e+00 - %addtmp1 = add double %addtmp, %x + %addtmp = fadd double 1.000000e+00, 2.000000e+00 + %addtmp1 = fadd double %addtmp, %x ret double %addtmp1 } @@ -104,7 +104,7 @@ ready> def test(x) 1+2+x; Read function definition: define double @test(double %x) { entry: - %addtmp = add double 3.000000e+00, %x + %addtmp = fadd double 3.000000e+00, %x ret double %addtmp } @@ -127,9 +127,9 @@ ready> def test(x) (1+2+x)*(x+(1+2)); ready> Read function definition: define double @test(double %x) { entry: - %addtmp = add double 3.000000e+00, %x - %addtmp1 = add double %x, 3.000000e+00 - %multmp = mul double %addtmp, %addtmp1 + %addtmp = fadd double 3.000000e+00, %x + %addtmp1 = fadd double %x, 3.000000e+00 + %multmp = fmul double %addtmp, %addtmp1 ret double %multmp } @@ -267,8 +267,8 @@ ready> def test(x) (1+2+x)*(x+(1+2)); ready> Read function definition: define double @test(double %x) { entry: - %addtmp = add double %x, 3.000000e+00 - %multmp = mul double %addtmp, %addtmp + %addtmp = fadd double %x, 3.000000e+00 + %multmp = fmul double %addtmp, %addtmp ret double %multmp } @@ -388,8 +388,8 @@ ready> def testfunc(x y) x + y*2; Read function definition: define double @testfunc(double %x, double %y) { entry: - %multmp = mul double %y, 2.000000e+00 - %addtmp = add double %multmp, %x + %multmp = fmul double %y, 2.000000e+00 + %addtmp = fadd double %multmp, %x ret double %addtmp } @@ -436,10 +436,10 @@ Read function definition: define double @foo(double %x) { entry: %calltmp = call double @sin( double %x ) - %multmp = mul double %calltmp, %calltmp + %multmp = fmul double %calltmp, %calltmp %calltmp2 = call double @cos( double %x ) - %multmp4 = mul double %calltmp2, %calltmp2 - %addtmp = add double %multmp, %multmp4 + %multmp4 = fmul double %calltmp2, %calltmp2 + %addtmp = fadd double %multmp, %multmp4 ret double %addtmp } @@ -1032,7 +1032,7 @@ extern double putchard(double X) { Chris Lattner
Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ + Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $ diff --git a/docs/tutorial/OCamlLangImpl5.html b/docs/tutorial/OCamlLangImpl5.html index ae075ec..14f0efd 100644 --- a/docs/tutorial/OCamlLangImpl5.html +++ b/docs/tutorial/OCamlLangImpl5.html @@ -653,7 +653,7 @@ loop: ; preds = %loop, %entry ; body %calltmp = call double @putchard( double 4.200000e+01 ) ; increment - %nextvar = add double %i, 1.000000e+00 + %nextvar = fadd double %i, 1.000000e+00 ; termination test %cmptmp = fcmp ult double %i, %n @@ -1563,7 +1563,7 @@ operators Chris Lattner
Erick Tryzelaar
The LLVM Compiler Infrastructure
- Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ + Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $ diff --git a/docs/tutorial/OCamlLangImpl7.html b/docs/tutorial/OCamlLangImpl7.html index ed1a558..823b4c0 100644 --- a/docs/tutorial/OCamlLangImpl7.html +++ b/docs/tutorial/OCamlLangImpl7.html @@ -581,12 +581,12 @@ then: ; preds = %entry else: ; preds = %entry %x3 = load double* %x1 - %subtmp = sub double %x3, 1.000000e+00 + %subtmp = fsub double %x3, 1.000000e+00 %calltmp = call double @fib( double %subtmp ) %x4 = load double* %x1 - %subtmp5 = sub double %x4, 2.000000e+00 + %subtmp5 = fsub double %x4, 2.000000e+00 %calltmp6 = call double @fib( double %subtmp5 ) - %addtmp = add double %calltmp, %calltmp6 + %addtmp = fadd double %calltmp, %calltmp6 br label %ifcont ifcont: ; preds = %else, %then @@ -619,11 +619,11 @@ then: br label %ifcont else: - %subtmp = sub double %x, 1.000000e+00 + %subtmp = fsub double %x, 1.000000e+00 %calltmp = call double @fib( double %subtmp ) - %subtmp5 = sub double %x, 2.000000e+00 + %subtmp5 = fsub double %x, 2.000000e+00 %calltmp6 = call double @fib( double %subtmp5 ) - %addtmp = add double %calltmp, %calltmp6 + %addtmp = fadd double %calltmp, %calltmp6 br label %ifcont ifcont: ; preds = %else, %then @@ -649,11 +649,11 @@ entry: br i1 %ifcond, label %else, label %ifcont else: - %subtmp = sub double %x, 1.000000e+00 + %subtmp = fsub double %x, 1.000000e+00 %calltmp = call double @fib( double %subtmp ) - %subtmp5 = sub double %x, 2.000000e+00 + %subtmp5 = fsub double %x, 2.000000e+00 %calltmp6 = call double @fib( double %subtmp5 ) - %addtmp = add double %calltmp, %calltmp6 + %addtmp = fadd double %calltmp, %calltmp6 ret double %addtmp ifcont: @@ -1901,7 +1901,7 @@ extern double printd(double X) { Chris Lattner
The LLVM Compiler Infrastructure
Erick Tryzelaar
- Last modified: $Date: 2010-02-03 18:27:31 +0100 (Wed, 03 Feb 2010) $ + Last modified: $Date: 2010-03-02 02:11:08 +0100 (Tue, 02 Mar 2010) $ -- cgit v1.1