aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/CodeMetrics.cpp
diff options
context:
space:
mode:
authorMichael Kruse <llvm-project@meinersbur.de>2021-02-11 12:03:20 -0600
committerMichael Kruse <llvm-project@meinersbur.de>2021-02-11 12:17:38 -0600
commit606aa622b23855784c5db5b48b1c4800467fd851 (patch)
tree49444bd16e8be847c892478f6f86dc5af482fcdf /llvm/lib/Analysis/CodeMetrics.cpp
parentf8772da8cc9a0be65c9ba028c2b5a895c1ed4f91 (diff)
downloadllvm-606aa622b23855784c5db5b48b1c4800467fd851.zip
llvm-606aa622b23855784c5db5b48b1c4800467fd851.tar.gz
llvm-606aa622b23855784c5db5b48b1c4800467fd851.tar.bz2
Revert "[AssumptionCache] Avoid dangling llvm.assume calls in the cache"
This reverts commit b7d870eae7fdadcf10d0f177faa7409c2e37d776 and the subsequent fix "[Polly] Fix build after AssumptionCache change (D96168)" (commit e6810cab09fcbc87b6e5e4d226de0810e2f2ea38). It caused indeterminism in the output, such that e.g. the polly-x86_64-linux buildbot failed accasionally.
Diffstat (limited to 'llvm/lib/Analysis/CodeMetrics.cpp')
-rw-r--r--llvm/lib/Analysis/CodeMetrics.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/CodeMetrics.cpp b/llvm/lib/Analysis/CodeMetrics.cpp
index 846e1eb..8c8e2ee 100644
--- a/llvm/lib/Analysis/CodeMetrics.cpp
+++ b/llvm/lib/Analysis/CodeMetrics.cpp
@@ -74,7 +74,9 @@ void CodeMetrics::collectEphemeralValues(
SmallVector<const Value *, 16> Worklist;
for (auto &AssumeVH : AC->assumptions()) {
- Instruction *I = AssumeVH.getAssumeCI();
+ if (!AssumeVH)
+ continue;
+ Instruction *I = cast<Instruction>(AssumeVH);
// Filter out call sites outside of the loop so we don't do a function's
// worth of work for each of its loops (and, in the common case, ephemeral
@@ -96,7 +98,9 @@ void CodeMetrics::collectEphemeralValues(
SmallVector<const Value *, 16> Worklist;
for (auto &AssumeVH : AC->assumptions()) {
- Instruction *I = AssumeVH.getAssumeCI();
+ if (!AssumeVH)
+ continue;
+ Instruction *I = cast<Instruction>(AssumeVH);
assert(I->getParent()->getParent() == F &&
"Found assumption for the wrong function!");