Skip to content

Commit f51b799

Browse files
committed
[GlobalISel] Precommit a ptradd combine test.
1 parent 233fb98 commit f51b799

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-ptradd-chain.mir

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,37 @@ body: |
106106
RET_ReallyLR implicit $x0
107107
...
108108
---
109+
name: ptradd_would_form_illegal_load_addressing_wrong_orig_immed
110+
tracksRegLiveness: true
111+
body: |
112+
bb.1:
113+
liveins: $x0
114+
115+
; CHECK-LABEL: name: ptradd_would_form_illegal_load_addressing_wrong_orig_immed
116+
; CHECK: liveins: $x0
117+
; CHECK-NEXT: {{ $}}
118+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
119+
; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1600136
120+
; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s64)
121+
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1600144
122+
; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C1]](s64)
123+
; CHECK-NEXT: %ld:_(s64) = G_LOAD [[PTR_ADD1]](p0) :: (load (s64))
124+
; CHECK-NEXT: %ld_other:_(s64) = G_LOAD [[PTR_ADD]](p0) :: (load (s64))
125+
; CHECK-NEXT: $x0 = COPY %ld(s64)
126+
; CHECK-NEXT: $x1 = COPY %ld_other(s64)
127+
; CHECK-NEXT: RET_ReallyLR implicit $x0
128+
%0:_(p0) = COPY $x0
129+
%1:_(s64) = G_CONSTANT i64 1600136
130+
%2:_(s64) = G_CONSTANT i64 8
131+
%3:_(p0) = G_PTR_ADD %0(p0), %1
132+
%4:_(p0) = G_PTR_ADD %3(p0), %2
133+
%ld:_(s64) = G_LOAD %4(p0) :: (load 8)
134+
%ld_other:_(s64) = G_LOAD %3(p0) :: (load 8)
135+
$x0 = COPY %ld(s64)
136+
$x1 = COPY %ld_other(s64)
137+
RET_ReallyLR implicit $x0
138+
...
139+
---
109140
# PR58906
110141
name: ptradd_constant_type_mismatch
111142
tracksRegLiveness: true

0 commit comments

Comments
 (0)