[PATCH] D23630: [PPC] Expand ISEL instruction into if-then-else sequence

Kit Barton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 11:27:00 PST 2017


kbarton added inline comments.


================
Comment at: lib/Target/PowerPC/PPCExpandISEL.cpp:260
+    // input for ISEL uses register class 'gprc_nor0' which explicitly excludes
+    // PPC::R0 (and similarly for the 64-bit variants). So:
+    // useSameRegister(TrueValue, FalseValue)  => FalseValue.getReg() != PPC::R0
----------------
There is currently a bug filed against the PPC backend for this (https://llvm.org/bugs/show_bug.cgi?id=31065). Once this bug is fixed, the register class will need to include r0.
Please include a check for R0 here as well, to ensure correctness. 


================
Comment at: lib/Target/PowerPC/PPCExpandISEL.cpp:347
+    for (MachineInstr &MI : *MBB)
+      LPR.stepForward(MI, Clobbers);
+    for (auto &LI : LPR)
----------------
According to the documentation for stepForward, it is not the preferred method for calculating liveness. Instead, stepBackward should be used instead. 
Did you try using stepBackward? If not, please change this to use stepBackward.


https://reviews.llvm.org/D23630





More information about the llvm-commits mailing list