[PATCH] D71885: [PowerPC] replace rlwinm operand 1 with src rlwinm operand 1

qshanz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 30 01:56:08 PST 2019


steven.zhang requested changes to this revision.
steven.zhang added a comment.
This revision now requires changes to proceed.

The RLWINMo should also be removed,



================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:963
+          if (MRI->use_nodbg_empty(FoldingReg) &&
+              (SrcMI->getOpcode() == PPC::RLWINM ||
+               SrcMI->getOpcode() == PPC::RLWINM8)) {
----------------
You don't need to check the opcode any more and it will fix the missing case of
```
RLWINM
RLWINMo -->

ANDIo
```


================
Comment at: llvm/test/CodeGen/PowerPC/fold-rlwinm.mir:136
     %2:gprc = RLWINM %1:gprc, 27, 5, 10
-    ; CHECK: %2:gprc = RLWINM %1, 27, 5, 10
+    ; CHECK-NOT: %2:gprc
     %3:gprc = RLWINMo %2:gprc, 8, 5, 10, implicit-def $cr0
----------------
No. This is NOT right. What you are checking is the removal of RLWINM, instead of %2:gprc. You can do it as:

```
; CHECK-NOT: RLWINM {regex here}, 27
```


================
Comment at: llvm/test/CodeGen/PowerPC/fold-rlwinm.mir:137
+    ; CHECK-NOT: %2:gprc
     %3:gprc = RLWINMo %2:gprc, 8, 5, 10, implicit-def $cr0
+    ; CHECK: %3:gprc = ANDIo %1, 0, implicit-def $cr0
----------------
Why the RLWINMo is still here ?


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

https://reviews.llvm.org/D71885





More information about the llvm-commits mailing list