[PATCH] D89855: [PowerPC] Extend folding RLWINM + RLWINM to post-RA.

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 18:44:41 PST 2020


lkail added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:3260
+    SrcMI = MRI->getVRegDef(FoldingReg);
+  } else {
+    SrcMI = getDefMIPostRA(FoldingReg, MI, OtherIntermediateUse);
----------------
I suggest checking `Register::isPhysicalRegister` explicitly, since `Reg` might also be a stackslot.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:3289
+    // only do the folding if SrcMI is going to be erased.
+    if (!CanErase && SrcMI->definesRegister(SrcMI->getOperand(1).getReg()))
+      return false;
----------------
Suggest using `modifiesRegister` or it'll miss case like `$x3 = rlwinm $r3, ...`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89855



More information about the llvm-commits mailing list