This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Only match correct type for a16
ClosedPublic

Authored by sebastian-ne on Jan 24 2022, 7:13 AM.

Details

Summary

Addresses are floats when a sampler is present and unsigned integers
when no sampler is present.

Therefore, only zext instructions, not sext instructions should match.

Also match integer constants that can be truncated.

Diff Detail

Event Timeline

sebastian-ne created this revision.Jan 24 2022, 7:13 AM
sebastian-ne requested review of this revision.Jan 24 2022, 7:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2022, 7:13 AM
foad accepted this revision.Jan 24 2022, 8:45 AM

LGTM, thanks! Just a couple of nits inline.

llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
81

s/half/i16/ ?

89–91

I have a slight preference for IsFloat ? match(...) : match(...).

This revision is now accepted and ready to land.Jan 24 2022, 8:45 AM
sebastian-ne marked 2 inline comments as done.

Thanks for the review, I fixed the comments.

This revision was landed with ongoing or failed builds.Jan 25 2022, 6:07 AM
This revision was automatically updated to reflect the committed changes.