Skip to content

Commit 9e4419d

Browse files
author
Andrew Kaylor
committed
Include SelectionDAGISel in the opt-bisect process
Differential Revision: http://reviews.llvm.org/D21143 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274786 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 28925b5 commit 9e4419d

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
443443
TM.resetTargetOptions(Fn);
444444
// Reset OptLevel to None for optnone functions.
445445
CodeGenOpt::Level NewOptLevel = OptLevel;
446-
if (Fn.hasFnAttribute(Attribute::OptimizeNone))
446+
if (OptLevel != CodeGenOpt::None && skipFunction(Fn))
447447
NewOptLevel = CodeGenOpt::None;
448448
OptLevelChanger OLC(*this, NewOptLevel);
449449

test/Other/X86/opt-bisect-isel.ll

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
; This test verifies that no optimizations are performed on the @f function
2+
; when the -opt-bisect-limit=0 option is used. In particular, the X86
3+
; instruction selector will optimize the cmp instruction to a sub instruction
4+
; if it is not run in -O0 mode.
5+
6+
; RUN: llc -O3 -opt-bisect-limit=0 -o - %s | FileCheck %s
7+
8+
target triple = "x86_64-unknown-linux-gnu"
9+
10+
define void @f() {
11+
entry:
12+
%cmp = icmp slt i32 undef, 8
13+
br i1 %cmp, label %middle, label %end
14+
15+
middle:
16+
br label %end
17+
18+
end:
19+
ret void
20+
}
21+
22+
; CHECK: cmpl $8, %eax

0 commit comments

Comments
 (0)