[llvm] [RISCV][GISel] Attempt to simplify how we handle type legality for F and D extensions. (PR #72174)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 13 16:25:22 PST 2023
================
@@ -212,51 +221,26 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) {
getActionDefinitionsBuilder({G_FADD, G_FSUB, G_FMUL, G_FDIV, G_FMA, G_FNEG,
G_FABS, G_FSQRT, G_FMAXNUM, G_FMINNUM})
- .legalIf([=, &ST](const LegalityQuery &Query) -> bool {
- return (ST.hasStdExtF() && typeIs(0, s32)(Query)) ||
- (ST.hasStdExtD() && typeIs(0, s64)(Query));
- });
+ .legalIf(typeIsLegalScalarFP(0, ST));
getActionDefinitionsBuilder(G_FPTRUNC).legalIf(
- [=, &ST](const LegalityQuery &Query) -> bool {
- return (ST.hasStdExtD() && typeIs(0, s32)(Query) &&
- typeIs(1, s64)(Query));
- });
+ all(typeIsLegalScalarFP(0, ST), typeIsLegalScalarFP(1, ST)));
----------------
michaelmaitland wrote:
Simplifying this check has no performance gain, so maybe we should just keep as is? I expect things could get funky when we have to reason about the assumptions we made here when it is time to add Zfh and Zfhmin support.
https://github.com/llvm/llvm-project/pull/72174
More information about the llvm-commits
mailing list