[PATCH] D48457: [LoopUnswitch]Fix comparison for DomTree updates.

Jakub Kuderski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 21 15:10:12 PDT 2018


kuhar added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopUnswitch.cpp:945
     SmallVector<DominatorTree::UpdateType, 3> Updates;
-    if (TrueDest != OldBranchParent)
       Updates.push_back({DominatorTree::Insert, OldBranchParent, TrueDest});
----------------
If it's illegal to loop back to preheader, maybe there should be an assert for that?


================
Comment at: lib/Transforms/Scalar/LoopUnswitch.cpp:947
       Updates.push_back({DominatorTree::Insert, OldBranchParent, TrueDest});
-    if (FalseDest != OldBranchParent)
+    if (FalseDest != OldBranchSucc)
       Updates.push_back({DominatorTree::Insert, OldBranchParent, FalseDest});
----------------
Is it possible that TrueDest == FalseDest? In this is the case, we should check it here as well.


Repository:
  rL LLVM

https://reviews.llvm.org/D48457





More information about the llvm-commits mailing list