Skip to content

Commit 7f20a0b

Browse files
committed
Stop hoisting branch src-es when type-specing at the end of a block. OS #17449647
1 parent 9cb7e8c commit 7f20a0b

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

lib/Backend/GlobOpt.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -907,43 +907,7 @@ GlobOpt::ToTypeSpec(BVSparse<JitArenaAllocator> *bv, BasicBlock *block, IRType t
907907
}
908908

909909
IR::RegOpnd *newOpnd = IR::RegOpnd::New(stackSym, fromType, this->func);
910-
IR::Instr *lastInstr = block->GetLastInstr();
911910

912-
if (!insertBeforeInstr && lastInstr->IsBranchInstr())
913-
{
914-
// If branch is using this symbol, hoist the operand as the ToInt32 load will get
915-
// inserted right before the branch.
916-
IR::Instr *instrPrev = lastInstr->m_prev;
917-
IR::Opnd *src1 = lastInstr->GetSrc1();
918-
if (src1)
919-
{
920-
if (src1->IsRegOpnd() && src1->AsRegOpnd()->m_sym == stackSym)
921-
{
922-
lastInstr->HoistSrc1(Js::OpCode::Ld_A);
923-
}
924-
IR::Opnd *src2 = lastInstr->GetSrc2();
925-
if (src2)
926-
{
927-
if (src2->IsRegOpnd() && src2->AsRegOpnd()->m_sym == stackSym)
928-
{
929-
lastInstr->HoistSrc2(Js::OpCode::Ld_A);
930-
}
931-
}
932-
933-
// Did we insert anything?
934-
if (lastInstr->m_prev != instrPrev)
935-
{
936-
// If we had ByteCodeUses right before the branch, move them back down.
937-
IR::Instr *insertPoint = lastInstr;
938-
for (IR::Instr *instrBytecode = instrPrev; instrBytecode->m_opcode == Js::OpCode::ByteCodeUses; instrBytecode = instrBytecode->m_prev)
939-
{
940-
instrBytecode->Unlink();
941-
insertPoint->InsertBefore(instrBytecode);
942-
insertPoint = instrBytecode;
943-
}
944-
}
945-
}
946-
}
947911
this->ToTypeSpecUse(nullptr, newOpnd, block, nullptr, nullptr, toType, bailOutKind, lossy, insertBeforeInstr);
948912
} NEXT_BITSET_IN_SPARSEBV;
949913
}

0 commit comments

Comments
 (0)