This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Partially move constant selection to patterns
Needs ReviewPublic

Authored by arsenm on Aug 24 2020, 5:20 PM.

Details

Summary

This is still relying on the manual code for splitting 64-bit
constants, and handling pointers.

Diff Detail

Event Timeline

arsenm created this revision.Aug 24 2020, 5:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2020, 5:20 PM
arsenm requested review of this revision.Aug 24 2020, 5:20 PM
foad added a comment.Aug 25 2020, 1:56 AM

Looks OK to me, but I don't know this stuff well enough to approve it.

llvm/lib/Target/AMDGPU/AMDGPUGISel.td
312–314

Can't you call renderBitcastFPImm directly and avoid the 32/64 wrapper functions?

llvm/lib/Target/AMDGPU/SIInstrInfo.td
760

Why is this needed? Perhaps add a comment? In other cases where you've done this it's because there's a PredicateCode that might return false, but I don't see that here.

arsenm added inline comments.Aug 27 2020, 6:33 AM
llvm/lib/Target/AMDGPU/AMDGPUGISel.td
312–314

No, the emitter doesn't handle reusing the same function

llvm/lib/Target/AMDGPU/SIInstrInfo.td
760

Because patterns with custom predicate code that don't have the gisel equivalent aren't imported. We need an IgnoreCodePredicate field or something to avoid this. I'm also pretty sure we don't need this specific predicate in SelectionDAG either and don't remember why we have it

foad added inline comments.Feb 12 2021, 2:24 AM
llvm/lib/Target/AMDGPU/AMDGPUGISel.td
312–314