From: Eli Friedman Date: Wed, 9 Nov 2016 23:05:01 +0000 (+0000) Subject: Preserve assumption cache in loop-rotate. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e23db6f4e774dce154c4d7cc5792111bc366e22;p=llvm Preserve assumption cache in loop-rotate. No testcase included because I can't figure out how to reduce it. (It's easy to write a testcase where rotation clones an assume, but that doesn't actually seem to trigger the crash in opt on its own; maybe an issue with the laziness?) Differential Revision: https://reviews.llvm.org/D26434 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286410 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp index 4498e1db521..32d2caa78da 100644 --- a/lib/Transforms/Scalar/LoopRotation.cpp +++ b/lib/Transforms/Scalar/LoopRotation.cpp @@ -326,6 +326,10 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { // Otherwise, stick the new instruction into the new block! C->setName(Inst->getName()); C->insertBefore(LoopEntryBranch); + + if (auto *II = dyn_cast(C)) + if (II->getIntrinsicID() == Intrinsic::assume) + AC->registerAssumption(II); } }