similar to: [LLVMdev] Undoing SSA and Phi instructions

Displaying 20 results from an estimated 11000 matches similar to: "[LLVMdev] Undoing SSA and Phi instructions"

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
2012 Feb 03
5
[LLVMdev] Updating PHI for Instruction Domination?
So my best bet is to try and work in reg2mem mode and then go back to mem2reg? I'm curious, it seems though when you split a block that the phis get updated, right? On Thu, Feb 2, 2012 at 5:05 PM, Eric Christopher <echristo at apple.com> wrote: > Not that I'm aware of. > > -eric > > On Feb 2, 2012, at 3:47 PM, Ryan Taylor wrote: > > So essentially I'm
2012 Feb 06
1
[LLVMdev] Fwd: Updating PHI for Instruction Domination?
---------- Forwarded message ---------- From: Ryan Taylor <ryta1203 at gmail.com> Date: Mon, Feb 6, 2012 at 10:36 AM Subject: Re: [LLVMdev] Updating PHI for Instruction Domination? To: Eric Christopher <echristo at apple.com> Since I'm not sure which instructions I might want to replicate, would it be possible to cast the Value from "PHINode::getIncomingValue" to
2012 Feb 06
0
[LLVMdev] Updating PHI for Instruction Domination?
On Feb 2, 2012, at 5:13 PM, Ryan Taylor wrote: > So my best bet is to try and work in reg2mem mode and then go back to mem2reg? > I wouldn't. That sounds painful. > I'm curious, it seems though when you split a block that the phis get updated, right? Sure. There's code in splitBasicBlock to do this. It should just take a little bit of work to get what you want done.
2011 Aug 31
4
[LLVMdev] Getting rid of phi instructions?
On 30.8.2011, at 19.19, Eli Friedman wrote: > reg2mem won't do quite this transformation... not sure exactly what you need. I need to get rid of phis. This code is compiled from C++ and for some functions there are no phis, but multiple call instructions. I am targeting hardware in the end, and the next tool reading the IR does not like phis when it's generating VHDL. My questions may
2012 Feb 06
0
[LLVMdev] Updating PHI for Instruction Domination?
I guess not since Value is a superclass of Instruction. On Mon, Feb 6, 2012 at 10:36 AM, Ryan Taylor <ryta1203 at gmail.com> wrote: > > > ---------- Forwarded message ---------- > From: Ryan Taylor <ryta1203 at gmail.com> > Date: Mon, Feb 6, 2012 at 10:36 AM > Subject: Re: [LLVMdev] Updating PHI for Instruction Domination? > To: Eric Christopher <echristo at
2012 Feb 06
1
[LLVMdev] Updating PHI for Instruction Domination?
You're creating a new path that doesn't include L. For all values defined in L and used outside of L, you need to determine the new reaching def. That's specific to your transformation and can't be automated. Once you do that, creating the phi in F is natural. -Andy On Feb 6, 2012, at 11:51 AM, Ryan Taylor <ryta1203 at gmail.com> wrote: > I guess not since Value is a
2011 Aug 30
2
[LLVMdev] Getting rid of phi instructions?
Hi all, is there a pass to get rid of phi-instructions in a function? There's no loop involved. I have a function approx. like this: void @func() { entry: … bb1: … bb2: … %tmp100 = phi i32 [ 0, bb1 ], [ 1, bb2 ] … %tmp101 = getelementptr …, %tmp100 tail call void @anotherfunc(…, %tmp101) ret void } I would like it to rather be something like this: void @func() { entry: … bb1: ...
2008 Oct 16
2
[LLVMdev] Requiring a pass to run before/after a pass? (Adding PHIs and updating uses)
Is there a simple way to require a pass, e.g., Reg2Mem/Mem2Reg, to run before/after my transformation pass? Or do I do something like: struct myOpt { myOpt() { mBefore = createDemoteRegisterToMemoryPass(); mAfter = createPromoteMemoryToRegisterPass(); } getAnalysisUsage(AU) { AU.addRequired(my stuff); mBefore.getAnalysisUsage(AU); mAfter.getAnalysisUsage(AU); }
2011 Aug 31
2
[LLVMdev] Getting rid of phi instructions?
On 31.8.2011, at 11.41, Eli Friedman wrote: > Mmm... reg2mem will transform IR with PHI's into IR without them, but > it generates a bunch of alloca's, which I would assume are not cheap > to lower to VHDL. You might have to write your own pass to get the > precise transformation you're looking for. Right. Thanks. I need to see the reg2mem source code. Teemu
2011 Jan 25
1
[LLVMdev] LLVM grammar for ANTLR
Hi Sam, Thanks for your reply. I am implementing my research (http://www.it.usyd.edu.au/~suri/Detecting%20Buffer%20Over.pdf), a translation of LLVM to a simple non-deterministic language to detect buffer overflows. It involves (1) printing a control flow graph of basic blocks of a function (easily done) (2) translating each llvm statement to a corresponding data flow language (needs ASTs to
2012 Feb 03
0
[LLVMdev] Updating PHI for Instruction Domination?
Not that I'm aware of. -eric On Feb 2, 2012, at 3:47 PM, Ryan Taylor wrote: > So essentially I'm adding a path inside of the loop. Is there a way to have llvm automatically create new IR and update the PHIs simply by adding a block like this and changing the DomTree? > > ---------- Forwarded message ---------- > From: Ryan Taylor <ryta1203 at gmail.com> > Date:
2011 Jan 24
0
[LLVMdev] LLVM grammar for ANTLR
Hello Surinder, The existing hand-written parser is callable from almost anywhere so the only reason you'd need to have a parser for it would be to extend it. Originally it was written using Flex and Bison but Chris Lattner rewrote it from scratch to catch more errors at the parsing stage. The only feature I've found to be missing from the existing LLVM-AS utility was an include
2011 Aug 31
0
[LLVMdev] Getting rid of phi instructions?
On Wed, Aug 31, 2011 at 2:35 AM, Teemu Rinta-aho <teemu.rinta-aho at nomadiclab.com> wrote: > On 31.8.2011, at 11.41, Eli Friedman wrote: > >> Mmm... reg2mem will transform IR with PHI's into IR without them, but >> it generates a bunch of alloca's, which I would assume are not cheap >> to lower to VHDL.  You might have to write your own pass to get the
2011 Jan 31
0
[LLVMdev] Error : llvm/include/llvm/Pass.h:188: error: incomplete type 'llvm::DominatorTree' used in nested name specifier
Hi Surinder, Did you remember to #include "llvm/Analysis/Dominators.h"? Best, Douglas On Sun, Jan 30, 2011 at 11:24 PM, Surinder <surifilms at gmail.com> wrote: > I am creating a new pass (function pass) called Dfl from the Hello > example and notes on "Writing an LLVM Pass". When I compile the > program I get inncomplete type error
2011 Aug 30
0
[LLVMdev] Getting rid of phi instructions?
On Tue, Aug 30, 2011 at 9:12 AM, Teemu Rinta-aho <teemu.rinta-aho at nomadiclab.com> wrote: > Hi all, > > is there a pass to get rid of phi-instructions in a function? There's no loop involved. reg2mem. > I have a function approx. like this: > > void @func() { > entry: >        … > bb1: >        … > bb2: >        … >        %tmp100 = phi i32 [ 0,
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 Aug 31
0
[LLVMdev] Getting rid of phi instructions?
> the next tool reading the IR does not like phis when it's generating VHDL. If you're doing a conversion from LLVM IR to some other non-SSA IR (like the tool's), you can do the phi node removal yourself as you convert. Basically, every predecessor block referenced by a phi node will have an assignment to that variable before branching. There are techniques to make the resultant
2011 Jan 31
0
[LLVMdev] How to convert an iterator to an object pointer
Hi Surinder, You'll need to dereference your iterator to get a pointer: const BasicBlock *p = *pr; Cheers, Lang. On Mon, Jan 31, 2011 at 3:04 PM, Surinder <surifilms at gmail.com> wrote: > I have a pointer to a basic block and am iterating thru its > predecessor blocks. I want to get a pointer to the predecessor block. > How do I do it. I am using following code and it
2011 Jan 24
3
[LLVMdev] LLVM grammar for ANTLR
Has anyone written a grammar for LLVM for ANTLR. I mean an ANTLR grammar that parses LLVM instructions. Is an LLVM grammar available for any other parsing tool? Surinder