similar to: [LLVMdev] Phi nodes

Displaying 20 results from an estimated 10000 matches similar to: "[LLVMdev] Phi nodes"

2006 Apr 15
1
[LLVMdev] how to code a loop in llvm assembly
Hi Simon, > I've read over the "LLVM Language Reference Manual" a few times, and > writing some ll code, but i'm stuck at a very basic point. How to > decrement a counter variable ? As Oscar pointed out, you need a phi-node. I read some of the published papers on LLVM before the Language Reference Manual and found them to be of use. You may also find Wikipedia's
2004 Nov 23
2
[LLVMdev] Restoring SSA form
Hello, for some my use case, I'd like to temporary break SSA property and then ask LLVM to restore it. Here's more details: if (i < 0) { i = -i; } This is a C code example. I'm trying to create a value range analysis, which will determine, that after this code, 'i' is non-negative. In SSA form, this will become i = 0; if (i < 0) { i.2 = -i; }
2010 Sep 10
3
[LLVMdev] where are my phi-nodes?
Hi, I am interested in SSA and read llvm uses SSA in its ir. I decided to write a simple program and compile it with llvm to the human readable assembly language representation of the ir. I expected phi nodes all over the place. However, I could not find a single one! Could you tell my why that is so? I compiled with "llvm-gcc -emit-llvm test.c -S -o test.ll". Attached to this message
2007 Mar 28
0
[LLVMdev] Phi nodes
Hello. > Thanks for your answers so far. I am currently stumbling into new questions. > Naive as i am, i thought that the llvm-bytecode is allways in SSA form. But > this doesn't seem to be the case. At least there are no phi instructions > embedded if the bytecode drops out of llvm-gcc? Yes. llvm-gcc generates just memory references. PHI nodes are constructed later via mem2reg
2011 May 17
1
[LLVMdev] eliminate phi nodes, reduce unnecessary loads / stores , reg2mem, mem2reg
Hi, I work on a pass that requires as input LLVM code without any phi nodes. For this, I use the reg2mem pass which produces suitable code, the pass runs correctly, but I obtain a significant performance decrease. I expect that this is because there are more reads / writes to memory after running the reg2mem pass. How can I optimize the code, without inserting any phi nodes? Or is there a
2011 Jan 23
2
[LLVMdev] Undoing SSA and Phi instructions
Hi, I am emitting llvm bit code using llvm-gcc -c -emit-llvm -O0 -o test.bc test.c and then optimizing it with opt -O3 -print-module test.bc in order to obtain a dump of generated IR. The resulting code has Phi nodes and is perhaps in SSA form. I want to undo the SSA form while retaining all the other optimizations. Is mem2reg the right optimization to be added after -O3, i.e., opt -O3
2004 Nov 23
0
[LLVMdev] Restoring SSA form
> > Here's 'foo' is always called with positive value. However, the value > range > assigned to 'i' variable can be only [-inf, +inf], because uses of 'i' > outside of condition can get any value. So, I'd like to convert the > above to: > > i = 0; > if (i > 0) { > i = change_value_range(i); > foo(i); > } I
2006 Apr 15
6
[LLVMdev] how to code a loop in llvm assembly
Hi, I've read over the "LLVM Language Reference Manual" a few times, and writing some ll code, but i'm stuck at a very basic point. How to decrement a counter variable ? int %count(int %n) { EntryBlock: %cond = seteq int %n, 0 br bool %cond, label %Exit, label %Next Next: ; how to decrement n ? %new_n = sub int %n, 1 br label %EntryBlock Exit: ret int 0 } I guess I
2011 Jan 23
0
[LLVMdev] Undoing SSA and Phi instructions
On 01/22/2011 10:30 PM, Surinder wrote: > Hi, > > I am emitting llvm bit code using > > llvm-gcc -c -emit-llvm -O0 -o test.bc test.c > > and then optimizing it with > > opt -O3 -print-module test.bc > > in order to obtain a dump of generated IR. > > > The resulting code has Phi nodes and is perhaps in SSA form. I want > to undo the SSA form while
2006 Apr 15
0
[LLVMdev] how to code a loop in llvm assembly
Using an alloca'd variable with loads and stores would work well too. To date this is how every llvm language front end works. You would want to avoid malloc for such a purpose generally. mem2reg is nice enough to take your local load and stores and promote them to registers with PHINodes :-) On Apr 15, 2006, at 4:43 AM, Ralph Corderoy wrote: > > Hi Simon, > >>
2010 May 13
2
[LLVMdev] How to insert phi
Hi, I am new to llvm. I have project in llvm. For that I need SSA form, which is already implemented in llvm. Basically I want to know which pass insert phi and converts it to SSA form in llvm . Regards, Chayan
2010 May 13
0
[LLVMdev] How to insert phi
Chayan Sarkar wrote: > Hi, > I am new to llvm. I have project in llvm. For that I need SSA form, > which is already implemented in llvm. Basically I want to know which > pass insert phi and converts it to SSA form in llvm . http://llvm.org/docs/Passes.html#mem2reg which is lib/Transforms/Utils/PromoteMemoryToRegister.cpp. Nick
2009 Jun 10
1
[LLVMdev] Phi Node Question
I'm designing a JIT compiler and I have a potentially problematic situation. The functions I compile may need to create/access an object during their execution. In the case where this object won't be needed, I'd rather avoid generating code to creating the object, as this is a slight performance waste. Unfortunately, it's rather difficult to know whether this will be the case
2004 Jul 09
2
[LLVMdev] PHI nodes in machine code
Misha Brukman wrote: > LLVM Machine code is in SSA. This explains quite a lot. I though it's possible to just reduce convert phis into copy instructions in predecessors -- all of which will have the same destination register. > gets you two definitions of r. So we have machine PHI nodes merge the > two possible values into one for result of r. These phis get removed > after
2010 Sep 13
2
[LLVMdev] where are my phi-nodes?
On Sep 13, 2010, at 1:15 AM, Duncan Sands wrote: >> I compiled with "llvm-gcc -emit-llvm test.c -S -o test.ll". Attached to this >> message are the source and the resulting ll output. > > compile with optimization. The llvm-gcc front-end "cheats" and stores/loads all > values to/from memory, avoiding the need to construct phi nodes; instead it lets >
2010 Jul 21
1
[LLVMdev] Union type, is it really used or necessary?
On Tue, Jul 20, 2010 at 2:46 PM, Talin <viridia at gmail.com> wrote: > On Tue, Jul 20, 2010 at 8:34 AM, Chris Lattner <clattner at apple.com> wrote: > >> >> On Jul 20, 2010, at 1:36 AM, Anton Korobeynikov wrote: >> >> >> used to make the code manipulating the union type "well typed". This >> >> approach seems work very well, is
2009 Oct 01
3
[LLVMdev] PHI and Allocas
Hi, I'm incrementing my toy compiler to account for variable mutations around if/else blocks. Reading the Kaleidoscope tutorial, I've learnt that I can substitute the PHI node creation by allocas and retrieving the value later, if needed. The Kaleidoscope example seems to account for one value only, the result of: Value *ThenV = Then->Codegen(); (...) Value *ElseV =
2012 Aug 20
2
[LLVMdev] How to eliminate PHI nodes on pointer types?
Somewhere during optimization PHI nodes on pointer types (including alloca instructions) are being introduced, and they persist through the scalar replacement of aggregates pass and others. I can't seem to find a combination of passes or transformations to get rid of them. Has anyone had this problem before, and know a transformation to eliminate it? My optimization passes rely on
2004 Jul 09
0
[LLVMdev] PHI nodes in machine code
On Fri, 9 Jul 2004, Vladimir Prus wrote: > Misha Brukman wrote: > > > LLVM Machine code is in SSA. > > This explains quite a lot. I though it's possible to just reduce convert phis > into copy instructions in predecessors -- all of which will have the same > destination register. There are algorithms for eliminating PHI nodes, but they aren't quite so simple.
2009 Jan 28
4
[LLVMdev] Copy Instructions?
On Tuesday 27 January 2009 18:28, Eli Friedman wrote: > You can use a no-op bitcast for scalars, but there isn't any reliable > way to do it for all first-class values. Guh. > That said, I don't quite follow the issue. This is SSA, so the only way a > value can change is if you change the code. This isn't (yet) SSA. This is mem2reg turning things into SSA. >