[NFC] Specialize public API of ICFLoopSafetyInfo for insertions and removals
llvm-svn: 345822
diff --git a/llvm/lib/Analysis/MustExecute.cpp b/llvm/lib/Analysis/MustExecute.cpp
index 64ee2a7..7507aeb 100644
--- a/llvm/lib/Analysis/MustExecute.cpp
+++ b/llvm/lib/Analysis/MustExecute.cpp
@@ -82,10 +82,16 @@
computeBlockColors(CurLoop);
}
-void ICFLoopSafetyInfo::dropCachedInfo(const BasicBlock *BB) {
+void ICFLoopSafetyInfo::insertInstructionTo(const BasicBlock *BB) {
ICF.invalidateBlock(BB);
}
+void ICFLoopSafetyInfo::removeInstruction(const Instruction *Inst) {
+ // TODO: So far we just conservatively drop cache, but maybe we can not do it
+ // when Inst is not an ICF instruction. Follow-up on that.
+ ICF.invalidateBlock(Inst->getParent());
+}
+
void LoopSafetyInfo::computeBlockColors(const Loop *CurLoop) {
// Compute funclet colors if we might sink/hoist in a function with a funclet
// personality routine.