[PATCH] D67941: Invalidate assumption cache before outlining.
Aditya Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 05:39:16 PDT 2019
hiraditya updated this revision to Diff 221729.
hiraditya added a comment.
Reverting r372667
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67941/new/
https://reviews.llvm.org/D67941
Files:
llvm/lib/Transforms/IPO/HotColdSplitting.cpp
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();
Index: llvm/lib/Transforms/IPO/HotColdSplitting.cpp
===================================================================
--- llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -659,11 +659,6 @@
} while (!Region.empty());
}
- // We need to explicitly clear the assumption cache since the value tracking
- // may now be invalid as part of the function has changed.
- if (Changed)
- if (AssumptionCache *AC = LookupAC(F))
- AC->clear();
return Changed;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67941.221729.patch
Type: text/x-patch
Size: 1654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190925/ffbcedb1/attachment.bin>
More information about the llvm-commits
mailing list