Skip to content

Commit 7c13463

Browse files
LouisLafpleath
authored andcommitted
Fix for perf recovery change
1 parent c906220 commit 7c13463

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/Backend/BackwardPass.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7454,6 +7454,17 @@ BackwardPass::SymIsIntconstOrSelf(Sym *sym, IR::Opnd *opnd)
74547454
bool
74557455
BackwardPass::InstrPreservesNumberValues(IR::Instr *instr, Sym *defSym)
74567456
{
7457+
if (instr->m_opcode == Js::OpCode::Ld_A)
7458+
{
7459+
if (instr->GetSrc1()->IsRegOpnd())
7460+
{
7461+
IR::RegOpnd *src1 = instr->GetSrc1()->AsRegOpnd();
7462+
if (src1->m_sym->IsSingleDef())
7463+
{
7464+
instr = src1->m_sym->GetInstrDef();
7465+
}
7466+
}
7467+
}
74577468
return (OpCodeAttr::ProducesNumber(instr->m_opcode) ||
74587469
(instr->m_opcode == Js::OpCode::Add_A && this->SymIsIntconstOrSelf(defSym, instr->GetSrc1()) && this->SymIsIntconstOrSelf(defSym, instr->GetSrc2())));
74597470
}

lib/Backend/GlobOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2725,7 +2725,7 @@ GlobOpt::IsNonNumericRegOpnd(IR::RegOpnd *opnd, bool inGlobOpt) const
27252725
{
27262726
return true;
27272727
}
2728-
if (currentBlock->loop->preservesNumberValue->Test(opnd->m_sym->m_id))
2728+
if (this->prePassLoop->preservesNumberValue->Test(opnd->m_sym->m_id))
27292729
{
27302730
return false;
27312731
}

0 commit comments

Comments
 (0)