Skip to content

Commit a187e3b

Browse files
committed
[AArch64] Add PreTest for optimizing MOV to STP
1 parent 1d03a1b commit a187e3b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

llvm/test/CodeGen/AArch64/movimm-expand-ldst.mir

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,43 @@ body: |
3131
; CHECK-NEXT: RET undef $lr, implicit $x0
3232
renamable $x0 = MOVi64imm -4550323095879417536
3333
RET_ReallyLR implicit $x0
34+
...
35+
---
36+
name: test_fold_repeating_constant_load_store_twice
37+
tracksRegLiveness: true
38+
body: |
39+
bb.0:
40+
liveins: $x0, $x1
41+
; CHECK-LABEL: name: test_fold_repeating_constant_load_store_twice
42+
; CHECK: liveins: $x0, $x1
43+
; CHECK-NEXT: {{ $}}
44+
; CHECK-NEXT: renamable $x8 = MOVZXi 49370, 0
45+
; CHECK-NEXT: renamable $x8 = MOVKXi $x8, 320, 16
46+
; CHECK-NEXT: renamable $x8 = ORRXrs $x8, $x8, 32
47+
; CHECK-NEXT: STRXui renamable $x8, killed renamable $x0, 0
48+
; CHECK-NEXT: STRXui killed renamable $x8, killed renamable $x1, 0
49+
; CHECK-NEXT: RET undef $lr
50+
renamable $x8 = MOVi64imm 90284035103834330
51+
STRXui renamable $x8, killed renamable $x0, 0
52+
STRXui killed renamable $x8, killed renamable $x1, 0
53+
RET_ReallyLR
54+
...
55+
---
56+
name: test_fold_repeating_constant_load_use_reg_before_store
57+
tracksRegLiveness: true
58+
body: |
59+
bb.0:
60+
liveins: $x0
61+
; CHECK-LABEL: name: test_fold_repeating_constant_load_use_reg_before_store
62+
; CHECK: liveins: $x0
63+
; CHECK-NEXT: {{ $}}
64+
; CHECK-NEXT: renamable $x8 = MOVZXi 49370, 0
65+
; CHECK-NEXT: renamable $x8 = MOVKXi $x8, 320, 16
66+
; CHECK-NEXT: renamable $x8 = ORRXrs $x8, $x8, 32
67+
; CHECK-NEXT: renamable $x9 = ADDXrs renamable $x8, renamable $x8, 32
68+
; CHECK-NEXT: STRXui renamable $x8, killed renamable $x0, 0
69+
; CHECK-NEXT: RET undef $lr
70+
renamable $x8 = MOVi64imm 90284035103834330
71+
renamable $x9 = ADDXrs renamable $x8, renamable $x8, 32
72+
STRXui renamable $x8, killed renamable $x0, 0
73+
RET_ReallyLR

0 commit comments

Comments
 (0)