[llvm] 4e0d992 - [NFC] Remove obsolete checks followed by fix of isGuaranteedToTransferExecutionToSuccessor
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 29 22:25:07 PDT 2020
Author: Max Kazantsev
Date: 2020-03-30T12:24:41+07:00
New Revision: 4e0d9925d6a3561449bdd8def27fd3f3f1b3fb9f
URL: https://github.com/llvm/llvm-project/commit/4e0d9925d6a3561449bdd8def27fd3f3f1b3fb9f
DIFF: https://github.com/llvm/llvm-project/commit/4e0d9925d6a3561449bdd8def27fd3f3f1b3fb9f.diff
LOG: [NFC] Remove obsolete checks followed by fix of isGuaranteedToTransferExecutionToSuccessor
In past, isGuaranteedToTransferExecutionToSuccessor contained some weird logic
for volatile loads/stores that was ultimately removed by patch D65375. It's time to
remove a piece of dependent logic that used to be a workaround for the code which
is now deleted.
Reviewed By: uenoku
Differential Revision: https://reviews.llvm.org/D76918
Added:
Modified:
llvm/lib/Analysis/InstructionPrecedenceTracking.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp b/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp
index 3f5a161c8659..a6e4455c2e6e 100644
--- a/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp
+++ b/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp
@@ -126,26 +126,7 @@ bool ImplicitControlFlowTracking::isSpecialInstruction(
// to avoid wrong assumptions of sort "if A is executed and B post-dominates
// A, then B is also executed". This is not true is there is an implicit
// control flow instruction (e.g. a guard) between them.
- //
- // TODO: Currently, isGuaranteedToTransferExecutionToSuccessor returns false
- // for volatile stores and loads because they can trap. The discussion on
- // whether or not it is correct is still ongoing. We might want to get rid
- // of this logic in the future. Anyways, trapping instructions shouldn't
- // introduce implicit control flow, so we explicitly allow them here. This
- // must be removed once isGuaranteedToTransferExecutionToSuccessor is fixed.
- if (isGuaranteedToTransferExecutionToSuccessor(Insn))
- return false;
- if (isa<LoadInst>(Insn)) {
- assert(cast<LoadInst>(Insn)->isVolatile() &&
- "Non-volatile load should transfer execution to successor!");
- return false;
- }
- if (isa<StoreInst>(Insn)) {
- assert(cast<StoreInst>(Insn)->isVolatile() &&
- "Non-volatile store should transfer execution to successor!");
- return false;
- }
- return true;
+ return !isGuaranteedToTransferExecutionToSuccessor(Insn);
}
bool MemoryWriteTracking::isSpecialInstruction(
More information about the llvm-commits
mailing list