diff options
author | Gabor Buella <gabor.buella@intel.com> | 2018-10-25 08:32:29 +0000 |
---|---|---|
committer | Gabor Buella <gabor.buella@intel.com> | 2018-10-25 08:32:29 +0000 |
commit | 1f6ca0ba1568acbb293a3cf5b3723af92013585d (patch) | |
tree | 5cd1172541375040a810ce56091bf8ad0fa0b7a7 /llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | |
parent | c1c0fac76595da4a46db30da68e8444b9d1e3521 (diff) | |
download | bcm5719-llvm-1f6ca0ba1568acbb293a3cf5b3723af92013585d.tar.gz bcm5719-llvm-1f6ca0ba1568acbb293a3cf5b3723af92013585d.zip |
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
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstructionCombining.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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 @@ -120,6 +120,10 @@ DEBUG_COUNTER(VisitCounter, "instcombine-visit", "Controls which instructions are visited"); static cl::opt<bool> +EnableCodeSinking("instcombine-code-sinking", cl::desc("Enable code sinking"), + cl::init(true)); + +static cl::opt<bool> 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<Instruction>(*I->user_begin()); BasicBlock *UserParent; |