[PATCH] D52345: [PowerPC] optimize conditional branch on CRSET/CRUNSET

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 21 10:50:37 PDT 2018


nemanjai added a comment.

I'm just curious, is there something that runs after this pass that will clean up unreachable blocks if any became unreachable? For example, if `MBB1` is the only predecessor of `MBB2` and `MBB2` is removed as a successor to `MBB1`, will something remove `MBB2` afterwards.



================
Comment at: lib/Target/PowerPC/PPCPreEmitPeephole.cpp:121
+            if (It->isDebugInstr()) continue;
+            assert(It->isTerminator());
+            InstrsToErase.push_back(&*It);
----------------
Maybe add a comment to this assert such as "Non-terminator in BB after a terminator".


================
Comment at: lib/Target/PowerPC/PPCPreEmitPeephole.cpp:139
+        if (!SeenUse) {
+          // We need to check use of the CRBit in predecessors.
+          for (auto &SuccMBB : MBB.successors())
----------------
Don't you mean `successors` in this comment?


https://reviews.llvm.org/D52345





More information about the llvm-commits mailing list