aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
diff options
context:
space:
mode:
authorDmitry Makogon <d.makogon@g.nsu.ru>2023-06-08 18:27:15 +0700
committerDmitry Makogon <d.makogon@g.nsu.ru>2023-06-08 18:29:19 +0700
commit64397d8f25ef6eb1052c20a646589ab9d70cc0d7 (patch)
treea08ddba0137dba25124325e1c3d225a62d75fbaf /llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
parentf7cfa3a7ab947c64dfe0e2864dcb6e8c4bf1486e (diff)
downloadllvm-64397d8f25ef6eb1052c20a646589ab9d70cc0d7.zip
llvm-64397d8f25ef6eb1052c20a646589ab9d70cc0d7.tar.gz
llvm-64397d8f25ef6eb1052c20a646589ab9d70cc0d7.tar.bz2
[SimpleLoopUnswitch] Verify LoopInfo after turning guards to branches
SplitBlockAndInsertIfThen doesn't correctly update LoopInfo when called with Unreachable=true, which is the case when we turn guards to branches in SimpleLoopUnswitch. This adds LoopInfo verification before returning from turnGuardIntoBranch.
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index 6034b6b..176c66f 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -2735,6 +2735,7 @@ static BranchInst *turnGuardIntoBranch(IntrinsicInst *GI, Loop &L,
MSSAU->getMemorySSA()->verifyMemorySSA();
}
+ LI.verify(DT);
++NumGuards;
return CheckBI;
}