1 # RUN: llc -mtriple=aarch64-apple-ios -run-pass=simple-register-coalescing %s -o - | FileCheck %s
3 define void @func() { ret void }
6 # Check coalescing of COPYs from reserved physregs.
7 # CHECK-LABEL: name: func
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 }
19 ; We usually should not coalesce copies from allocatable physregs.
20 ; CHECK: %0 = COPY %w7
21 ; CHECK: STRWui %0, %x1, 0
25 ; It is fine to coalesce copies from reserved physregs
27 ; CHECK: STRXui %fp, %x1, 0
31 ; It is not fine to coalesce copies from reserved physregs when they are
33 ; CHECK: %2 = COPY %fp
34 ; CHECK: STRXui %2, %x1, 0
36 %fp = SUBXri %fp, 4, 0
39 ; Is is fine to coalesce copies from constant physregs even when they are
42 ; CHECK: STRWui %wzr, %x1
44 dead %wzr = SUBSWri %w1, 0, 0, implicit-def %nzcv
47 ; Is is fine to coalesce copies from constant physregs even when they are
50 ; CHECK: STRXui %xzr, %x1
52 dead %wzr = SUBSWri %w1, 0, 0, implicit-def %nzcv
55 ; Coalescing COPYs into constant physregs.
56 ; CHECK: %wzr = SUBSWri %w1, 0, 0
57 %5 = SUBSWri %w1, 0, 0, implicit-def %nzcv
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