[PATCH] D72861: [InstCombine] Support disabling expensive combines in opt
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 17 08:57:12 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2ca092f32095: [InstCombine] Support disabling expensive combines in opt (authored by nikic).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72861/new/
https://reviews.llvm.org/D72861
Files:
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/expensive-combines.ll
Index: llvm/test/Transforms/InstCombine/expensive-combines.ll
===================================================================
--- llvm/test/Transforms/InstCombine/expensive-combines.ll
+++ llvm/test/Transforms/InstCombine/expensive-combines.ll
@@ -16,7 +16,7 @@
;
; EXPENSIVE-OFF-LABEL: @test(
; EXPENSIVE-OFF-NEXT: [[CALL:%.*]] = call i32 @passthru(i32 0)
-; EXPENSIVE-OFF-NEXT: call void @sink(i32 0)
+; EXPENSIVE-OFF-NEXT: call void @sink(i32 [[CALL]])
; EXPENSIVE-OFF-NEXT: ret void
;
%call = call i32 @passthru(i32 0)
Index: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
===================================================================
--- llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -3568,7 +3568,8 @@
ProfileSummaryInfo *PSI, bool ExpensiveCombines, unsigned MaxIterations,
LoopInfo *LI) {
auto &DL = F.getParent()->getDataLayout();
- ExpensiveCombines |= EnableExpensiveCombines;
+ if (EnableExpensiveCombines.getNumOccurrences())
+ ExpensiveCombines = EnableExpensiveCombines;
MaxIterations = std::min(MaxIterations, LimitMaxIterations.getValue());
/// Builder - This is an IRBuilder that automatically inserts new
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72861.238793.patch
Type: text/x-patch
Size: 1265 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200117/4e8b7c03/attachment.bin>
More information about the llvm-commits
mailing list