hphp/runtime/vm/jit/cfg.cpp
// If edge is critical, split it by inserting an intermediate block.
// A critical edge is an edge from a block with multiple successors to
// a block with multiple predecessors.
If edge is critical, split it by inserting an intermediate block.
A critical edge is an edge from a block with multiple successors to
a block with multiple predecessors.
If edge is critical split it by inserting an intermediate block . A critical edge is an edge from a block with multiple successors to a block with multiple predecessors .
void splitCriticalEdge(IRUnit& unit, Edge* edge) {
  if (!edge) return;
  auto* to = edge->to();
  auto* branch = edge->inst();
  auto* from = branch->block();
  if (to->numPreds() <= 1 || from->numSuccs() <= 1) return;
  Block* middle = unit.defBlock();
  FTRACE(3, "splitting edge from B{} -> B{} using B{}\n",
         from->id(), to->id(), middle->id());
  if (branch->taken() == to) {
    branch->setTaken(middle);
  } else {
    assert(branch->next() == to);
    branch->setNext(middle);
  }
  auto& marker = to->front().marker();
  middle->prepend(unit.gen(Jmp, marker, to));
  auto const unlikely = Block::Hint::Unlikely;
  if (from->hint() == unlikely || to->hint() == unlikely) {
    middle->setHint(unlikely);
  }
}
void splitCriticalEdge ( IRUnit & unit , Edge * edge ) { if ( ! edge ) return ; auto * to = edge -> to ( ) ; auto * branch = edge -> inst ( ) ; auto * from = branch -> block ( ) ; if ( to -> numPreds ( ) <= 1 || from -> numSuccs ( ) <= 1 ) return ; Block * middle = unit . defBlock ( ) ; FTRACE ( 3 , " \n " , from -> id ( ) , to -> id ( ) , middle -> id ( ) ) ; if ( branch -> taken ( ) == to ) { branch -> setTaken ( middle ) ; } else { assert ( branch -> next ( ) == to ) ; branch -> setNext ( middle ) ; } auto & marker = to -> front ( ) . marker ( ) ; middle -> prepend ( unit . gen ( Jmp , marker , to ) ) ; auto const unlikely = Block :: Hint :: Unlikely ; if ( from -> hint ( ) == unlikely || to -> hint ( ) == unlikely ) { middle -> setHint ( unlikely ) ; } }
If edge is critical, split it by inserting an intermediate block.
If edge is critical split it by inserting an intermediate block .