[PATCH] D134641: [AMDGPU][Backend] Fix user-after-free in AMDGPUReleaseVGPRs::isLastVGPRUseVMEMStore

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 06:51:53 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp:43
   // Used to cache the result of isLastInstructionVMEMStore for each block
   using BlockVMEMStoreType = DenseMap<MachineBasicBlock *, bool>;
   BlockVMEMStoreType BlockVMEMStore;
----------------
If you're going to resize to the number of blocks, do you really need to use a DenseMap at all? You could use a bit vector indexed by the block number 


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp:125
 
+    // we grow BlockVMEMStore to prevent the invalidation of its iterators
+    BlockVMEMStore.grow(MF.size());
----------------
Capitalize We


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134641



More information about the llvm-commits mailing list