[PATCH] D21143: Include SelectionDAGISel in the opt-bisect process
Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 7 12:02:15 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL274786: Include SelectionDAGISel in the opt-bisect process (authored by akaylor).
Changed prior to commit:
http://reviews.llvm.org/D21143?vs=63007&id=63114#toc
Repository:
rL LLVM
http://reviews.llvm.org/D21143
Files:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/trunk/test/Other/X86/opt-bisect-isel.ll
Index: llvm/trunk/test/Other/X86/opt-bisect-isel.ll
===================================================================
--- llvm/trunk/test/Other/X86/opt-bisect-isel.ll
+++ llvm/trunk/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
Index: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -443,7 +443,7 @@
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21143.63114.patch
Type: text/x-patch
Size: 1375 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160707/0d3719a5/attachment.bin>
More information about the llvm-commits
mailing list