[llvm] [AArch64][GlobalISel] Mark LD1R as not accepting immediate operand (PR #69003)
Vladislav Dzhidzhoev via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 17 05:51:31 PDT 2023
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/69003
>From 35d1b8147375fb95b01422320c2eae930c2bc659 Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Fri, 13 Oct 2023 17:38:24 +0200
Subject: [PATCH 1/2] [AArch64][GlobalISel] Mark LD1R as not accepting
immediate operand
This is to fix https://github.com/llvm/llvm-project/pull/66914#issuecomment-1729480020 for https://github.com/llvm/llvm-project/pull/66914.
---
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index e03a94de007c9f5..186a703975c6f97 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -5581,6 +5581,14 @@ int llvm::isAArch64FrameOffsetLegal(const MachineInstr &MI,
switch (MI.getOpcode()) {
default:
break;
+ case AArch64::LD1Rv1d:
+ case AArch64::LD1Rv2s:
+ case AArch64::LD1Rv2d:
+ case AArch64::LD1Rv4h:
+ case AArch64::LD1Rv4s:
+ case AArch64::LD1Rv8b:
+ case AArch64::LD1Rv8h:
+ case AArch64::LD1Rv16b:
case AArch64::LD1Twov2d:
case AArch64::LD1Threev2d:
case AArch64::LD1Fourv2d:
>From 5510b9009b16d0eda9bb10f69f464c961a17c9fb Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Tue, 17 Oct 2023 14:51:07 +0200
Subject: [PATCH 2/2] Added test
---
llvm/test/CodeGen/AArch64/arm64-ld1.ll | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/llvm/test/CodeGen/AArch64/arm64-ld1.ll b/llvm/test/CodeGen/AArch64/arm64-ld1.ll
index 96468b2cfa8ace8..eb25c61b1e2ac46 100644
--- a/llvm/test/CodeGen/AArch64/arm64-ld1.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-ld1.ll
@@ -1712,3 +1712,20 @@ define %struct.__neon_float64x2x4_t @ld1_x4_v2f64(ptr %addr) {
%val = call %struct.__neon_float64x2x4_t @llvm.aarch64.neon.ld1x4.v2f64.p0(ptr %addr)
ret %struct.__neon_float64x2x4_t %val
}
+
+define <8 x i8> @dup_ld1_from_stack(ptr %__ret) {
+; CHECK-LABEL: dup_ld1_from_stack:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: sub sp, sp, #16
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: add x8, sp, #15
+; CHECK-NEXT: ld1r.8b { v0 }, [x8]
+; CHECK-NEXT: add sp, sp, #16
+; CHECK-NEXT: ret
+entry:
+ %item = alloca i8, align 1
+ %0 = load i8, ptr %item, align 1
+ %1 = insertelement <8 x i8> poison, i8 %0, i32 0
+ %lane = shufflevector <8 x i8> %1, <8 x i8> %1, <8 x i32> zeroinitializer
+ ret <8 x i8> %lane
+}
More information about the llvm-commits
mailing list