This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Avoid redundant calls to numBits in AMDGPUCodeGenPrepare::replaceMulWithMul24().
ClosedPublic

Authored by abinavpp on Oct 14 2021, 9:12 PM.

Details

Summary

The isU24() and isI24() calls numBits to make its decision. This change
replaces them with the internal numBits call so that we can use its
result for the > 32 bit width cases.

Diff Detail

Event Timeline

abinavpp created this revision.Oct 14 2021, 9:12 PM
abinavpp requested review of this revision.Oct 14 2021, 9:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2021, 9:12 PM
foad added inline comments.Oct 15 2021, 2:04 AM
llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
512

I realize this check was already in isI24, but I don't see the point of it. I think the only effect it has is: on a machine that has mul_i24 but not mul_u24, we will fail to do this optimization, for no good reason.

abinavpp updated this revision to Diff 379992.Oct 15 2021, 7:09 AM
abinavpp marked an inline comment as done.

Addressed review comment.

foad accepted this revision.Oct 15 2021, 7:10 AM

LGTM, thanks.

This revision is now accepted and ready to land.Oct 15 2021, 7:10 AM
This revision was landed with ongoing or failed builds.Oct 15 2021, 7:20 AM
This revision was automatically updated to reflect the committed changes.