In my target, I have
setOperationAction(ISD::FSUB, MVT::v4f32, Expand);
This produces the desired effect in LegalizeDAG, replacing the FSUB with FADD + FNEG. However, when the vector legalizer runs, it thinks the Expand legalize action means to unroll the vector. This isn’t necessary and not what I wanted.
Is there a way to get one and not the other? I don’t want the unroll aspect of the Expand action.
I changed to a Custom lowering and duplicated the FADD+FNEG action, but the dag-combine2 stage moved this back to FSUB, which then failed to pattern match in Select. That code checks for !LegalOperations || TLI.isLegalorCustom(FSUB), which of course is true for this case.