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

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 03:44:17 PDT 2020


lkail 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
----------------
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.


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

https://reviews.llvm.org/D78063





More information about the llvm-commits mailing list