Bagel via llvm-dev
2020-Mar-24 18:22 UTC
[llvm-dev] Questions on ifconversion and predication
Assume an architecture that has multiple condition code registers, e.g., powerpc. Now assume that there are predicate instructions like thumb2, but can specify which condition code register they refer to. Now also assume that these predicate instructions themselves are predicatible, if executed they change the current predication state. Can LLVM handle multiple levels of predication? When is IfConversion used and when is EarlyIfConversion used? Is there any documentation on this? thanks, brian
jingu kang via llvm-dev
2020-Apr-07 20:17 UTC
[llvm-dev] Questions on ifconversion and predication
Hi Bagel As far as I know, the EarlyIfConversion pass is used before register allocation. It works on SSA form and it does not use predication. The IfConversion pass is used after register allocation and it uses predication. Unfortunately, it does not support multiple predication. I hope it helps you. Cheers JinGu Kang 2020년 3월 24일 (화) 오후 6:22, Bagel via llvm-dev <llvm-dev at lists.llvm.org>님이 작성:> > Assume an architecture that has multiple condition code registers, e.g., powerpc. > > Now assume that there are predicate instructions like thumb2, but can specify > which condition code register they refer to. > > Now also assume that these predicate instructions themselves are predicatible, > if executed they change the current predication state. > > Can LLVM handle multiple levels of predication? > When is IfConversion used and when is EarlyIfConversion used? > Is there any documentation on this? > > thanks, > brian > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Bagel via llvm-dev
2020-Apr-10 17:43 UTC
[llvm-dev] Questions on ifconversion and predication
Thanks. EarlyIfConversion is too early for my use. It does appear that perhaps IfConversion can be used prior to register allocation. There is a line in IfConverter::runOnMachineFunction(): PreRegAlloc = MRI->isSSA(); I don't think any in-tree architectures use IfConverter pre register allocation, but perhaps there are out-of-tree uses? regards, brian On 4/7/20 3:17 PM, jingu kang wrote:> Hi Bagel > > As far as I know, the EarlyIfConversion pass is used before register > allocation. It works on SSA form and it does not use predication. > The IfConversion pass is used after register allocation and it uses > predication. Unfortunately, it does not support multiple predication. > > I hope it helps you. > > Cheers > JinGu Kang > > 2020년 3월 24일 (화) 오후 6:22, Bagel via llvm-dev <llvm-dev at lists.llvm.org>님이 작성: >> >> Assume an architecture that has multiple condition code registers, e.g., powerpc. >> >> Now assume that there are predicate instructions like thumb2, but can specify >> which condition code register they refer to. >> >> Now also assume that these predicate instructions themselves are predicatible, >> if executed they change the current predication state. >> >> Can LLVM handle multiple levels of predication? >> When is IfConversion used and when is EarlyIfConversion used? >> Is there any documentation on this? >> >> thanks, >> brian >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
jingu kang via llvm-dev
2020-Apr-10 17:43 UTC
[llvm-dev] Questions on ifconversion and predication
I do not think it is possible to run the ifconversion pass before register allocation. As far as I know, ths pass does not handle 'PHI' because it assumes input after register allocation. The pass uses 'BranchFolder', which assumes to run after register allocation, to tidy up CFG because the ifconversion pass generates quite dirty CFG. It could be good try to run the pass before register allocation in order to find the issues. Cheers JinGu Kang On Fri, 10 Apr 2020, 18:00 Bagel, <bagel99 at gmail.com> wrote:> Thanks. > > EarlyIfConversion is too early for my use. It does appear that perhaps > IfConversion can be used prior to register allocation. There is a line > in IfConverter::runOnMachineFunction(): > PreRegAlloc = MRI->isSSA(); > I don't think any in-tree architectures use IfConverter pre register > allocation, but perhaps there are out-of-tree uses? > > regards, > brian > > On 4/7/20 3:17 PM, jingu kang wrote: > > Hi Bagel > > > > As far as I know, the EarlyIfConversion pass is used before register > > allocation. It works on SSA form and it does not use predication. > > The IfConversion pass is used after register allocation and it uses > > predication. Unfortunately, it does not support multiple predication. > > > > I hope it helps you. > > > > Cheers > > JinGu Kang > > > > 2020년 3월 24일 (화) 오후 6:22, Bagel via llvm-dev <llvm-dev at lists.llvm.org>님이 > 작성: > >> > >> Assume an architecture that has multiple condition code registers, > e.g., powerpc. > >> > >> Now assume that there are predicate instructions like thumb2, but can > specify > >> which condition code register they refer to. > >> > >> Now also assume that these predicate instructions themselves are > predicatible, > >> if executed they change the current predication state. > >> > >> Can LLVM handle multiple levels of predication? > >> When is IfConversion used and when is EarlyIfConversion used? > >> Is there any documentation on this? > >> > >> thanks, > >> brian > >> _______________________________________________ > >> LLVM Developers mailing list > >> llvm-dev at lists.llvm.org > >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200410/48f394d0/attachment.html>