Index: llvm/lib/Target/AArch64/SMEInstrFormats.td =================================================================== --- llvm/lib/Target/AArch64/SMEInstrFormats.td +++ llvm/lib/Target/AArch64/SMEInstrFormats.td @@ -760,12 +760,6 @@ // base def : Pat<(int_aarch64_sme_str MatrixIndexGPR32Op12_15:$idx, GPR64sp:$base), (!cast(NAME) ZA, $idx, 0, $base, 0)>; - // scalar + immediate (mul vl) - let AddedComplexity = 2 in { - def : Pat<(int_aarch64_sme_str MatrixIndexGPR32Op12_15:$idx, - (am_sme_indexed_b4 GPR64sp:$base, imm0_15:$imm4)), - (!cast(NAME) ZA, $idx, 0, $base, $imm4)>; - } } multiclass sme_fill { @@ -785,12 +779,6 @@ // base def : Pat<(int_aarch64_sme_ldr MatrixIndexGPR32Op12_15:$idx, GPR64sp:$base), (!cast(NAME # _PSEUDO) $idx, 0, $base)>; - // scalar + immediate (mul vl) - let AddedComplexity = 2 in { - def : Pat<(int_aarch64_sme_ldr MatrixIndexGPR32Op12_15:$idx, - (am_sme_indexed_b4 GPR64sp:$base, imm0_15:$imm4)), - (!cast(NAME # _PSEUDO) $idx, $imm4, $base)>; - } } //===----------------------------------------------------------------------===// Index: llvm/test/CodeGen/AArch64/sme-intrinsics-loads.ll =================================================================== --- llvm/test/CodeGen/AArch64/sme-intrinsics-loads.ll +++ llvm/test/CodeGen/AArch64/sme-intrinsics-loads.ll @@ -259,39 +259,40 @@ define void @ldr_with_off_15(ptr %ptr) { ; CHECK-LABEL: ldr_with_off_15: ; CHECK: // %bb.0: -; CHECK-NEXT: mov w12, wzr +; CHECK-NEXT: mov w12, #15 // =0xf ; CHECK-NEXT: add x8, x0, #15 ; CHECK-NEXT: ldr za[w12, 0], [x8] ; CHECK-NEXT: ret %base = getelementptr i8, ptr %ptr, i64 15 - call void @llvm.aarch64.sme.ldr(i32 0, ptr %base) + call void @llvm.aarch64.sme.ldr(i32 15, ptr %base) ret void; } define void @ldr_with_off_15mulvl(ptr %ptr) { ; CHECK-LABEL: ldr_with_off_15mulvl: ; CHECK: // %bb.0: -; CHECK-NEXT: mov w12, wzr -; CHECK-NEXT: ldr za[w12, 15], [x0, #15, mul vl] +; CHECK-NEXT: mov w12, #15 // =0xf +; CHECK-NEXT: addvl x8, x0, #15 +; CHECK-NEXT: ldr za[w12, 0], [x8] ; CHECK-NEXT: ret %vscale = call i64 @llvm.vscale.i64() %mulvl = mul i64 %vscale, 240 %base = getelementptr i8, ptr %ptr, i64 %mulvl - call void @llvm.aarch64.sme.ldr(i32 0, ptr %base) + call void @llvm.aarch64.sme.ldr(i32 15, ptr %base) ret void; } define void @ldr_with_off_16mulvl(ptr %ptr) { ; CHECK-LABEL: ldr_with_off_16mulvl: ; CHECK: // %bb.0: -; CHECK-NEXT: mov w12, wzr +; CHECK-NEXT: mov w12, #16 // =0x10 ; CHECK-NEXT: addvl x8, x0, #16 ; CHECK-NEXT: ldr za[w12, 0], [x8] ; CHECK-NEXT: ret %vscale = call i64 @llvm.vscale.i64() %mulvl = mul i64 %vscale, 256 %base = getelementptr i8, ptr %ptr, i64 %mulvl - call void @llvm.aarch64.sme.ldr(i32 0, ptr %base) + call void @llvm.aarch64.sme.ldr(i32 16, ptr %base) ret void; } Index: llvm/test/CodeGen/AArch64/sme-intrinsics-stores.ll =================================================================== --- llvm/test/CodeGen/AArch64/sme-intrinsics-stores.ll +++ llvm/test/CodeGen/AArch64/sme-intrinsics-stores.ll @@ -259,39 +259,40 @@ define void @str_with_off_15(ptr %ptr) { ; CHECK-LABEL: str_with_off_15: ; CHECK: // %bb.0: -; CHECK-NEXT: mov w12, wzr +; CHECK-NEXT: mov w12, #15 // =0xf ; CHECK-NEXT: add x8, x0, #15 ; CHECK-NEXT: str za[w12, 0], [x8] ; CHECK-NEXT: ret %base = getelementptr i8, ptr %ptr, i64 15 - call void @llvm.aarch64.sme.str(i32 0, ptr %base) + call void @llvm.aarch64.sme.str(i32 15, ptr %base) ret void; } define void @str_with_off_15mulvl(ptr %ptr) { ; CHECK-LABEL: str_with_off_15mulvl: ; CHECK: // %bb.0: -; CHECK-NEXT: mov w12, wzr -; CHECK-NEXT: str za[w12, 0], [x0, #15, mul vl] +; CHECK-NEXT: mov w12, #15 // =0xf +; CHECK-NEXT: addvl x8, x0, #15 +; CHECK-NEXT: str za[w12, 0], [x8] ; CHECK-NEXT: ret %vscale = call i64 @llvm.vscale.i64() %mulvl = mul i64 %vscale, 240 %base = getelementptr i8, ptr %ptr, i64 %mulvl - call void @llvm.aarch64.sme.str(i32 0, ptr %base) + call void @llvm.aarch64.sme.str(i32 15, ptr %base) ret void; } define void @str_with_off_16mulvl(ptr %ptr) { ; CHECK-LABEL: str_with_off_16mulvl: ; CHECK: // %bb.0: -; CHECK-NEXT: mov w12, wzr +; CHECK-NEXT: mov w12, #16 // =0x10 ; CHECK-NEXT: addvl x8, x0, #16 ; CHECK-NEXT: str za[w12, 0], [x8] ; CHECK-NEXT: ret %vscale = call i64 @llvm.vscale.i64() %mulvl = mul i64 %vscale, 256 %base = getelementptr i8, ptr %ptr, i64 %mulvl - call void @llvm.aarch64.sme.str(i32 0, ptr %base) + call void @llvm.aarch64.sme.str(i32 16, ptr %base) ret void; }