This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GlobalISel] Update legalizer for G_ABS, G_SMIN, G_SMAX, G_UMIN, G_UMAX
ClosedPublic

Authored by Acim-Maravic on Jul 20 2023, 10:20 AM.

Details

Summary

There is no need to increase the size of odd sized vectors if they are
going to be scalarized by a different rule.

Diff Detail

Event Timeline

Acim-Maravic created this revision.Jul 20 2023, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 20 2023, 10:20 AM
Acim-Maravic requested review of this revision.Jul 20 2023, 10:20 AM
arsenm added inline comments.Jul 20 2023, 11:09 AM
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
1214

I don't think there is a v2i16 abs is there? Should these just be lowered?

moreElementsVector does not support G_ABS

This is easy to just fix?

Acim-Maravic retitled this revision from [AMDGPU][GlobalIsel] Fix legalizer for G_ABS for odd sized vectors to [AMDGPU][GlobalISel] Update legalizer for G_ABS, G_SMIN, G_SMAX, G_UMIN, G_UMAX.
Acim-Maravic edited the summary of this revision. (Show Details)

moreElementsVector does not support G_ABS

This is easy to just fix?

Yes but we do not need it in this patch. Should I fix it here anyway?

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
1214

v2i16 is legal because patch D155867 will handle it in RegBankSelect.

arsenm added a comment.Aug 1 2023, 5:13 PM

moreElementsVector does not support G_ABS

This is easy to just fix?

Yes but we do not need it in this patch. Should I fix it here anyway?

Can fix before or after, doesn't need to be here

arsenm accepted this revision.Aug 1 2023, 5:13 PM
This revision is now accepted and ready to land.Aug 1 2023, 5:13 PM
This revision was landed with ongoing or failed builds.Aug 2 2023, 3:31 AM
This revision was automatically updated to reflect the committed changes.