Skip to content

Commit 27c207e

Browse files
authored
[NFC][SPIRV] GetElementPtrInst does not need a call to isInstructionTriviallyDead after replaceUsesofWith (#162045)
A getelementptr is always removable after replacing all its uses, since it doesn't have side effects and always returns.
1 parent 08e9540 commit 27c207e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,9 +2811,7 @@ bool SPIRVEmitIntrinsics::runOnFunction(Function &Func) {
28112811
GetElementPtrInst *NewGEP = simplifyZeroLengthArrayGepInst(Ref);
28122812
if (NewGEP) {
28132813
Ref->replaceAllUsesWith(NewGEP);
2814-
if (isInstructionTriviallyDead(Ref))
2815-
DeadInsts.insert(Ref);
2816-
2814+
DeadInsts.insert(Ref);
28172815
Ref = NewGEP;
28182816
}
28192817
if (Type *GepTy = getGEPType(Ref))

0 commit comments

Comments
 (0)