[PATCH] D155588: [NFC][AMDGPULowerModuleLDSPass] Cleanup of getTableLookupKernelIndex

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 05:54:11 PDT 2023


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp:704
     // block to spare deduplicating it later.
-    if (tableKernelIndexCache.count(F) == 0) {
-      LLVMContext &Ctx = M.getContext();
-      IRBuilder<> Builder(Ctx);
-      FunctionType *FTy = FunctionType::get(Type::getInt32Ty(Ctx), {});
+    auto Insert = tableKernelIndexCache.try_emplace(F);
+    if (Insert.second) {
----------------
Maybe `auto [It, Inserted] = ...` to avoid cryptic stuff like `Insert.first->second`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155588/new/

https://reviews.llvm.org/D155588



More information about the llvm-commits mailing list