xref: /llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/store-wro-addressing-modes.mir (revision fae05692a36f9ebbd201d93c2a6b0f927564d7e6)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3---
4name:            strwrow
5alignment:       4
6legalized:       true
7regBankSelected: true
8tracksRegLiveness: true
9machineFunctionInfo: {}
10body:             |
11  bb.0:
12    liveins: $x0, $x1, $w2
13    ; CHECK-LABEL: name: strwrow
14    ; CHECK: liveins: $x0, $x1, $w2
15    ; CHECK: %base:gpr64sp = COPY $x0
16    ; CHECK: %foo:gpr32 = COPY $w1
17    ; CHECK: %dst:gpr32 = COPY $w2
18    ; CHECK: STRWroW %dst, %base, %foo, 1, 1 :: (store (s32))
19    %base:gpr(p0) = COPY $x0
20    %foo:gpr(s32) = COPY $w1
21    %ext:gpr(s64) = G_SEXT %foo(s32)
22    %c:gpr(s64) = G_CONSTANT i64 2
23    %offset:gpr(s64) = G_SHL %ext, %c
24    %ptr:gpr(p0) = G_PTR_ADD %base, %offset(s64)
25    %dst:gpr(s32) = COPY $w2
26    G_STORE %dst, %ptr :: (store (s32))
27...
28---
29name:            strxrow
30alignment:       4
31legalized:       true
32regBankSelected: true
33tracksRegLiveness: true
34machineFunctionInfo: {}
35body:             |
36  bb.0:
37    liveins: $x0, $x1, $x2
38    ; CHECK-LABEL: name: strxrow
39    ; CHECK: liveins: $x0, $x1, $x2
40    ; CHECK: %base:gpr64sp = COPY $x0
41    ; CHECK: %foo:gpr32 = COPY $w1
42    ; CHECK: %dst:gpr64 = COPY $x2
43    ; CHECK: STRXroW %dst, %base, %foo, 1, 1 :: (store (s64))
44    %base:gpr(p0) = COPY $x0
45    %foo:gpr(s32) = COPY $w1
46    %ext:gpr(s64) = G_SEXT %foo(s32)
47    %c:gpr(s64) = G_CONSTANT i64 3
48    %offset:gpr(s64) = G_SHL %ext, %c
49    %ptr:gpr(p0) = G_PTR_ADD %base, %offset(s64)
50    %dst:gpr(s64) = COPY $x2
51    G_STORE %dst, %ptr :: (store (s64))
52...
53---
54name:            strxrow_p0
55alignment:       4
56legalized:       true
57regBankSelected: true
58tracksRegLiveness: true
59machineFunctionInfo: {}
60body:             |
61  bb.0:
62    liveins: $x0, $x1, $x2
63    ; CHECK-LABEL: name: strxrow_p0
64    ; CHECK: liveins: $x0, $x1, $x2
65    ; CHECK: %base:gpr64sp = COPY $x0
66    ; CHECK: %foo:gpr32 = COPY $w1
67    ; CHECK: %dst:gpr64all = COPY $x2
68    ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY %dst
69    ; CHECK: STRXroW [[COPY]], %base, %foo, 1, 1 :: (store (p0))
70    %base:gpr(p0) = COPY $x0
71    %foo:gpr(s32) = COPY $w1
72    %ext:gpr(s64) = G_SEXT %foo(s32)
73    %c:gpr(s64) = G_CONSTANT i64 3
74    %offset:gpr(s64) = G_SHL %ext, %c
75    %ptr:gpr(p0) = G_PTR_ADD %base, %offset(s64)
76    %dst:gpr(p0) = COPY $x2
77    G_STORE %dst, %ptr :: (store (p0))
78...
79