[LLVMdev] Getting rid of phi instructions?

Eli Friedman eli.friedman at gmail.com
Wed Aug 31 01:41:58 PDT 2011


On Wed, Aug 31, 2011 at 1:06 AM, Teemu Rinta-aho
<teemu.rinta-aho at nomadiclab.com> wrote:
> 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 be somewhat silly from the viewpoint of software compilation for a CPU.

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.

-Eli



More information about the llvm-dev mailing list