From 1f6ca0ba1568acbb293a3cf5b3723af92013585d Mon Sep 17 00:00:00 2001 From: Gabor Buella Date: Thu, 25 Oct 2018 08:32:29 +0000 Subject: Add -instcombine-code-sinking option Reviewers: craig.topper, andrew.w.kaylor, efriedma Reviewed By: craig.topper, andrew.w.kaylor, efriedma Differential Revision: https://reviews.llvm.org/D52709 llvm-svn: 345248 --- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 34a5e1955b6..8506cf9baee 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -119,6 +119,10 @@ STATISTIC(NumReassoc , "Number of reassociations"); DEBUG_COUNTER(VisitCounter, "instcombine-visit", "Controls which instructions are visited"); +static cl::opt +EnableCodeSinking("instcombine-code-sinking", cl::desc("Enable code sinking"), + cl::init(true)); + static cl::opt EnableExpensiveCombines("expensive-combines", cl::desc("Enable expensive instruction combines")); @@ -3103,7 +3107,7 @@ bool InstCombiner::run() { } // See if we can trivially sink this instruction to a successor basic block. - if (I->hasOneUse()) { + if (EnableCodeSinking && I->hasOneUse()) { BasicBlock *BB = I->getParent(); Instruction *UserInst = cast(*I->user_begin()); BasicBlock *UserParent; -- cgit v1.2.3