diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-11-19 20:06:13 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-11-19 20:06:13 +0000 |
commit | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (patch) | |
tree | f42add1021b9f2ac6a69ac7cf6c4499962739a45 /llvm/lib/Analysis/CodeMetrics.cpp | |
parent | 344a3780b2e33f6ca763666c380202b18aab72a3 (diff) |
Diffstat (limited to 'llvm/lib/Analysis/CodeMetrics.cpp')
-rw-r--r-- | llvm/lib/Analysis/CodeMetrics.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/CodeMetrics.cpp b/llvm/lib/Analysis/CodeMetrics.cpp index 8c8e2ee6627f..27c52506352f 100644 --- a/llvm/lib/Analysis/CodeMetrics.cpp +++ b/llvm/lib/Analysis/CodeMetrics.cpp @@ -34,8 +34,9 @@ appendSpeculatableOperands(const Value *V, for (const Value *Operand : U->operands()) if (Visited.insert(Operand).second) - if (isSafeToSpeculativelyExecute(Operand)) - Worklist.push_back(Operand); + if (const auto *I = dyn_cast<Instruction>(Operand)) + if (!I->mayHaveSideEffects() && !I->isTerminator()) + Worklist.push_back(I); } static void completeEphemeralValues(SmallPtrSetImpl<const Value *> &Visited, |