This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Don't store current instruction in AMDGPULibCalls member
ClosedPublic

Authored by arsenm on Jul 31 2023, 5:22 AM.

Details

Reviewers
rampitec
Pierre-vh
dfukalov
vpykhtin
yaxunl
jmmartinez
Group Reviewers
Restricted Project
Summary

This was adding confusing global state which was shadowed most of the
time.

Diff Detail

Event Timeline

arsenm created this revision.Jul 31 2023, 5:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 5:22 AM
arsenm requested review of this revision.Jul 31 2023, 5:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 31 2023, 5:23 AM
Herald added a subscriber: wdng. · View Herald Transcript
jmmartinez added inline comments.
llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
113–120

What do you think about making the functions static members ?

NIT: ReplaceInstWithInst also takes the name. Maybe we could use that function instead of the two calls?

arsenm updated this revision to Diff 545613.Jul 31 2023, 5:39 AM

Make static

llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
113–120

ReplaceInstWithInst implies caring about the iterator. Currently this is too far removed from the iterator to care

jmmartinez accepted this revision.Jul 31 2023, 6:01 AM
This revision is now accepted and ready to land.Jul 31 2023, 6:01 AM