]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/AArch64/regcoal-physreg.mir
Vendor import of llvm release_40 branch r293443:
[FreeBSD/FreeBSD.git] / test / CodeGen / AArch64 / regcoal-physreg.mir
1 # RUN: llc -mtriple=aarch64-apple-ios -run-pass=simple-register-coalescing %s -o - | FileCheck %s
2 --- |
3   define void @func() { ret void }
4 ...
5 ---
6 # Check coalescing of COPYs from reserved physregs.
7 # CHECK-LABEL: name: func
8 name: func
9 registers:
10   - { id: 0, class: gpr32 }
11   - { id: 1, class: gpr64 }
12   - { id: 2, class: gpr64 }
13   - { id: 3, class: gpr32 }
14   - { id: 4, class: gpr64 }
15   - { id: 5, class: gpr32 }
16   - { id: 6, class: xseqpairsclass }
17 body: |
18   bb.0:
19     ; We usually should not coalesce copies from allocatable physregs.
20     ; CHECK: %0 = COPY %w7
21     ; CHECK: STRWui %0, %x1, 0
22     %0 = COPY %w7
23     STRWui %0, %x1, 0
24
25     ; It is fine to coalesce copies from reserved physregs
26     ; CHECK-NOT: COPY
27     ; CHECK: STRXui %fp, %x1, 0
28     %1 = COPY %fp
29     STRXui %1, %x1, 0
30
31     ; It is not fine to coalesce copies from reserved physregs when they are
32     ; clobbered.
33     ; CHECK: %2 = COPY %fp
34     ; CHECK: STRXui %2, %x1, 0
35     %2 = COPY %fp
36     %fp = SUBXri %fp, 4, 0
37     STRXui %2, %x1, 0
38
39     ; Is is fine to coalesce copies from constant physregs even when they are
40     ; clobbered.
41     ; CHECK-NOT: COPY
42     ; CHECK: STRWui %wzr, %x1
43     %3 = COPY %wzr
44     dead %wzr = SUBSWri %w1, 0, 0, implicit-def %nzcv
45     STRWui %3, %x1, 0
46
47     ; Is is fine to coalesce copies from constant physregs even when they are
48     ; clobbered.
49     ; CHECK-NOT: COPY
50     ; CHECK: STRXui %xzr, %x1
51     %4 = COPY %xzr
52     dead %wzr = SUBSWri %w1, 0, 0, implicit-def %nzcv
53     STRXui %4, %x1, 0
54
55     ; Coalescing COPYs into constant physregs.
56     ; CHECK: %wzr = SUBSWri %w1, 0, 0
57     %5 = SUBSWri %w1, 0, 0, implicit-def %nzcv
58     %wzr = COPY %5
59
60     ; Only coalesce when the source register is reserved as a whole (this is
61     ; a limitation of the current code which cannot update liveness information
62     ; of the non-reserved part).
63     ; CHECK: %6 = COPY %xzr_x0
64     ; CHECK: HINT 0, implicit %6
65     %6 = COPY %xzr_x0
66     HINT 0, implicit %6
67 ...