Skip to content

Commit 55c40f9

Browse files
committed
address pr comments
1 parent 3ebf17e commit 55c40f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/DirectX/DXILFlattenArrays.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,9 @@ bool DXILFlattenArraysVisitor::visitGetElementPtrInstInGEPChainBase(
284284
{Builder.getInt32(0), FlatIndex}, FlatName,
285285
GEP.getNoWrapFlags());
286286

287-
// Store the new GEP in the map before replacing uses to avoid circular
288-
// references
287+
// Note: Old gep will become an invalid instruction after replaceAllUsesWith.
288+
// Erase the old GEP in the map before to avoid invalid instructions
289+
// and circular references.
289290
GEPChainMap.erase(&GEP);
290291

291292
GEP.replaceAllUsesWith(FlatGEP);

0 commit comments

Comments
 (0)