[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:43:07 PDT 2018


kuhar accepted this revision.
kuhar added a comment.
This revision is now accepted and ready to land.

LGTM



================
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});
----------------
asbirlea wrote:
> kuhar wrote:
> > Is it possible that TrueDest == FalseDest? In this is the case, we should check it here as well.
> This should not be possible.
> The logic is contained to LoopUnswitch and the two callsites for this method each have a new block as the TrueDest and an existing block as FalseDest. I can add an assert (TrueDest != FalseDest), if you think it would be helpful.
I think it would make it clear for whoever tries to figure out the correct logic here later.


Repository:
  rL LLVM

https://reviews.llvm.org/D48457





More information about the llvm-commits mailing list