[llvm] r274786 - Include SelectionDAGISel in the opt-bisect process
Andrew Kaylor via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 7 11:55:03 PDT 2016
Author: akaylor
Date: Thu Jul 7 13:55:02 2016
New Revision: 274786
URL: http://llvm.org/viewvc/llvm-project?rev=274786&view=rev
Log:
Include SelectionDAGISel in the opt-bisect process
Differential Revision: http://reviews.llvm.org/D21143
Added:
llvm/trunk/test/Other/X86/opt-bisect-isel.ll
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=274786&r1=274785&r2=274786&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Thu Jul 7 13:55:02 2016
@@ -443,7 +443,7 @@ bool SelectionDAGISel::runOnMachineFunct
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);
Added: llvm/trunk/test/Other/X86/opt-bisect-isel.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/X86/opt-bisect-isel.ll?rev=274786&view=auto
==============================================================================
--- llvm/trunk/test/Other/X86/opt-bisect-isel.ll (added)
+++ llvm/trunk/test/Other/X86/opt-bisect-isel.ll Thu Jul 7 13:55:02 2016
@@ -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
More information about the llvm-commits
mailing list