Skip to content

[RISCV] Set CopyCost on register classes [NFC] #131185

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 1 commit into from
Mar 13, 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
5 changes: 3 additions & 2 deletions llvm/lib/Target/RISCV/RISCVRegisterInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ class RISCVRegisterClass<list<ValueType> regTypes, int align, dag regList>
int NF = 1;

let Size = !if(IsVRegClass, !mul(VLMul, NF, 64), 0);
let CopyCost = !if(IsVRegClass, !mul(VLMul, NF), 1);

let TSFlags{0} = IsVRegClass;
let TSFlags{3-1} = !logtwo(VLMul);
Expand Down Expand Up @@ -343,7 +344,7 @@ let RegAltNameIndices = [ABIRegAltName] in {
}
}

let RegInfos = XLenPairRI,
let RegInfos = XLenPairRI, CopyCost = 2,
DecoderMethod = "DecodeGPRPairRegisterClass" in {
def GPRPair : RISCVRegisterClass<[XLenPairVT, XLenPairFVT], 64, (add
X10_X11, X12_X13, X14_X15, X16_X17,
Expand All @@ -357,7 +358,7 @@ def GPRPair : RISCVRegisterClass<[XLenPairVT, XLenPairFVT], 64, (add
def GPRPairNoX0 : RISCVRegisterClass<[XLenPairVT, XLenPairFVT], 64, (sub GPRPair, X0_Pair)>;
} // let RegInfos = XLenPairRI, DecoderMethod = "DecodeGPRPairRegisterClass"

let RegInfos = XLenPairRI in
let RegInfos = XLenPairRI, CopyCost = 2 in
def GPRPairC : RISCVRegisterClass<[XLenPairVT, XLenPairFVT], 64, (add
X10_X11, X12_X13, X14_X15, X8_X9
)>;
Expand Down
Loading