Skip to content

Commit 738735b

Browse files
committed
Address review comments
1 parent 7b358ed commit 738735b

File tree

2 files changed

+10
-10
lines changed
  • llvm
    • include/llvm/Transforms/Scalar
    • lib/Transforms/Scalar

2 files changed

+10
-10
lines changed

llvm/include/llvm/Transforms/Scalar/GVN.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class GVNPass : public PassInfoMixin<GVNPass> {
139139

140140
/// This removes the specified instruction from
141141
/// our various maps and marks it for deletion.
142-
void doInstructionDeletion(Instruction *I);
142+
void salvageAndRemoveInstruction(Instruction *I);
143143

144144
DominatorTree &getDominatorTree() const { return *DT; }
145145
AAResults *getAliasAnalysis() const { return VN.getAliasAnalysis(); }

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ void GVNPass::printPipeline(
875875
OS << '>';
876876
}
877877

878-
void GVNPass::doInstructionDeletion(Instruction *I) {
878+
void GVNPass::salvageAndRemoveInstruction(Instruction *I) {
879879
salvageKnowledge(I, AC);
880880
salvageDebugInfo(*I);
881881
removeInstruction(I);
@@ -1580,7 +1580,7 @@ void GVNPass::eliminatePartiallyRedundantLoad(
15801580
return OptimizationRemark(DEBUG_TYPE, "LoadPRE", Load)
15811581
<< "load eliminated by PRE";
15821582
});
1583-
doInstructionDeletion(Load);
1583+
salvageAndRemoveInstruction(Load);
15841584
}
15851585

15861586
bool GVNPass::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
@@ -1799,7 +1799,7 @@ bool GVNPass::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
17991799
// Erase instructions generated by the failed PHI translation before
18001800
// trying to number them. PHI translation might insert instructions
18011801
// in basic blocks other than the current one, and we delete them
1802-
// directly, as doInstructionDeletion only allows removing from the
1802+
// directly, as salvageAndRemoveInstruction only allows removing from the
18031803
// current basic block.
18041804
NewInsts.pop_back_val()->eraseFromParent();
18051805
}
@@ -2000,7 +2000,7 @@ bool GVNPass::processNonLocalLoad(LoadInst *Load) {
20002000
MD->invalidateCachedPointerInfo(V);
20012001
++NumGVNLoad;
20022002
reportLoadElim(Load, V, ORE);
2003-
doInstructionDeletion(Load);
2003+
salvageAndRemoveInstruction(Load);
20042004
return true;
20052005
}
20062006

@@ -2068,7 +2068,7 @@ bool GVNPass::processAssumeIntrinsic(AssumeInst *IntrinsicI) {
20682068
}
20692069
}
20702070
if (isAssumeWithEmptyBundle(*IntrinsicI)) {
2071-
doInstructionDeletion(IntrinsicI);
2071+
salvageAndRemoveInstruction(IntrinsicI);
20722072
return true;
20732073
}
20742074
return false;
@@ -2179,7 +2179,7 @@ bool GVNPass::processLoad(LoadInst *L) {
21792179
return false;
21802180

21812181
if (L->use_empty()) {
2182-
doInstructionDeletion(L);
2182+
salvageAndRemoveInstruction(L);
21832183
return true;
21842184
}
21852185

@@ -2213,9 +2213,9 @@ bool GVNPass::processLoad(LoadInst *L) {
22132213
MSSAU->removeMemoryAccess(L);
22142214
++NumGVNLoad;
22152215
reportLoadElim(L, AvailableValue, ORE);
2216+
salvageAndRemoveInstruction(L);
22162217
// Tell MDA to reexamine the reused pointer since we might have more
22172218
// information after forwarding it.
2218-
doInstructionDeletion(L);
22192219
if (MD && AvailableValue->getType()->isPtrOrPtrVectorTy())
22202220
MD->invalidateCachedPointerInfo(AvailableValue);
22212221
return true;
@@ -2605,7 +2605,7 @@ bool GVNPass::processInstruction(Instruction *I) {
26052605
Changed = true;
26062606
}
26072607
if (isInstructionTriviallyDead(I, TLI)) {
2608-
doInstructionDeletion(I);
2608+
salvageAndRemoveInstruction(I);
26092609
Changed = true;
26102610
}
26112611
if (Changed) {
@@ -2722,7 +2722,7 @@ bool GVNPass::processInstruction(Instruction *I) {
27222722
patchAndReplaceAllUsesWith(I, Repl);
27232723
if (MD && Repl->getType()->isPtrOrPtrVectorTy())
27242724
MD->invalidateCachedPointerInfo(Repl);
2725-
doInstructionDeletion(I);
2725+
salvageAndRemoveInstruction(I);
27262726
return true;
27272727
}
27282728

0 commit comments

Comments
 (0)