Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Andrew Trick <atrick <at> apple.com>
Subject: Re: ifconversion before register allocation
Newsgroups: gmane.comp.compilers.llvm.devel
Date: Thursday 13th February 2014 01:28:18 UTC (over 3 years ago)
On Feb 12, 2014, at 5:09 PM, mahdi hamzeh  wrote:

> Andy,
> 
> I have already enabled EarlyIfConversion but as you said, it does not
predicate instruction (only works for exception safe instructions).

Right, there is no in-tree machine IR pass that predicates instructions
with virtual registers. You could do such a thing with a target specific
pass, but the register coalescer, preRA scheduler, and RA are not
predicate-aware. Before phi-elimination and register coalescing you would
need some kind of select/cmov pseudo instruction. You could lower that
instruction postRA, which would require copies—probably not what you
want. Or you could coalesce the selects before regalloc and the register
allocator will allocate predicated instructions conservatively (register
operands appear live under all conditions).

-Andy

> Thanks
> Mahdi
> 
> 
> On Wed, Feb 12, 2014 at 5:29 PM, Andrew Trick  wrote:
> 
> On Feb 12, 2014, at 3:38 PM, mahdi hamzeh  wrote:
> 
> > Hi all,
> >
> > I am using llvm backend to generate binary for a specific accelerator.
I would like to convert instructions into predicated form when instructions
are still in SSA form. It looks like that ifconversion execution flow is
different when instructions are in SSA form. However, I am encountering
many problems (specially with registers) when I use it before register
allocation. I was wondering if anybody could confirm that if-conversion can
be used before register allocation? Any suggestion is really appreciated.
> 
> EarlyIfConverter is the pass designed to run before RA. It is not enabled
by default. It is quite different from the post-ra if-converter. It works
on SSA and does not actually predicate instructions. It generates CMOVs.
> —Andy
> 
> >
> > Thanks
> > _______________________________________________
> > LLVM Developers mailing list
> > [email protected]         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 
>
 
CD: 3ms