Skip to content
Permalink
Browse files

Fix for perf recovery change

  • Loading branch information...
LouisLaf authored and pleath committed May 17, 2019
1 parent c906220 commit 7c13463859db3e66dbb4269ef3f084381f016ed4
Showing with 12 additions and 1 deletion.
  1. +11 −0 lib/Backend/BackwardPass.cpp
  2. +1 −1 lib/Backend/GlobOpt.cpp
@@ -7454,6 +7454,17 @@ BackwardPass::SymIsIntconstOrSelf(Sym *sym, IR::Opnd *opnd)
bool
BackwardPass::InstrPreservesNumberValues(IR::Instr *instr, Sym *defSym)
{
if (instr->m_opcode == Js::OpCode::Ld_A)
{
if (instr->GetSrc1()->IsRegOpnd())
{
IR::RegOpnd *src1 = instr->GetSrc1()->AsRegOpnd();
if (src1->m_sym->IsSingleDef())
{
instr = src1->m_sym->GetInstrDef();
}
}
}
return (OpCodeAttr::ProducesNumber(instr->m_opcode) ||
(instr->m_opcode == Js::OpCode::Add_A && this->SymIsIntconstOrSelf(defSym, instr->GetSrc1()) && this->SymIsIntconstOrSelf(defSym, instr->GetSrc2())));
}
@@ -2725,7 +2725,7 @@ GlobOpt::IsNonNumericRegOpnd(IR::RegOpnd *opnd, bool inGlobOpt) const
{
return true;
}
if (currentBlock->loop->preservesNumberValue->Test(opnd->m_sym->m_id))
if (this->prePassLoop->preservesNumberValue->Test(opnd->m_sym->m_id))
{
return false;
}

0 comments on commit 7c13463

Please sign in to comment.
You can’t perform that action at this time.