[PATCH] D35025: [SimplifyCFG] Move a portion of an if statement that should already be implied to an assert

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 09:30:20 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL307276: [SimplifyCFG]  Move a portion of an if statement that should already be implied… (authored by ctopper).

Changed prior to commit:
  https://reviews.llvm.org/D35025?vs=105311&id=105456#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D35025

Files:
  llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp


Index: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -5754,8 +5754,8 @@
   if (BasicBlock *Dom = BB->getSinglePredecessor()) {
     auto *PBI = dyn_cast_or_null<BranchInst>(Dom->getTerminator());
     if (PBI && PBI->isConditional() &&
-        PBI->getSuccessor(0) != PBI->getSuccessor(1) &&
-        (PBI->getSuccessor(0) == BB || PBI->getSuccessor(1) == BB)) {
+        PBI->getSuccessor(0) != PBI->getSuccessor(1)) {
+      assert(PBI->getSuccessor(0) == BB || PBI->getSuccessor(1) == BB);
       bool CondIsFalse = PBI->getSuccessor(1) == BB;
       Optional<bool> Implication = isImpliedCondition(
           PBI->getCondition(), BI->getCondition(), DL, CondIsFalse);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35025.105456.patch
Type: text/x-patch
Size: 851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170706/23525b3f/attachment-0001.bin>


More information about the llvm-commits mailing list