This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Separate hasRoundModeOpNum into separate VXRM and FRM functions.
ClosedPublic

Authored by craig.topper on Aug 18 2023, 5:07 PM.

Details

Summary

Preparation for developing a new rounding mode insertion algorithm
that is going to be different between them since VXRM doesn't need
to be save/restored.

This also unifies the FRM handling in RISCVISelLowering.cpp between
scalar and vector.

Fixes outdated comments in RISCVAsmPrinter and sorts the predicate
function by the reverse order of the operands being skipped.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 18 2023, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2023, 5:07 PM
craig.topper requested review of this revision.Aug 18 2023, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2023, 5:07 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

IIUC, this patch will not introduce functional changes and is refactoring so future CSR insertion algorithm can be done cleanly.
Other than nits, the patch looks good to me.

llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
216

nit: | policy | sew | vl | frm |

230

nit: | policy | sew | vl | vxrm |

llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
789

Nit Looks like this is redundant change here?

craig.topper added inline comments.Aug 20 2023, 11:32 PM
llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
789

I put them in the reverse order the operands appear on instructions. That way each time we decrement NumOps we are effectively removing the operand we're checking for.

eopXD added inline comments.Aug 21 2023, 12:03 AM
llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp
789

I see. Thank you for explaining.

eopXD accepted this revision.Aug 21 2023, 12:03 AM

LGTM with only nits.

This revision is now accepted and ready to land.Aug 21 2023, 12:03 AM
This revision was landed with ongoing or failed builds.Aug 21 2023, 10:01 AM
This revision was automatically updated to reflect the committed changes.