Skip to content

Commit 16bb253

Browse files
committed
[AArch64] Add PreTest for optimizing MOV to ORR
1 parent b5b34db commit 16bb253

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2+
# RUN: llc -mtriple=aarch64 -verify-machineinstrs -run-pass=aarch64-expand-pseudo -run-pass=aarch64-ldst-opt -debug-only=aarch64-ldst-opt %s -o - | FileCheck %s
3+
---
4+
name: test_fold_repeating_constant_load
5+
tracksRegLiveness: true
6+
body: |
7+
bb.0:
8+
liveins: $x0
9+
; CHECK-LABEL: name: test_fold_repeating_constant_load
10+
; CHECK: liveins: $x0
11+
; CHECK-NEXT: {{ $}}
12+
; CHECK-NEXT: renamable $x0 = MOVZXi 49370, 0
13+
; CHECK-NEXT: renamable $x0 = MOVKXi $x0, 320, 16
14+
; CHECK-NEXT: renamable $x0 = MOVKXi $x0, 49370, 32
15+
; CHECK-NEXT: renamable $x0 = MOVKXi $x0, 320, 48
16+
; CHECK-NEXT: RET undef $lr, implicit $x0
17+
renamable $x0 = MOVi64imm 90284035103834330
18+
RET_ReallyLR implicit $x0
19+
...
20+
---
21+
name: test_fold_repeating_constant_load_neg
22+
tracksRegLiveness: true
23+
body: |
24+
bb.0:
25+
liveins: $x0
26+
; CHECK-LABEL: name: test_fold_repeating_constant_load_neg
27+
; CHECK: liveins: $x0
28+
; CHECK-NEXT: {{ $}}
29+
; CHECK-NEXT: renamable $x0 = MOVZXi 320, 0
30+
; CHECK-NEXT: renamable $x0 = MOVKXi $x0, 49370, 16
31+
; CHECK-NEXT: renamable $x0 = MOVKXi $x0, 320, 32
32+
; CHECK-NEXT: renamable $x0 = MOVKXi $x0, 49370, 48
33+
; CHECK-NEXT: RET undef $lr, implicit $x0
34+
renamable $x0 = MOVi64imm -4550323095879417536
35+
RET_ReallyLR implicit $x0

0 commit comments

Comments
 (0)