From 4e0d9925d6a3561449bdd8def27fd3f3f1b3fb9f Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Mon, 30 Mar 2020 12:13:02 +0700 Subject: [PATCH] [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 --- llvm/lib/Analysis/InstructionPrecedenceTracking.cpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp b/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp index 3f5a161..a6e4455 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(Insn)) { - assert(cast(Insn)->isVolatile() && - "Non-volatile load should transfer execution to successor!"); - return false; - } - if (isa(Insn)) { - assert(cast(Insn)->isVolatile() && - "Non-volatile store should transfer execution to successor!"); - return false; - } - return true; + return !isGuaranteedToTransferExecutionToSuccessor(Insn); } bool MemoryWriteTracking::isSpecialInstruction( -- 2.7.4