Displaying 20 results from an estimated 70000 matches similar to: "[LLVMdev] Kaleidoscope example control flow to c like control flow?"
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Rob,
I can reproduce the behaviour you observe using llvm top-of-tree.
I will try to look into it.
Best regards,
--
Arnaud de Grandmaison
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Rob Pieke
Sent: Monday, November 15, 2010 4:27 PM
To: Duncan Sands; llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Optimization of calls to
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Hi Rob,
> I'm using the gvn pass, not sure about basic-aa.
if you are using LLVM from svn then you need to specify the basic-aa analysis,
otherwise gvn won't unify calls to readonly/readnone functions. This is new
behaviour introduced by Dan; probably the tutorial should be updated.
Ciao,
Duncan.
>
> I've copied the code as-is from
2010 Nov 15
6
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
I'm using the gvn pass, not sure about basic-aa.
I've copied the code as-is from http://llvm.org/docs/tutorial/LangImpl4.html#code and added "F->addFnAttr( Attribute::ReadOnly )" after "Function *F = Function::Create(FT, Function::ExternalLinkage, Name, TheModule)".
The passes it sets up are:
// Set up the optimizer pipeline. Start with registering info about
2010 Nov 22
0
[LLVMdev] Emitting LLVM IR for control flow
Hi
I'm following the excellent Kaleidoscope tutorial to learn how to build an
interpreter using LLVM. Apologize if this list is not the best place to post
beginner's questions. In Kaleidoscope 2.7 when I run
def binary : 1 (x y) y;
def testfor (x)
(for c = 1, c<2 in
x = x +1 ) :
x;
testfor(1)
unexpectadly get 3.000000 instead of 2.000000. This happens, I believe,
because the
2010 Nov 16
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Hi Dan,
The tutorial in r119335 does not build : the basicAA pass creation needs to be declared. This is addressed with the 'missing-include' patch, which updates both source code & documentation.
The second point is that beside basicAA, to get the optimizations as shown in the tutorial, (sin(x)*sin(x) -> sin(x)^2), some attributes need to be set on 'sin'. Patch
2010 Nov 15
1
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
SUCCESS!
Sorry, I had removed the addFnAttr() call by accident. Using the basicAA pass and ReadOnly, as you suggested, works like a charm!
:)
> -----Original Message-----
> From: Rob Pieke
> Sent: Monday, November 15, 2010 4:40 PM
> To: 'Duncan Sands'
> Cc: 'llvmdev at cs.uiuc.edu'; 'Dan Gohman'
> Subject: RE: [LLVMdev] Optimization of calls to
2010 Nov 17
1
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Hi Dan,
>Did the code in the tutorial work at some point? Offhand, I wouldn't expect
>any of my recent changes to have affected this. I'm reluctant to fix this
>without understanding how the original code was intended to work.
The code works, but not as shown in the tutorial. In the tutorial, it shows that multiple calls to pure functions (sin, cos) can be optimized. Without the
2010 Nov 15
1
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Still no luck after switching to:
theFPM->add( new llvm::TargetData( *theExecutionEngine->getTargetData() ) );
theFPM->add( llvm::createBasicAliasAnalysisPass() );
theFPM->add( llvm::createInstructionCombiningPass() );
theFPM->add( llvm::createReassociatePass() );
theFPM->add( llvm::createGVNPass() );
theFPM->add( llvm::createCFGSimplificationPass() );
Based on output
2010 Nov 15
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
Hi Rob,
You need to set attribute ReadOnly on the sin / cos functions, using Function::addFnAttr(Attribute) for example.
Best regards,
--
Arnaud de Grandmaison
-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Rob Pieke
Sent: Monday, November 15, 2010 11:41 AM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] Optimization of calls
2018 Dec 30
2
kaleidoscope ch4 jit example regression?
https://llvm.org/docs/tutorial/LangImpl04.html has an example where
the function `foo` gets redefined, and the JIT returns evaluation of
the latest definition. I thought my code was wrong, but it seems that
the binary produced by `ninja Kaleidoscope-Ch4` has the same bug.
Granted, my LLVM checkout is from Nov 3 2018 (r346062). Is this a known issue?
~Nick Desaulniers
2010 Nov 14
0
[LLVMdev] Problem building Ocaml Kaleidoscope example
Hi,
The Ocaml Kaleidoscope tutorial code stops compiling at chapter 3. I get
$ ocamlbuild toy.byte
Finished, 1 target (0 cached) in 00:00:00.
+ /usr/bin/ocamlc -c -o codegen.cmo codegen.ml
File "codegen.ml", line 5, characters 0-9:
Error: Unbound module Llvm
This is with Llvm 2.7 on ubuntu 10.10. I have the package
libllvm-ocaml-2.7-dev installed.
The offending line is simply
open
2016 Aug 29
2
cmake configuration changes to build Kaleidoscope outside of llvm examples src tree
I try to understand cmake build configuration. As an example, I copied
Kaleidoscope from llvm examples to some other directory (e.g.,
/tmp/Kaleidoscope). What change(s) that I need to make to "CMakkeLists.txt"
in order to build Kaleidoscope from /tmp/Kaleidoscope?
Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2010 Nov 16
0
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
On Nov 16, 2010, at 1:19 AM, Arnaud Allard de Grandmaison wrote:
> Hi Dan,
>
> The tutorial in r119335 does not build : the basicAA pass creation needs to be declared. This is addressed with the 'missing-include' patch, which updates both source code & documentation.
Applied, thanks.
> The second point is that beside basicAA, to get the optimizations as shown in the
2009 Aug 09
0
alternate compression
I'm doing testing on this at the moment.
But to start with:
>>Because music represents an analog signal,
As I wrote, it would only apply to specific genres, not analog recordings.
Electronic music quite often doesn't leave a computer these days. And it
mainly consists of drums, synths & vocals/effects. Drums are often samples
sequenced at sample (not sub-sample) accuracy,
2019 Jan 22
2
kaleidoscope ch4 jit example regression?
Hi Nick,
I was not aware of it, but it makes sense given the recent switch to ORC2, which has different symbol resolution rules.
I am out on vacation this week, but will take a look when I get back and see if I can restore the old behavior.
Cheers,
Lang.
Sent from my iPhone
> On Jan 20, 2019, at 2:14 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> +Lang who does JIT
2010 Aug 17
0
[LLVMdev] clang: call extern function using JIT
On Aug 17, 2010, at 1:56 PM, gafferuk wrote:
>
> hi, im creating a music application(image below).
>
> At the moment im using tcc compiler but im moving across to clang because of
> the improved compiler warnings.
> Can anyone please explain and show code so I can use clang's JIT to call
> functions in my application?
You'll probably want to take a look at the
2016 Mar 31
1
Kaleidoscope examples on Windows
Are the Kaleidoscope examples supposed to work on Windows? e.g.
C:\llvm\examples\Kaleidoscope\Orc\initial\toy.cpp
when I try to compile this with clang it gives compile time error
messages, and when I try with Microsoft C++ it generates an executable that
runs but crashes when I type in an expression; I get similar results with
a few of the other versions. I can give more detailed feedback if
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.
2010 Nov 15
2
[LLVMdev] Optimization of calls to functions without side effects (from Kaleidoscope example)
> You need to set attribute ReadOnly on the sin / cos functions, using
> Function::addFnAttr(Attribute) for example.
Hmm ... I tried setting that right after Function::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
2019 Feb 20
2
kaleidoscope ch4 jit example regression?
Not yet unfortunately. I've had my head down working on a jut-linker
replacement.
Let me take a look right now...
On Mon, Feb 18, 2019 at 10:40 AM David Blaikie <dblaikie at gmail.com> wrote:
> Ping - did this end up getting addressed?
>
> On Mon, Jan 21, 2019, 6:15 PM Lang Hames <lhames at gmail.com wrote:
>
>> Hi Nick,
>>
>> I was not aware of it,