1 ; RUN: llc -mcpu=cyclone -debug-only=machine-scheduler < %s 2>&1 | FileCheck %s --check-prefixes=COMMON,SDAG
2 ; RUN: llc -mcpu=cyclone -global-isel -debug-only=machine-scheduler < %s 2>&1 | FileCheck %s --check-prefixes=COMMON,GISEL
6 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 target triple = "arm64-apple-ios7.0.0"
9 define void @caller2(i8* %a0, i8* %a1, i8* %a2, i8* %a3, i8* %a4, i8* %a5, i8* %a6, i8* %a7, i8* %a8, i8* %a9) {
11 tail call void @callee2(i8* %a1, i8* %a2, i8* %a3, i8* %a4, i8* %a5, i8* %a6, i8* %a7, i8* %a8, i8* %a9, i8* %a0)
15 declare void @callee2(i8*, i8*, i8*, i8*, i8*,
16 i8*, i8*, i8*, i8*, i8*)
18 ; Make sure there is a dependence between the load and store to the same stack
19 ; location during a tail call. Tail calls clobber the incoming argument area and
20 ; therefore it is not safe to assume argument locations are invariant.
21 ; PR23459 has a test case that we where miscompiling because of this at the
24 ; COMMON: Frame Objects
25 ; COMMON: fi#-4: {{.*}} fixed, at location [SP+8]
26 ; COMMON: fi#-3: {{.*}} fixed, at location [SP]
27 ; COMMON: fi#-2: {{.*}} fixed, at location [SP+8]
28 ; COMMON: fi#-1: {{.*}} fixed, at location [SP]
30 ; The order that these appear in differes in GISel than SDAG, but the
31 ; dependency relationship still holds.
32 ; COMMON: [[VRA:%.*]]:gpr64 = LDRXui %fixed-stack.3
33 ; COMMON: [[VRB:%.*]]:gpr64 = LDRXui %fixed-stack.2
34 ; SDAG: STRXui %{{.*}}, %fixed-stack.0
35 ; SDAG: STRXui [[VRB]]{{[^,]*}}, %fixed-stack.1
36 ; GISEL: STRXui [[VRB]]{{[^,]*}}, %fixed-stack.1
37 ; GISEL: STRXui %{{.*}}, %fixed-stack.0
39 ; Make sure that there is an dependence edge between fi#-2 and fi#-4.
40 ; Without this edge the scheduler would be free to move the store accross the load.
42 ; COMMON: SU({{.*}}): [[VRB]]:gpr64 = LDRXui %fixed-stack.2
45 ; COMMON: SU([[DEPSTOREB:.*]]): Ord Latency=0
46 ; COMMON: SU([[DEPSTOREA:.*]]): Ord Latency=0
48 ; GlobalISel outputs DEPSTOREB before DEPSTOREA, but the dependency relationship
50 ; SDAG: SU([[DEPSTOREA]]): STRXui %{{.*}}, %fixed-stack.0
51 ; SDAG: SU([[DEPSTOREB]]): STRXui %{{.*}}, %fixed-stack.1
53 ; GISEL: SU([[DEPSTOREB]]): STRXui %{{.*}}, %fixed-stack.0
54 ; GISEL: SU([[DEPSTOREA]]): STRXui %{{.*}}, %fixed-stack.1