Skip to content

Commit d21a435

Browse files
committed
[LegalizeVectorOps][RISCV] Don't scalarize FNEG in ExpandFNEG if FSUB is marked Promote.
We have a special check that tries to determine if vector FP operations are supported for the type to determine whether to scalarize or not. If FP arithmetic would be promoted, don't unroll. This improves Zvfhmin codegen on RISC-V.
1 parent 615bd9e commit d21a435

File tree

2 files changed

+539
-972
lines changed

2 files changed

+539
-972
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ SDValue VectorLegalizer::ExpandFNEG(SDNode *Node) {
18061806

18071807
// FIXME: The FSUB check is here to force unrolling v1f64 vectors on AArch64.
18081808
if (!TLI.isOperationLegalOrCustom(ISD::XOR, IntVT) ||
1809-
!(TLI.isOperationLegalOrCustom(ISD::FSUB, VT) || VT.isScalableVector()))
1809+
!(TLI.isOperationLegalOrCustomOrPromote(ISD::FSUB, VT) || VT.isScalableVector()))
18101810
return SDValue();
18111811

18121812
SDLoc DL(Node);

0 commit comments

Comments
 (0)