This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][GlobalISel] Legalize constants, undefined values, extension instructions, and (un)merge instructions for narrow types
ClosedPublic

Authored by nitinjohnraj on Jul 26 2023, 4:23 PM.

Details

Summary

Test legalization for (s7, s8, s16, s32, s48, s64, s96) for rv32, (s8, s15, s16, s32, s64, s72, s128, s192) for rv64.

Diff Detail

Unit TestsFailed

Event Timeline

nitinjohnraj created this revision.Jul 26 2023, 4:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2023, 4:23 PM
nitinjohnraj requested review of this revision.Jul 26 2023, 4:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2023, 4:23 PM
nitinjohnraj retitled this revision from [RISCV][GlobalISel] Legalize constants, undefined values, extension instructions, and (un)merge instructions to [RISCV][GlobalISel] Legalize constants, undefined values, extension instructions, and (un)merge instructions for narrow types.Jul 27 2023, 2:15 PM

Added tests for odd sizes

nitinjohnraj edited the summary of this revision. (Show Details)Jul 27 2023, 2:46 PM

Added tests for s48 on rv32 and s72 on rv64

nitinjohnraj edited the summary of this revision. (Show Details)Jul 27 2023, 3:33 PM
craig.topper added inline comments.Jul 31 2023, 1:28 PM
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
36

Can't we just handle 2 * XLen in the next if. We're not trying to support vectors so we don't need a vector exception

37

This comment is wrong. This isn't s128 if XLen is 32.

41

Why are we allowing 2 and 4 here?

47

128 here is also wrong

Addressed comments

craig.topper added inline comments.Aug 1 2023, 3:59 PM
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
38

Shouldn't that be DstSize > Xlen not DstSize >= 2 * XLen? Thought it won't make a difference since anything between XLen and XLen*2 isn't a power of 2 so the !isPowerOf2_32(DstSize) will reject it.

nitinjohnraj retitled this revision from [RISCV][GlobalISel] Legalize constants, undefined values, extension instructions, and (un)merge instructions for narrow types to [RISCV][GlobalISel] Legalize constants, undefined values, extension instructions, and (un)merge instructions.Aug 3 2023, 10:40 AM
nitinjohnraj edited the summary of this revision. (Show Details)
nitinjohnraj marked 3 inline comments as done.
nitinjohnraj retitled this revision from [RISCV][GlobalISel] Legalize constants, undefined values, extension instructions, and (un)merge instructions to [RISCV][GlobalISel] Legalize constants, undefined values, extension instructions, and (un)merge instructions for narrow types.
nitinjohnraj edited the summary of this revision. (Show Details)

Address comments

nitinjohnraj marked 2 inline comments as done.Aug 3 2023, 10:42 AM
nitinjohnraj added inline comments.
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
38

I think you're right.

This revision is now accepted and ready to land.Aug 3 2023, 10:44 AM
This revision was landed with ongoing or failed builds.Aug 7 2023, 11:26 AM
This revision was automatically updated to reflect the committed changes.