[PATCH] D64946: [AMDGPU] Fix trivial PHI into SI_END_CF.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 06:02:58 PDT 2019


hliao added a comment.

when we insert that copy, if we still follow the current logic of phi-elim, that COPY is already inserted after its use (that CF_END).

In D64946#1595202 <https://reviews.llvm.org/D64946#1595202>, @rampitec wrote:

> In D64946#1595185 <https://reviews.llvm.org/D64946#1595185>, @nhaehnle wrote:
>
> > In D64946#1593675 <https://reviews.llvm.org/D64946#1593675>, @rampitec wrote:
> >
> > > In D64946#1593334 <https://reviews.llvm.org/D64946#1593334>, @nhaehnle wrote:
> > >
> > > > How about the following simpler logic:
> > > >
> > > > - if the PHI is used by any basic-block prologue instruction (except other PHIs), then insert the COPY at the top of the basic block
> > > > - otherwise, insert the COPY after the basic-block prologue
> > >
> > >
> > > In this case COPY in the prologue also shall be marked as prologue instruction somehow.
> >
> >
> > You're right, my idea doesn't work.
>
>
> Unless we find a way to mark it as a prologue. An easiest (but not clean) way is to mark copy as impdef exec.





Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64946/new/

https://reviews.llvm.org/D64946





More information about the llvm-commits mailing list