This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix DivergenceAnalysis for llvm.read_register
ClosedPublic

Authored by arsenm on Oct 31 2022, 5:21 PM.

Details

Reviewers
rampitec
Group Reviewers
Restricted Project
Summary

This was treating all calls as uniform by default, which
is wrong if used to read a VGPR.

Diff Detail

Event Timeline

arsenm created this revision.Oct 31 2022, 5:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2022, 5:21 PM
arsenm requested review of this revision.Oct 31 2022, 5:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2022, 5:21 PM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
876

You could just check the first symbol of the name, it is divergent if it is 'v' or 'a'. Same effect at the end, but much less work.

arsenm updated this revision to Diff 473735.Nov 7 2022, 10:20 AM

Don't fully parse register names. This does change the behavior for invalid register names from divergent to not divergent

This revision is now accepted and ready to land.Nov 7 2022, 10:31 AM