This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: mbcnt allow for non-zero src1 for known-bits
ClosedPublic

Authored by dstuttard on Aug 9 2022, 3:06 AM.

Details

Summary

Src1 for mbcnt can be a non-zero literal or register. Take this into account
when calculating known bits.

Diff Detail

Event Timeline

dstuttard created this revision.Aug 9 2022, 3:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2022, 3:06 AM
dstuttard requested review of this revision.Aug 9 2022, 3:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2022, 3:06 AM
rampitec accepted this revision.Aug 9 2022, 1:30 PM

LGTM

This revision is now accepted and ready to land.Aug 9 2022, 1:30 PM
This revision was landed with ongoing or failed builds.Aug 11 2022, 5:26 AM
This revision was automatically updated to reflect the committed changes.
foad added inline comments.Aug 19 2022, 6:12 AM
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
4606

Comment seems misleading since this can give useful results even when src1 is not an immediate.

Also you could make this slightly simpler and more accurate by constructing a KnownBits for 0..(wavefront size - 1) (i.e. the high 26 or 27 bits are known zero) and then calling computeForAddSub to combine it with the known bits of src1.