SSATmp* TraceBuilder::cseLookup(IRInstruction* inst, const folly::Optional<IdomVector>& idoms) { auto tmp = cseHashTable(inst)->lookup(inst); if (tmp && idoms) { // During a reoptimize pass, we need to make sure that any values // we want to reuse for CSE are only reused in blocks dominated by // the block that defines it. if (!dominates(tmp->inst()->block(), inst->block(), *idoms)) { return nullptr; } } return tmp; }
void TraceBuilder::cseKill(SSATmp* src) { if (src->inst()->canCSE()) { cseHashTable(src->inst())->erase(src); } }
void FrameState::cseKill(SSATmp* src) { if (src->inst()->canCSE()) { cseHashTable(src->inst())->erase(src); } }
void TraceBuilder::cseInsert(IRInstruction* inst) { cseHashTable(inst)->insert(inst->dst()); }
void FrameState::cseInsert(const IRInstruction* inst) { cseHashTable(inst)->insert(inst->dst()); }