[LLVMdev] Expand action on FSUB with vector types causes both "Vector Unroll" and "Add+Negate"

Joe Matarazzo joe.matarazzo at gmail.com
Fri Mar 15 17:03:51 PDT 2013

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.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130315/51a21a4b/attachment.html>

More information about the llvm-dev mailing list