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

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 20:49:37 PDT 2018


inouehrs marked an inline comment as done.
inouehrs added inline comments.


================
Comment at: lib/Target/PowerPC/PPCPreEmitPeephole.cpp:109
+        auto RemoveMBB = [](MachineBasicBlock *MBB) {
+          for (auto Succ: MBB->successors())
+            MBB->removeSuccessor(Succ);
----------------
nemanjai wrote:
> Any one of these successors now might have become unreachable, right? Should this just be a static recursive function?
> Seems that it would be nice if we could just run a pass that eliminates unreachable blocks after this pass.
As long as I tested, I have never seen an unreachable block caused by this optimization. So I feel it is not warth paying too much cost for this.
How about commiting this patch without unreachable block elimination and investigate last unreachable block elimination opportunity (not limited to those caused by this optimization) as a separate patch?


https://reviews.llvm.org/D52345





More information about the llvm-commits mailing list