[PATCH] D67941: Invalidate assumption cache before outlining.

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 16:29:06 PDT 2019


hiraditya updated this revision to Diff 221434.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67941/new/

https://reviews.llvm.org/D67941

Files:
  llvm/lib/Transforms/Utils/CodeExtractor.cpp


Index: llvm/lib/Transforms/Utils/CodeExtractor.cpp
===================================================================
--- llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -1277,13 +1277,6 @@
 
     // Insert this basic block into the new function
     newBlocks.push_back(Block);
-
-    // Remove @llvm.assume calls that were moved to the new function from the
-    // old function's assumption cache.
-    if (AC)
-      for (auto &I : *Block)
-        if (match(&I, m_Intrinsic<Intrinsic::assume>()))
-          AC->unregisterAssumption(cast<CallInst>(&I));
   }
 }
 
@@ -1375,6 +1368,16 @@
     }
   }
 
+  if (AC) {
+    // Remove @llvm.assume calls that were moved to the new function from the
+    // old function's assumption cache.
+    for (BasicBlock *Block : Blocks)
+       for (auto &I : *Block)
+          if (match(&I, m_Intrinsic<Intrinsic::assume>()))
+            AC->unregisterAssumption(cast<CallInst>(&I));
+  }
+
+
   // If we have any return instructions in the region, split those blocks so
   // that the return is not in the region.
   splitReturnBlocks();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67941.221434.patch
Type: text/x-patch
Size: 1130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190923/98f512a4/attachment.bin>


More information about the llvm-commits mailing list