55 lines · plain
1; RUN: llc -mcpu=cyclone -debug-only=machine-scheduler < %s 2>&1 | FileCheck %s --check-prefixes=COMMON,SDAG2; RUN: llc -mcpu=cyclone -global-isel -debug-only=machine-scheduler < %s 2>&1 | FileCheck %s --check-prefixes=COMMON,GISEL3 4; REQUIRES: asserts5 6target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"7target triple = "arm64-apple-ios7.0.0"8 9define void @caller2(ptr %a0, ptr %a1, ptr %a2, ptr %a3, ptr %a4, ptr %a5, ptr %a6, ptr %a7, ptr %a8, ptr %a9) {10entry:11 tail call void @callee2(ptr %a1, ptr %a2, ptr %a3, ptr %a4, ptr %a5, ptr %a6, ptr %a7, ptr %a8, ptr %a9, ptr %a0)12 ret void13}14 15declare void @callee2(ptr, ptr, ptr, ptr, ptr,16 ptr, ptr, ptr, ptr, ptr)17 18; Make sure there is a dependence between the load and store to the same stack19; location during a tail call. Tail calls clobber the incoming argument area and20; 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 the22; time.23 24; COMMON: Frame Objects25; 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]29 30; The order that these appear in differes in GISel than SDAG, but the31; dependency relationship still holds.32; COMMON: [[VRA:%.*]]:gpr64 = LDRXui %fixed-stack.333; COMMON: [[VRB:%.*]]:gpr64 = LDRXui %fixed-stack.234; SDAG: STRXui %{{.*}}, %fixed-stack.035; SDAG: STRXui [[VRB]]{{[^,]*}}, %fixed-stack.136; GISEL: STRXui [[VRB]]{{[^,]*}}, %fixed-stack.137; GISEL: STRXui %{{.*}}, %fixed-stack.038 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.41 42; COMMON: {{^SU(.*)}}: [[VRB]]:gpr64 = LDRXui %fixed-stack.243; COMMON-NOT: {{^SU(.*)}}:44; COMMON: Successors:45; COMMON: SU([[DEPSTOREB:.*]]): Ord Latency=046; COMMON: SU([[DEPSTOREA:.*]]): Ord Latency=047 48; GlobalISel outputs DEPSTOREB before DEPSTOREA, but the dependency relationship49; still holds.50; SDAG: SU([[DEPSTOREA]]): STRXui %{{.*}}, %fixed-stack.051; SDAG: SU([[DEPSTOREB]]): STRXui %{{.*}}, %fixed-stack.152 53; GISEL: SU([[DEPSTOREB]]): STRXui %{{.*}}, %fixed-stack.054; GISEL: SU([[DEPSTOREA]]): STRXui %{{.*}}, %fixed-stack.155