diff options
Diffstat (limited to 'llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-reg.ll')
-rw-r--r-- | llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-reg.ll | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-reg.ll b/llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-reg.ll index 05abfa3..29e94dd6 100644 --- a/llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-reg.ll +++ b/llvm/test/CodeGen/AArch64/sve-ld1-addressing-mode-reg-reg.ll @@ -268,6 +268,20 @@ define <vscale x 2 x bfloat> @ld1_nxv2bf16(ptr %addr, i64 %off) { ret <vscale x 2 x bfloat> %val } +; Ensure we don't lose the free shift when using indexed addressing. +define <vscale x 2 x bfloat> @ld1_nxv2bf16_double_shift(ptr %addr, i64 %off) { +; CHECK-LABEL: ld1_nxv2bf16_double_shift: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.d +; CHECK-NEXT: lsr x8, x1, #6 +; CHECK-NEXT: ld1h { z0.d }, p0/z, [x0, x8, lsl #1] +; CHECK-NEXT: ret + %off2 = lshr i64 %off, 6 + %ptr = getelementptr inbounds bfloat, ptr %addr, i64 %off2 + %val = load volatile <vscale x 2 x bfloat>, ptr %ptr + ret <vscale x 2 x bfloat> %val +} + ; LD1W define <vscale x 4 x i32> @ld1_nxv4i32(ptr %addr, i64 %off) { @@ -327,6 +341,20 @@ define <vscale x 2 x float> @ld1_nxv2f32(ptr %addr, i64 %off) { ret <vscale x 2 x float> %val } +; Ensure we don't lose the free shift when using indexed addressing. +define <vscale x 2 x float> @ld1_nxv2f32_double_shift(ptr %addr, i64 %off) { +; CHECK-LABEL: ld1_nxv2f32_double_shift: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.d +; CHECK-NEXT: lsr x8, x1, #6 +; CHECK-NEXT: ld1w { z0.d }, p0/z, [x0, x8, lsl #2] +; CHECK-NEXT: ret + %off2 = lshr i64 %off, 6 + %ptr = getelementptr inbounds float, ptr %addr, i64 %off2 + %val = load volatile <vscale x 2 x float>, ptr %ptr + ret <vscale x 2 x float> %val +} + ; LD1D define <vscale x 2 x i64> @ld1_nxv2i64(ptr %addr, i64 %off) { @@ -350,3 +378,17 @@ define <vscale x 2 x double> @ld1_nxv2f64(ptr %addr, i64 %off) { %val = load volatile <vscale x 2 x double>, ptr %ptr ret <vscale x 2 x double> %val } + +; Ensure we don't lose the free shift when using indexed addressing. +define <vscale x 2 x double> @ld1_nxv2f64_double_shift(ptr %addr, i64 %off) { +; CHECK-LABEL: ld1_nxv2f64_double_shift: +; CHECK: // %bb.0: +; CHECK-NEXT: ptrue p0.d +; CHECK-NEXT: lsr x8, x1, #6 +; CHECK-NEXT: ld1d { z0.d }, p0/z, [x0, x8, lsl #3] +; CHECK-NEXT: ret + %off2 = lshr i64 %off, 6 + %ptr = getelementptr inbounds double, ptr %addr, i64 %off2 + %val = load volatile <vscale x 2 x double>, ptr %ptr + ret <vscale x 2 x double> %val +} |