This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: insert readfirstlane on SGPR inlineasm copy
Needs RevisionPublic

Authored by vjayakum on Aug 3 2023, 10:09 AM.

Details

Reviewers
arsenm
bcahoon
Summary

There are some copies from VGPR to SGPR while inlineasm lowering which causes illegal copy.
Inserting a readfirstlane for SGPR copy to avoid producing an illegal copy later incase the copy is from VGPR to SGPR

Diff Detail

Event Timeline

vjayakum created this revision.Aug 3 2023, 10:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 10:09 AM
vjayakum requested review of this revision.Aug 3 2023, 10:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 10:09 AM
vjayakum updated this revision to Diff 546929.Aug 3 2023, 10:20 AM
arsenm added inline comments.Aug 3 2023, 10:32 AM
llvm/lib/Target/AMDGPU/AMDGPUInlineAsmLowering.cpp
29–30

Seems like a place that accidentally works

38

This should only happen for physical registers which you also need to handle

66

Already have SrcTy above. Also this won't work for any tuple type. You need to split up any larger registers

llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-inline-asm.ll
299

Don't use anonymous values

300

Better to have real input values

303

This needs a full range of tested types. You need at least i16, half, <2 x i16>, <2 x half>, pointers of various address spaces, and vectors of all of those

arsenm requested changes to this revision.Aug 10 2023, 2:53 PM
This revision now requires changes to proceed.Aug 10 2023, 2:53 PM