This is an archive of the discontinued LLVM Phabricator instance.

[NFC][AMDGPULowerModuleLDSPass] Cleanup of getTableLookupKernelIndex
ClosedPublic

Authored by jmmartinez on Jul 18 2023, 5:49 AM.

Details

Summary
  • Do a single lookup when querying the map
  • Use shorter versions of the LLVM API

Diff Detail

Event Timeline

jmmartinez created this revision.Jul 18 2023, 5:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 5:49 AM
jmmartinez requested review of this revision.Jul 18 2023, 5:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 5:49 AM
foad added inline comments.Jul 18 2023, 5:54 AM
llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
704–705

Maybe auto [It, Inserted] = ... to avoid cryptic stuff like Insert.first->second?

Destructuring bind on the emplace sounds good. I don't particularly mind the repeated calls to operator[] but the signal to noise ratio is about the same and this is quicker.

  • Use structured binding declaration
jmmartinez marked an inline comment as done.Jul 18 2023, 7:50 AM
JonChesterfield accepted this revision.Jul 18 2023, 7:53 AM
This revision is now accepted and ready to land.Jul 18 2023, 7:53 AM