[PATCH] D54593: [X86] Fix PR39658: avoid duplicated successors in condibr merge

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 21 20:45:30 PST 2018


mkazantsev requested changes to this revision.
mkazantsev added inline comments.
This revision now requires changes to proceed.


================
Comment at: lib/Target/X86/X86CondBrFolding.cpp:152
+    auto SI =
+        llvm::find_if(MBBI->successors(), [&RootMBB](const MachineBasicBlock *SI){
+          return SI == RootMBB;
----------------
Should be `llvm::find_if(MBBI->predecessors(), ...`, not successors.


================
Comment at: test/CodeGen/X86/pr39658.ll:15
+; CHECK: jg
+; CHECK-NOT: jge
+
----------------
I would rather check Phi nodes we used to modify improperly, not jump instructions that can accidentally be matched in other blocks.


https://reviews.llvm.org/D54593





More information about the llvm-commits mailing list