[PATCH] D26434: Preserve assumption cache in loop-rotate

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 17:08:22 PST 2016


efriedma created this revision.
efriedma added a reviewer: majnemer.
efriedma added a subscriber: llvm-commits.
efriedma set the repository for this revision to rL LLVM.
Herald added a subscriber: mzolotukhin.

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?)


Repository:
  rL LLVM

https://reviews.llvm.org/D26434

Files:
  lib/Transforms/Scalar/LoopRotation.cpp


Index: lib/Transforms/Scalar/LoopRotation.cpp
===================================================================
--- lib/Transforms/Scalar/LoopRotation.cpp
+++ lib/Transforms/Scalar/LoopRotation.cpp
@@ -326,6 +326,10 @@
       // 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);
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26434.77290.patch
Type: text/x-patch
Size: 526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161109/6c0fd488/attachment.bin>


More information about the llvm-commits mailing list