You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// We have to first check the legality and only then allocate expensive data structures on the tempArena, because most block will have instructions we cant skip
4688
+
4689
+
while (instr)
4690
+
{
4691
+
if (!instr->IsBranchInstr() && !instr->IsLabelInstr() && !IsLegalOpcodeForPathDepBrFold(instr))
4692
+
{
4693
+
return;
4694
+
}
4695
+
if (instr->IsLabelInstr())
4696
+
{
4697
+
if (instr->AsLabelInstr()->m_isLoopTop)
4698
+
{
4699
+
// don't cross over to loops
4700
+
return;
4701
+
}
4702
+
}
4703
+
if (instr->IsBranchInstr())
4704
+
{
4705
+
IR::BranchInstr *branch = instr->AsBranchInstr();
4706
+
if (branch->IsUnconditional())
4707
+
{
4708
+
if (!branch->GetTarget())
4709
+
{
4710
+
return;
4711
+
}
4712
+
instr = branch->GetTarget();
4713
+
}
4714
+
else
4715
+
{
4716
+
// Found only legal instructions until a conditional branch, build expensive data structures and check provability
4717
+
break;
4718
+
}
4719
+
}
4720
+
else
4721
+
{
4722
+
instr = instr->m_next;
4723
+
}
4724
+
}
4725
+
4726
+
instr = this->GetLastInstr();
4727
+
// Allocate hefty structures, we will not free them because OptBlock does a Reset on the tempAlloc
/* We start from the current instruction and go on scanning for legality, as long as it is legal to skip an instruction, skip.
4692
4732
* When we see an unconditional branch, start scanning from the branchTarget
4693
4733
* When we see a conditional branch, check if we can prove the branch target, if we can, adjust the flowgraph, and continue in the direction of the proven target
0 commit comments