[PATCH] D78063: [PowerPC] Remove extra instruction left by emitRLDICWhenLoweringJumpTables

Anil Mahmud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 04:16:26 PDT 2020


anil9 marked an inline comment as done.
anil9 added inline comments.


================
Comment at: llvm/test/CodeGen/PowerPC/jump-tables-collapse-rotate-remove-SrcMI.mir:153
+    %30:g8rc = ADD8 %29, %28
+    MTCTR8 %30, implicit-def $ctr8
+    BCTR8 implicit $ctr8
----------------
lkail wrote:
> anil9 wrote:
> > lkail wrote:
> > > What if there is a use of `%4:g8rc` here? Like
> > > ```
> > >     %30:g8rc = ADD8 %29, %28                                                                                             
> > >     %31:g8rc = ADD8 %30, %4                                                                                              
> > >     MTCTR8 %31, implicit-def $ctr8
> > > ```
> > > I suppose the folding still happened and line148 turned to
> > > ```
> > >   %26:g8rc_and_g8rc_nox0 = RLDIC %16:g8rc, 2, 30
> > > ```
> > > and line147 wouldn't be erased.
> > Yes that should be the case since we delete SrcMI only when there is no other nondebug use.
> Then we still have `%4:g8rc = RLDICL killed %16, 0, 32` and `%26:g8rc_and_g8rc_nox0 = RLDIC %16:g8rc, 2, 30` is still using a killed vreg `%16` which might not pass machine verification.
But in that case the kill flag is not even supposed to exist, and if it does it is a bug with the pass that set it. And would be out of the scope of this PR to handle that.


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

https://reviews.llvm.org/D78063





More information about the llvm-commits mailing list