@@ -875,7 +875,7 @@ void GVNPass::printPipeline(
875
875
OS << ' >' ;
876
876
}
877
877
878
- void GVNPass::doInstructionDeletion (Instruction *I) {
878
+ void GVNPass::salvageAndRemoveInstruction (Instruction *I) {
879
879
salvageKnowledge (I, AC);
880
880
salvageDebugInfo (*I);
881
881
removeInstruction (I);
@@ -1580,7 +1580,7 @@ void GVNPass::eliminatePartiallyRedundantLoad(
1580
1580
return OptimizationRemark (DEBUG_TYPE, " LoadPRE" , Load)
1581
1581
<< " load eliminated by PRE" ;
1582
1582
});
1583
- doInstructionDeletion (Load);
1583
+ salvageAndRemoveInstruction (Load);
1584
1584
}
1585
1585
1586
1586
bool GVNPass::PerformLoadPRE (LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
@@ -1799,7 +1799,7 @@ bool GVNPass::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
1799
1799
// Erase instructions generated by the failed PHI translation before
1800
1800
// trying to number them. PHI translation might insert instructions
1801
1801
// 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
1803
1803
// current basic block.
1804
1804
NewInsts.pop_back_val ()->eraseFromParent ();
1805
1805
}
@@ -2000,7 +2000,7 @@ bool GVNPass::processNonLocalLoad(LoadInst *Load) {
2000
2000
MD->invalidateCachedPointerInfo (V);
2001
2001
++NumGVNLoad;
2002
2002
reportLoadElim (Load, V, ORE);
2003
- doInstructionDeletion (Load);
2003
+ salvageAndRemoveInstruction (Load);
2004
2004
return true ;
2005
2005
}
2006
2006
@@ -2068,7 +2068,7 @@ bool GVNPass::processAssumeIntrinsic(AssumeInst *IntrinsicI) {
2068
2068
}
2069
2069
}
2070
2070
if (isAssumeWithEmptyBundle (*IntrinsicI)) {
2071
- doInstructionDeletion (IntrinsicI);
2071
+ salvageAndRemoveInstruction (IntrinsicI);
2072
2072
return true ;
2073
2073
}
2074
2074
return false ;
@@ -2179,7 +2179,7 @@ bool GVNPass::processLoad(LoadInst *L) {
2179
2179
return false ;
2180
2180
2181
2181
if (L->use_empty ()) {
2182
- doInstructionDeletion (L);
2182
+ salvageAndRemoveInstruction (L);
2183
2183
return true ;
2184
2184
}
2185
2185
@@ -2213,9 +2213,9 @@ bool GVNPass::processLoad(LoadInst *L) {
2213
2213
MSSAU->removeMemoryAccess (L);
2214
2214
++NumGVNLoad;
2215
2215
reportLoadElim (L, AvailableValue, ORE);
2216
+ salvageAndRemoveInstruction (L);
2216
2217
// Tell MDA to reexamine the reused pointer since we might have more
2217
2218
// information after forwarding it.
2218
- doInstructionDeletion (L);
2219
2219
if (MD && AvailableValue->getType ()->isPtrOrPtrVectorTy ())
2220
2220
MD->invalidateCachedPointerInfo (AvailableValue);
2221
2221
return true ;
@@ -2605,7 +2605,7 @@ bool GVNPass::processInstruction(Instruction *I) {
2605
2605
Changed = true ;
2606
2606
}
2607
2607
if (isInstructionTriviallyDead (I, TLI)) {
2608
- doInstructionDeletion (I);
2608
+ salvageAndRemoveInstruction (I);
2609
2609
Changed = true ;
2610
2610
}
2611
2611
if (Changed) {
@@ -2722,7 +2722,7 @@ bool GVNPass::processInstruction(Instruction *I) {
2722
2722
patchAndReplaceAllUsesWith (I, Repl);
2723
2723
if (MD && Repl->getType ()->isPtrOrPtrVectorTy ())
2724
2724
MD->invalidateCachedPointerInfo (Repl);
2725
- doInstructionDeletion (I);
2725
+ salvageAndRemoveInstruction (I);
2726
2726
return true ;
2727
2727
}
2728
2728
0 commit comments