[llvm] 1937a36 - [RISCV] Add @earlyclobber to SiFive custom matrix multiply instruction. (#124060)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 08:26:45 PST 2025
Author: Craig Topper
Date: 2025-01-23T08:26:39-08:00
New Revision: 1937a36209bc5f3636e7c98a1638ee9f082b4d2b
URL: https://github.com/llvm/llvm-project/commit/1937a36209bc5f3636e7c98a1638ee9f082b4d2b
DIFF: https://github.com/llvm/llvm-project/commit/1937a36209bc5f3636e7c98a1638ee9f082b4d2b.diff
LOG: [RISCV] Add @earlyclobber to SiFive custom matrix multiply instruction. (#124060)
All of these have a constraint that vd and vs1 cannot overlap. Some of
them have an additional widening constraint for vs2. We should use
earlyclobber to protect this.
This is unlikely to be an issue in practice due to the instrinsic being
ternary so vd is also a source. The intrinsic has a different type for
this source than the other sources. You would have to do something crazy
to get the register allocator to overlap the registers.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td b/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td
index d5105a9edb0290..0654f1ac19a82c 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td
@@ -374,28 +374,28 @@ multiclass VPseudoVC_XVW<LMULInfo m, DAGOperand RS1Class,
}
}
-multiclass VPseudoSiFiveVMACC<string mx, VReg vd_type, VReg vs2_type,
- string Constraint = ""> {
+multiclass VPseudoSiFiveVMACC<string mx, VReg vd_type, VReg vs2_type> {
def "Pseudo" # NAME # "_" # mx
- : VPseudoTernaryNoMaskWithPolicy<vd_type, V_M1.vrclass, vs2_type, Constraint>;
+ : VPseudoTernaryNoMaskWithPolicy<vd_type, V_M1.vrclass, vs2_type,
+ "@earlyclobber $rd">;
}
-multiclass VPseudoSiFiveVQMACCDOD<string Constraint = ""> {
+multiclass VPseudoSiFiveVQMACCDOD {
foreach m = MxListVF8 in
let VLMul = m.value in
- defm NAME : VPseudoSiFiveVMACC<m.MX, m.vrclass, m.vrclass, Constraint>;
+ defm NAME : VPseudoSiFiveVMACC<m.MX, m.vrclass, m.vrclass>;
}
-multiclass VPseudoSiFiveVQMACCQOQ<string Constraint = ""> {
+multiclass VPseudoSiFiveVQMACCQOQ {
foreach m = [V_MF2, V_M1, V_M2, V_M4] in
let VLMul = m.value in
- defm NAME : VPseudoSiFiveVMACC<m.MX, m.wvrclass, m.vrclass, Constraint>;
+ defm NAME : VPseudoSiFiveVMACC<m.MX, m.wvrclass, m.vrclass>;
}
-multiclass VPseudoSiFiveVFWMACC<string Constraint = ""> {
+multiclass VPseudoSiFiveVFWMACC {
foreach m = MxListVF2 in
let VLMul = m.value in
- defm NAME : VPseudoSiFiveVMACC<m.MX, m.wvrclass, m.vrclass, Constraint>;
+ defm NAME : VPseudoSiFiveVMACC<m.MX, m.wvrclass, m.vrclass>;
}
multiclass VPseudoSiFiveVFNRCLIP<string Constraint = "@earlyclobber $rd"> {
More information about the llvm-commits
mailing list