This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Improve vector fceil/ffloor lowering by changing FRM.
ClosedPublic

Authored by craig.topper on Sep 2 2022, 3:24 PM.

Details

Summary

This adds new VFCVT pseudoinstructions that take a rounding mode operand. A custom inserter is used to insert additional instructions to change FRM around the
VFCVT.

Some of this is borrowed from D122860, but takes a somewhat different direction. We may migrate to that patch, but for now I was trying to keep this as independent from
RVV intrinsics as I could.

A followup patch will use this approach for FROUND too.

Still need to fix the cost model.

Diff Detail

Event Timeline

craig.topper created this revision.Sep 2 2022, 3:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2022, 3:24 PM
craig.topper requested review of this revision.Sep 2 2022, 3:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2022, 3:24 PM
craig.topper edited the summary of this revision. (Show Details)Sep 2 2022, 3:25 PM

Looks good to me.

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
1034

Really minor but I find TAFRM quite hard to parse. I dunno if TA_FRM is preferable?

arcbbb accepted this revision.Sep 5 2022, 7:37 AM

LGTM.
It is nice to see vfcvt is used in fceil & ffloor.

This revision is now accepted and ready to land.Sep 5 2022, 7:37 AM
This revision was landed with ongoing or failed builds.Sep 5 2022, 7:04 PM
This revision was automatically updated to reflect the committed changes.