<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Feb 12, 2014, at 5:09 PM, mahdi hamzeh <<a href="mailto:mahdy.hamzeh@gmail.com">mahdy.hamzeh@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Andy,<div><br></div><div>I have already enabled EarlyIfConversion but as you said, it does not predicate instruction (only works for exception safe instructions).</div></div></blockquote><div><br></div><div>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).</div><div><br></div><div>-Andy</div><br><blockquote type="cite"><div dir="ltr"><div>Thanks</div><div>Mahdi</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 12, 2014 at 5:29 PM, Andrew Trick <span dir="ltr"><<a href="mailto:atrick@apple.com" target="_blank">atrick@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
On Feb 12, 2014, at 3:38 PM, mahdi hamzeh <<a href="mailto:mahdy.hamzeh@gmail.com">mahdy.hamzeh@gmail.com</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> 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.<br>

<br>
</div>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.<br>

—Andy<br>
<br>
><br>
> Thanks<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote></div><br></div>
</blockquote></div><br></body></html>