<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 11, 2011, at 8:20 PM, Rafael Espindola wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Optima; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">-  // Otherwise, check the last instruction.<br>-  const MachineInstr &LastInst = Pred->back();<br>-  return !LastInst.getDesc().isBarrier();<br>+  // Otherwise, ask the backend.<br>+  const TargetInstrInfo *TII = MF->getTarget().getInstrInfo();<br>+  MachineBasicBlock *PredTBB = NULL, *PredFBB = NULL;<br>+  SmallVector<MachineOperand, 4> PredCond;<br>+  if (TII->AnalyzeBranch(*Pred, PredTBB, PredFBB, PredCond))<br>+    return false;<br>+<br>+  if (PredCond.empty())<br>+    return true;<br>+  return !PredFBB || PredFBB == MBB;<br>}<br></span></span></blockquote></div><br><div>The double-CFG-edge hack was added as a compile time optimization.</div><div><br></div><div>While I like to see it go, we should at least confirm that it was a premature optimization.</div><div><br></div><div>Did you measure before/after compile times? The -O0 compile times are extra interesting.</div><div><br></div><div>/jakob</div><div><br></div></body></html>