<div dir="auto">I do not think it is possible to run the ifconversion pass before register allocation.<div dir="auto"><br></div><div dir="auto">As far as I know, ths pass does not handle 'PHI' because it assumes input after register allocation.</div><div dir="auto"><br></div><div dir="auto">The pass uses 'BranchFolder', which assumes to run after register allocation, to tidy up CFG because the ifconversion pass generates quite dirty CFG.</div><div dir="auto"><br></div><div dir="auto">It could be good try to run the pass before register allocation in order to find the issues.</div><div dir="auto"><br></div><div dir="auto">Cheers</div><div dir="auto">JinGu Kang</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 10 Apr 2020, 18:00 Bagel, <<a href="mailto:bagel99@gmail.com">bagel99@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks.<br>
<br>
EarlyIfConversion is too early for my use.  It does appear that perhaps <br>
IfConversion can be used prior to register allocation.  There is a line<br>
in IfConverter::runOnMachineFunction():<br>
    PreRegAlloc = MRI->isSSA();<br>
I don't think any in-tree architectures use IfConverter pre register <br>
allocation, but perhaps there are out-of-tree uses?<br>
<br>
regards,<br>
brian<br>
<br>
On 4/7/20 3:17 PM, jingu kang wrote:<br>
> Hi Bagel<br>
> <br>
> As far as I know, the EarlyIfConversion pass is used before register<br>
> allocation. It works on SSA form and it does not use predication.<br>
> The IfConversion pass is used after register allocation and it uses<br>
> predication. Unfortunately, it does not support multiple predication.<br>
> <br>
> I hope it helps you.<br>
> <br>
> Cheers<br>
> JinGu Kang<br>
> <br>
> 2020년 3월 24일 (화) 오후 6:22, Bagel via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a>>님이 작성:<br>
>><br>
>> Assume an architecture that has multiple condition code registers, e.g., powerpc.<br>
>><br>
>> Now assume that there are predicate instructions like thumb2, but can specify<br>
>> which condition code register they refer to.<br>
>><br>
>> Now also assume that these predicate instructions themselves are predicatible,<br>
>> if executed they change the current predication state.<br>
>><br>
>> Can LLVM handle multiple levels of predication?<br>
>> When is IfConversion used and when is EarlyIfConversion used?<br>
>> Is there any documentation on this?<br>
>><br>
>> thanks,<br>
>> brian<br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank" rel="noreferrer">llvm-dev@lists.llvm.org</a><br>
>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div>