summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MustExecute.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/MustExecute.cpp')
-rw-r--r--llvm/lib/Analysis/MustExecute.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/MustExecute.cpp b/llvm/lib/Analysis/MustExecute.cpp
index 281b8f5ab98..180c38ddacc 100644
--- a/llvm/lib/Analysis/MustExecute.cpp
+++ b/llvm/lib/Analysis/MustExecute.cpp
@@ -83,16 +83,15 @@ void ICFLoopSafetyInfo::computeLoopSafetyInfo(const Loop *CurLoop) {
computeBlockColors(CurLoop);
}
-void ICFLoopSafetyInfo::insertInstructionTo(const BasicBlock *BB) {
- ICF.invalidateBlock(BB);
- MW.invalidateBlock(BB);
+void ICFLoopSafetyInfo::insertInstructionTo(const Instruction *Inst,
+ const BasicBlock *BB) {
+ ICF.insertInstructionTo(Inst, BB);
+ MW.insertInstructionTo(Inst, 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());
- MW.invalidateBlock(Inst->getParent());
+ ICF.removeInstruction(Inst);
+ MW.removeInstruction(Inst);
}
void LoopSafetyInfo::computeBlockColors(const Loop *CurLoop) {
OpenPOWER on IntegriCloud