This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][VP] Lower VP_FMA to RVV instructions.
ClosedPublic

Authored by craig.topper on Feb 7 2022, 2:56 PM.

Details

Summary

We already had FMA_VL node, but we didn't have masked patterns.
I have not added the fneg variations. I'll do those after I add
llvm.vp.fneg.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 7 2022, 2:56 PM
craig.topper requested review of this revision.Feb 7 2022, 2:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2022, 2:56 PM

Now that D118810 landed, I think we can rebase this and switch true_mask patterns to use V0 and rely on the post-process step to select the unmasked FMAs. You'll need to add the mask information to the ternary pseudos, by subclassing them from
RISCVMaskedPseudo. Hopefully that should cut down on the net pattern gain.

Now that D118810 landed, I think we can rebase this and switch true_mask patterns to use V0 and rely on the post-process step to select the unmasked FMAs. You'll need to add the mask information to the ternary pseudos, by subclassing them from
RISCVMaskedPseudo. Hopefully that should cut down on the net pattern gain.

The existing operand copying rules in the post-process don't work for FMAs. We need to retain the merge operand during the conversion and I'm not sure how to detect that yet.. Can I do it as a follow up?

frasercrmck accepted this revision.Feb 9 2022, 9:12 AM

Now that D118810 landed, I think we can rebase this and switch true_mask patterns to use V0 and rely on the post-process step to select the unmasked FMAs. You'll need to add the mask information to the ternary pseudos, by subclassing them from
RISCVMaskedPseudo. Hopefully that should cut down on the net pattern gain.

The existing operand copying rules in the post-process don't work for FMAs. We need to retain the merge operand during the conversion and I'm not sure how to detect that yet.. Can I do it as a follow up?

Oh yes I missed that: no worries. I didn't mean it to be a must-have. I'm sure we can tackle it later.

LGTM.

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

Hopefully this could be improved by D117670?

This revision is now accepted and ready to land.Feb 9 2022, 9:12 AM
This revision was landed with ongoing or failed builds.Feb 9 2022, 11:33 AM
This revision was automatically updated to reflect the committed changes.