File: tailcall_misched_graph.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (54 lines) | stat: -rw-r--r-- 2,338 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
; RUN: llc -mcpu=cyclone -debug-only=machine-scheduler < %s 2>&1 | FileCheck %s --check-prefixes=COMMON,SDAG
; RUN: llc -mcpu=cyclone -global-isel -debug-only=machine-scheduler < %s 2>&1 | FileCheck %s --check-prefixes=COMMON,GISEL

; REQUIRES: asserts

target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios7.0.0"

define void @caller2(ptr %a0, ptr %a1, ptr %a2, ptr %a3, ptr %a4, ptr %a5, ptr %a6, ptr %a7, ptr %a8, ptr %a9) {
entry:
  tail call void @callee2(ptr %a1, ptr %a2, ptr %a3, ptr %a4, ptr %a5, ptr %a6, ptr %a7, ptr %a8, ptr %a9, ptr %a0)
  ret void
}

declare void @callee2(ptr, ptr, ptr, ptr, ptr,
                      ptr, ptr, ptr, ptr, ptr)

; Make sure there is a dependence between the load and store to the same stack
; location during a tail call. Tail calls clobber the incoming argument area and
; therefore it is not safe to assume argument locations are invariant.
; PR23459 has a test case that we where miscompiling because of this at the
; time.

; COMMON: Frame Objects
; COMMON:  fi#-4: {{.*}} fixed, at location [SP+8]
; COMMON:  fi#-3: {{.*}} fixed, at location [SP]
; COMMON:  fi#-2: {{.*}} fixed, at location [SP+8]
; COMMON:  fi#-1: {{.*}} fixed, at location [SP]

; The order that these appear in differes in GISel than SDAG, but the
; dependency relationship still holds.
; COMMON:  [[VRA:%.*]]:gpr64 = LDRXui %fixed-stack.3
; COMMON:  [[VRB:%.*]]:gpr64 = LDRXui %fixed-stack.2
; SDAG:  STRXui %{{.*}}, %fixed-stack.0
; SDAG:  STRXui [[VRB]]{{[^,]*}}, %fixed-stack.1
; GISEL:  STRXui [[VRB]]{{[^,]*}}, %fixed-stack.1
; GISEL:  STRXui %{{.*}}, %fixed-stack.0

; Make sure that there is an dependence edge between fi#-2 and fi#-4.
; Without this edge the scheduler would be free to move the store accross the load.

; COMMON: {{^SU(.*)}}:   [[VRB]]:gpr64 = LDRXui %fixed-stack.2
; COMMON-NOT: {{^SU(.*)}}:
; COMMON:  Successors:
; COMMON:   SU([[DEPSTOREB:.*]]): Ord  Latency=0
; COMMON:   SU([[DEPSTOREA:.*]]): Ord  Latency=0

; GlobalISel outputs DEPSTOREB before DEPSTOREA, but the dependency relationship
; still holds.
; SDAG: SU([[DEPSTOREA]]):   STRXui %{{.*}}, %fixed-stack.0
; SDAG: SU([[DEPSTOREB]]):   STRXui %{{.*}}, %fixed-stack.1

; GISEL: SU([[DEPSTOREB]]):   STRXui %{{.*}}, %fixed-stack.0
; GISEL: SU([[DEPSTOREA]]):   STRXui %{{.*}}, %fixed-stack.1