misched: Analysis that partitions the DAG into subtrees.
[oota-llvm.git] / test / CodeGen / X86 / misched-new.ll
1 ; RUN: llc < %s -march=x86-64 -mcpu=core2 -x86-early-ifcvt -enable-misched \
2 ; RUN:          -misched=shuffle -misched-bottomup -verify-machineinstrs \
3 ; RUN:     | FileCheck %s
4 ; REQUIRES: asserts
5 ;
6 ; Interesting MachineScheduler cases.
7 ;
8 ; FIXME: There should be an assert in the coalescer that we're not rematting
9 ; "not-quite-dead" copies, but that breaks a lot of tests <rdar://problem/11148682>.
10
11 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
12
13 ; From oggenc.
14 ; After coalescing, we have a dead superreg (RAX) definition.
15 ;
16 ; CHECK: xorl %esi, %esi
17 ; CHECK: movl $32, %ecx
18 ; CHECK: rep;movsl
19 define fastcc void @_preextrapolate_helper() nounwind uwtable ssp {
20 entry:
21   br i1 undef, label %for.cond.preheader, label %if.end
22
23 for.cond.preheader:                               ; preds = %entry
24   call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* null, i64 128, i32 4, i1 false) nounwind
25   unreachable
26
27 if.end:                                           ; preds = %entry
28   ret void
29 }
30
31 ; The machine verifier checks that EFLAGS kill flags are updated when
32 ; the scheduler reorders cmovel instructions.
33 ;
34 ; CHECK: test
35 ; CHECK: cmovel
36 ; CHECK: cmovel
37 ; CHECK: call
38 define void @foo(i32 %b) nounwind uwtable ssp {
39 entry:
40   %tobool = icmp ne i32 %b, 0
41   br i1 %tobool, label %if.then, label %if.end
42
43 if.then:                                          ; preds = %entry
44   br label %if.end
45
46 if.end:                                           ; preds = %if.then, %entry
47   %v1 = phi i32 [1, %entry], [2, %if.then]
48   %v2 = phi i32 [3, %entry], [4, %if.then]
49   call void @bar(i32 %v1, i32 %v2)
50   ret void
51 }
52
53 declare void @bar(i32,i32)