This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support ISD::STRICT_FADD/FSUB/FMUL/FDIV for vector types.
ClosedPublic

Authored by fakepaper56 on Mar 13 2023, 12:11 AM.

Details

Summary

The patch handles fixed type strict-fp by new RISCVISD::STRICT_ prefixed
isd nodes.

Diff Detail

Event Timeline

fakepaper56 created this revision.Mar 13 2023, 12:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2023, 12:11 AM
fakepaper56 requested review of this revision.Mar 13 2023, 12:11 AM
craig.topper added inline comments.Mar 13 2023, 2:20 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
829

Can we use any_fadd?

835

This looks identical to the line above.

llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
1633

Can we have an any_riscv_fadd_vl?

fakepaper56 added inline comments.Mar 13 2023, 3:50 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
829

The type of any_fadd is PatFrag and the type of first argument of VPatBinaryFPSDNode_VV_VF. I am not sure what types contains PatFrag and SDNode.

craig.topper added inline comments.Mar 13 2023, 3:55 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
829

I think the common base class is SDPatternOperator.

Use any_<op> to replace base operations and strict operations.

fakepaper56 marked 4 inline comments as done.Mar 13 2023, 5:28 PM
fakepaper56 added inline comments.
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
829

Done. Thank your advise.

craig.topper added inline comments.Mar 13 2023, 8:35 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
835

This line still looks identical to the line before it.

fakepaper56 marked an inline comment as done and an inline comment as not done.Mar 13 2023, 9:00 PM
fakepaper56 added inline comments.
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
835

Sorry, I mis-filled the done status.

fakepaper56 marked an inline comment as not done.Mar 13 2023, 9:11 PM
fakepaper56 added inline comments.
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
835

The reason I didn't deal with widen operations now is we need to deal with (any_fadd (any_fpextend)) and the test cases change may be too large to read. Is my concern over-thinking? Actually I don't know how large should a patch be ?

craig.topper added inline comments.Mar 13 2023, 9:14 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
835

We can skip widening instructions for now.

fakepaper56 marked an inline comment as not done.Mar 13 2023, 9:36 PM
fakepaper56 added inline comments.
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
835

Thank you. I will support it within subsequent corresponding patches.

craig.topper added inline comments.Mar 14 2023, 8:43 AM
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
835

Can you delete the second copy of defm : VPatWidenBinaryFPSDNode_VV_VF_WV_WF<fadd, "PseudoVFWADD">; that was added so I can approve this patch?

Remove the redudant line.

This revision is now accepted and ready to land.Mar 14 2023, 4:33 PM
This revision was landed with ongoing or failed builds.Mar 14 2023, 4:47 PM
This revision was automatically updated to reflect the committed changes.