This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][GISel] Make G_SELECT of pointers legal
ClosedPublic

Authored by craig.topper on Aug 13 2023, 11:30 AM.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 13 2023, 11:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2023, 11:30 AM
craig.topper requested review of this revision.Aug 13 2023, 11:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2023, 11:30 AM
craig.topper retitled this revision from [RISCV][GISel] Support G_SELECT of pointers. to [RISCV][GISel] Make G_SELECT of pointers legal.Aug 13 2023, 11:55 AM
arsenm added inline comments.Aug 14 2023, 7:58 AM
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
80

might want to add something like legalIf(isPointer(0)) to cover all the address spaces

craig.topper added inline comments.Aug 14 2023, 10:55 AM
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
80

Is AMDGPU the only target that uses multiple address spaces in GlobalISel today? I only see p0 in AArch64 for example.

arsenm added inline comments.Aug 14 2023, 10:56 AM
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
80

Probably. I know code in the wild is relying on the non-0 address spaces implicitly treated as 0 in SelectionDAG on x86

jrtc27 added inline comments.Aug 14 2023, 12:01 PM
llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
80

We use non-zero downstream for CHERI capabilities

I think I'd prefer to deal with non-zero address space in the future.

reames accepted this revision.Aug 15 2023, 7:47 AM

LGTM - I am explicitly okay with the incrementalism for address spaces.

This revision is now accepted and ready to land.Aug 15 2023, 7:47 AM
This revision was automatically updated to reflect the committed changes.