Skip to content

[RISCV] Add nf argument to VReg class instead overriding with a let. NFC #131235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions llvm/lib/Target/RISCV/RISCVRegisterInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,13 @@ foreach m = [1, 2, 4] in {
}
}

class VReg<list<ValueType> regTypes, dag regList, int Vlmul>
class VReg<list<ValueType> regTypes, dag regList, int Vlmul, int nf = 1>
: RISCVRegisterClass<regTypes,
64, // The maximum supported ELEN is 64.
regList> {
let IsVRegClass = 1;
let VLMul = Vlmul;
let NF = nf;

let Size = !mul(VLMul, NF, 64);
let CopyCost = !mul(VLMul, NF);
Expand Down Expand Up @@ -799,17 +800,15 @@ class VTupRegList<int LMUL, int NF> {

foreach m = LMULList in {
foreach nf = NFList<m>.L in {
let NF = nf in {
def "VRN" # nf # "M" # m # "NoV0"
: VReg<VTupRegList<m, nf>.L,
(add !cast<RegisterTuples>("VN" # nf # "M" # m # "NoV0")),
m>;
def "VRN" # nf # "M" # m
: VReg<VTupRegList<m, nf>.L,
(add !cast<RegisterTuples>("VN" # nf # "M" # m # "NoV0"),
!cast<RegisterTuples>("VN" # nf # "M" # m # "V0")),
m>;
}
def "VRN" # nf # "M" # m # "NoV0"
: VReg<VTupRegList<m, nf>.L,
(add !cast<RegisterTuples>("VN" # nf # "M" # m # "NoV0")),
m, nf>;
def "VRN" # nf # "M" # m
: VReg<VTupRegList<m, nf>.L,
(add !cast<RegisterTuples>("VN" # nf # "M" # m # "NoV0"),
!cast<RegisterTuples>("VN" # nf # "M" # m # "V0")),
m, nf>;
}
}

Expand Down