llvm/test/CodeGen/X86/pr14088.ll
Andrew Trick 6a7770b7ae Enable MI Sched for x86.
This changes the SelectionDAG scheduling preference to source
order. Soon, the SelectionDAG scheduler can be bypassed saving
a nice chunk of compile time.

Performance differences that result from this change are often a
consequence of register coalescing. The register coalescer is far from
perfect. Bugs can be filed for deficiencies.

On x86 SandyBridge/Haswell, the source order schedule is often
preserved, particularly for small blocks.

Register pressure is generally improved over the SD scheduler's ILP
mode. However, we are still able to handle large blocks that require
latency hiding, unlike the SD scheduler's BURR mode. MI scheduler also
attempts to discover the critical path in single-block loops and
adjust heuristics accordingly.

The MI scheduler relies on the new machine model. This is currently
unimplemented for AVX, so we may not be generating the best code yet.

Unit tests are updated so they don't depend on SD scheduling heuristics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192750 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-15 23:33:07 +00:00

33 lines
884 B
LLVM

; RUN: llc -mtriple x86_64-linux -mcpu core2 -verify-machineinstrs %s -o - | FileCheck %s
define i32 @f(i1 %foo, i16* %tm_year2, i8* %bar, i16 %zed, i32 %zed2) {
entry:
br i1 %foo, label %return, label %if.end
if.end:
%rem = srem i32 %zed2, 100
%conv3 = trunc i32 %rem to i16
store i16 %conv3, i16* %tm_year2
%sext = shl i32 %rem, 16
%conv5 = ashr exact i32 %sext, 16
%div = sdiv i32 %conv5, 10
%conv6 = trunc i32 %div to i8
store i8 %conv6, i8* %bar
br label %return
return:
%retval.0 = phi i32 [ 0, %if.end ], [ -1, %entry ]
ret i32 %retval.0
}
; We were miscompiling this and using %ax instead of %cx in the movw
; in the following sequence:
; movswl %cx, %ecx
; movw %cx, (%rsi)
; movslq %ecx, %rcx
;
; We can't produce the above sequence without special SD-level
; heuristics. Now we produce this:
; CHECK: movw %ax, (%rsi)
; CHECK: cwtl
; CHECK: cltq