[llvm] [AMDGPU] Fix a potential use-after-erase in `AMDGPUPromoteAlloca` pass (PR #174529)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 6 10:40:18 PST 2026
================
@@ -1166,9 +1166,18 @@ void AMDGPUPromoteAllocaImpl::promoteAllocaToVector(AllocaAnalysis &AA) {
});
// Now fixup the placeholders.
- for (Instruction *Placeholder : Placeholders) {
- Placeholder->replaceAllUsesWith(
- Updater.GetValueInMiddleOfBlock(Placeholder->getParent()));
+ SmallVector<WeakVH> PlaceholderToNewVal(Placeholders.size());
----------------
arsenm wrote:
This usage of WeakVH doesn't make sense. I meant use WeakVH in an existing structure. This usage doesn't check if the value is null / was deleted before using it later
https://github.com/llvm/llvm-project/pull/174529
More information about the llvm-commits
mailing list