This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][GlobalISel] Legalize division and remainder
ClosedPublic

Authored by nitinjohnraj on Aug 8 2023, 10:52 AM.

Details

Summary

Legalize division and remainder. We test for (s7, s8, s16, s32, s48, s64) on rv64 and (s8, s15, s16, s32, s64, s72, s128) on rv64, with and without the +m, +zmmul extensions. We do not handle types with size > 2 x XLen -- these ought to be handled in the IR pass.

Diff Detail

Event Timeline

nitinjohnraj created this revision.Aug 8 2023, 10:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 10:52 AM
nitinjohnraj requested review of this revision.Aug 8 2023, 10:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 10:52 AM
craig.topper added inline comments.Aug 8 2023, 11:25 PM
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
108

Division should not be affected by Zmmul. Zmmul is for multiply instructions only.

Division/remainder is legal under +m extension, but not under just +zmmul extension

This revision is now accepted and ready to land.Aug 10 2023, 9:42 AM
This revision was landed with ongoing or failed builds.Aug 17 2023, 2:42 PM
This revision was automatically updated to reflect the committed changes.