aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@quicinc.com>2021-07-26 10:51:00 -0700
committerEli Friedman <efriedma@quicinc.com>2021-07-26 10:51:00 -0700
commit5c486ce04db4d33ae5be65dac4a03d1b0f46f3e2 (patch)
tree406b4db0f2a878200336bf4ac5e75fe8353bca6f /llvm/lib/Analysis/ValueTracking.cpp
parent0d41d21929d4366997e67f986689eef0253547b6 (diff)
downloadllvm-5c486ce04db4d33ae5be65dac4a03d1b0f46f3e2.zip
llvm-5c486ce04db4d33ae5be65dac4a03d1b0f46f3e2.tar.gz
llvm-5c486ce04db4d33ae5be65dac4a03d1b0f46f3e2.tar.bz2
[LLVM IR] Allow volatile stores to trap.
Proposed alternative to D105338. This is ugly, but short-term I think it's the best way forward: first, let's formalize the hacks into a coherent model. Then we can consider extensions of that model (we could have different flavors of volatile with different rules). Differential Revision: https://reviews.llvm.org/D106309
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index f5e320e..522d218 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -5274,6 +5274,10 @@ bool llvm::isGuaranteedToTransferExecutionToSuccessor(const Instruction *I) {
if (isa<UnreachableInst>(I))
return false;
+ // Note: Do not add new checks here; instead, change Instruction::mayThrow or
+ // Instruction::willReturn.
+ //
+ // FIXME: Move this check into Instruction::willReturn.
if (isa<CatchPadInst>(I)) {
switch (classifyEHPersonality(I->getFunction()->getPersonalityFn())) {
default: