forked from OSchip/llvm-project
[IPT] Narrow scope of removeInstruction invalidation [NFC]
We only need to invalidate if the instruction being removed is the cached "first special instruction". If the instruction is before that one, it can't (by assumption) be special. If it is after that one, it wasn't the first.
This commit is contained in:
parent
b3024ac084
commit
b4498e6b8d
|
@ -107,8 +107,10 @@ void InstructionPrecedenceTracking::insertInstructionTo(const Instruction *Inst,
|
|||
}
|
||||
|
||||
void InstructionPrecedenceTracking::removeInstruction(const Instruction *Inst) {
|
||||
if (isSpecialInstruction(Inst))
|
||||
FirstSpecialInsts.erase(Inst->getParent());
|
||||
auto *BB = Inst->getParent();
|
||||
assert(BB && "must be called before instruction is actually removed");
|
||||
if (FirstSpecialInsts.count(BB) && FirstSpecialInsts[BB] == Inst)
|
||||
FirstSpecialInsts.erase(BB);
|
||||
}
|
||||
|
||||
void InstructionPrecedenceTracking::removeUsersOf(const Instruction *Inst) {
|
||||
|
|
Loading…
Reference in New Issue