summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2016-07-07 18:55:02 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2016-07-07 18:55:02 +0000
commit65fa0704aa8878688f66eccb99fe2eafde314b19 (patch)
tree4c4388ceb28c17e27afec33ba208db68512870a8
parentfb5a24b4f03a715b23428b616df36a209941a8ec (diff)
downloadbcm5719-llvm-65fa0704aa8878688f66eccb99fe2eafde314b19.tar.gz
bcm5719-llvm-65fa0704aa8878688f66eccb99fe2eafde314b19.zip
Include SelectionDAGISel in the opt-bisect process
Differential Revision: http://reviews.llvm.org/D21143 llvm-svn: 274786
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp2
-rw-r--r--llvm/test/Other/X86/opt-bisect-isel.ll22
2 files changed, 23 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 7acab3cd4a8..6594e45e9c7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -443,7 +443,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
TM.resetTargetOptions(Fn);
// Reset OptLevel to None for optnone functions.
CodeGenOpt::Level NewOptLevel = OptLevel;
- if (Fn.hasFnAttribute(Attribute::OptimizeNone))
+ if (OptLevel != CodeGenOpt::None && skipFunction(Fn))
NewOptLevel = CodeGenOpt::None;
OptLevelChanger OLC(*this, NewOptLevel);
diff --git a/llvm/test/Other/X86/opt-bisect-isel.ll b/llvm/test/Other/X86/opt-bisect-isel.ll
new file mode 100644
index 00000000000..78a5f202646
--- /dev/null
+++ b/llvm/test/Other/X86/opt-bisect-isel.ll
@@ -0,0 +1,22 @@
+; This test verifies that no optimizations are performed on the @f function
+; when the -opt-bisect-limit=0 option is used. In particular, the X86
+; instruction selector will optimize the cmp instruction to a sub instruction
+; if it is not run in -O0 mode.
+
+; RUN: llc -O3 -opt-bisect-limit=0 -o - %s | FileCheck %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @f() {
+entry:
+ %cmp = icmp slt i32 undef, 8
+ br i1 %cmp, label %middle, label %end
+
+middle:
+ br label %end
+
+end:
+ ret void
+}
+
+; CHECK: cmpl $8, %eax
OpenPOWER on IntegriCloud