diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2018-04-24 03:27:00 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2018-04-24 03:27:00 +0000 |
commit | 0ace148ca6229f3d374728f48ad4a8ed9886c229 (patch) | |
tree | be0b59649b93db78ca8b4b6885a15fdb363f40a9 /llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | |
parent | 60dc462b04e88116bf7cea3d855a6f470a20abe7 (diff) | |
download | bcm5719-llvm-0ace148ca6229f3d374728f48ad4a8ed9886c229.tar.gz bcm5719-llvm-0ace148ca6229f3d374728f48ad4a8ed9886c229.zip |
[PM/LoopUnswitch] Remove another over-aggressive assert.
This code path can very clearly be called in a context where we have
baselined all the cloned blocks to a particular loop and are trying to
handle nested subloops. There is no harm in this, so just relax the
assert. I've added a test case that will make sure we actually exercise
this code path.
llvm-svn: 330680
Diffstat (limited to 'llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp index c7b071b36b5..c28311fe4b0 100644 --- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp @@ -913,11 +913,8 @@ static Loop *cloneLoopNest(Loop &OrigRootL, Loop *RootParentL, for (auto *BB : OrigL.blocks()) { auto *ClonedBB = cast<BasicBlock>(VMap.lookup(BB)); ClonedL.addBlockEntry(ClonedBB); - if (LI.getLoopFor(BB) == &OrigL) { - assert(!LI.getLoopFor(ClonedBB) && - "Should not have an existing loop for this block!"); + if (LI.getLoopFor(BB) == &OrigL) LI.changeLoopFor(ClonedBB, &ClonedL); - } } }; |