[PATCH] D101177: [AMDGPU] Avoid adding nullptr keys to hash table

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 02:14:21 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp:1489-1490
         const Value *Ptr = Memop->getValue();
-        SLoadAddresses.insert(std::make_pair(Ptr, Inst.getParent()));
+        if (Ptr)
+          SLoadAddresses.insert(std::make_pair(Ptr, Inst.getParent()));
       }
----------------
If we don't do anything here when !Ptr, then we have lost the information that there is an outstanding scalar load, which does not seem safe to me.

Stepping back a bit, I don't think the original SLoadAddresses implementation in D71934 was safe. Surely a scalar load and a vector store can alias even if they don't have an identical Ptr value?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101177



More information about the llvm-commits mailing list