[llvm] r286410 - Preserve assumption cache in loop-rotate.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 15:05:02 PST 2016


Author: efriedma
Date: Wed Nov  9 17:05:01 2016
New Revision: 286410

URL: http://llvm.org/viewvc/llvm-project?rev=286410&view=rev
Log:
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


Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=286410&r1=286409&r2=286410&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Wed Nov  9 17:05:01 2016
@@ -326,6 +326,10 @@ bool LoopRotate::rotateLoop(Loop *L, boo
       // Otherwise, stick the new instruction into the new block!
       C->setName(Inst->getName());
       C->insertBefore(LoopEntryBranch);
+
+      if (auto *II = dyn_cast<IntrinsicInst>(C))
+        if (II->getIntrinsicID() == Intrinsic::assume)
+          AC->registerAssumption(II);
     }
   }
 




More information about the llvm-commits mailing list