mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 08:26:02 +00:00
Assert that all trace candidate blocks have been visited by the PO.
When computing a trace, all the candidates for pred/succ must have been visited. Filter out back-edges first, though. The PO traversal ignores them. Thanks to Andy for spotting this in review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160995 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -214,15 +214,12 @@ MinInstrCountEnsemble::pickTracePred(const MachineBasicBlock *MBB) {
|
|||||||
for (MachineBasicBlock::const_pred_iterator
|
for (MachineBasicBlock::const_pred_iterator
|
||||||
I = MBB->pred_begin(), E = MBB->pred_end(); I != E; ++I) {
|
I = MBB->pred_begin(), E = MBB->pred_end(); I != E; ++I) {
|
||||||
const MachineBasicBlock *Pred = *I;
|
const MachineBasicBlock *Pred = *I;
|
||||||
const MachineTraceMetrics::TraceBlockInfo *PredTBI =
|
|
||||||
getDepthResources(Pred);
|
|
||||||
// Ignore invalidated predecessors. This never happens on the first scan,
|
|
||||||
// but if we rejected this predecessor earlier, it won't be revalidated.
|
|
||||||
if (!PredTBI)
|
|
||||||
continue;
|
|
||||||
// Don't consider predecessors in other loops.
|
// Don't consider predecessors in other loops.
|
||||||
if (getLoopFor(Pred) != CurLoop)
|
if (getLoopFor(Pred) != CurLoop)
|
||||||
continue;
|
continue;
|
||||||
|
const MachineTraceMetrics::TraceBlockInfo *PredTBI =
|
||||||
|
getDepthResources(Pred);
|
||||||
|
assert(PredTBI && "Predecessor must be visited first");
|
||||||
// Pick the predecessor that would give this block the smallest InstrDepth.
|
// Pick the predecessor that would give this block the smallest InstrDepth.
|
||||||
unsigned Depth = PredTBI->InstrDepth + CurCount;
|
unsigned Depth = PredTBI->InstrDepth + CurCount;
|
||||||
if (!Best || Depth < BestDepth)
|
if (!Best || Depth < BestDepth)
|
||||||
@@ -242,17 +239,15 @@ MinInstrCountEnsemble::pickTraceSucc(const MachineBasicBlock *MBB) {
|
|||||||
for (MachineBasicBlock::const_succ_iterator
|
for (MachineBasicBlock::const_succ_iterator
|
||||||
I = MBB->succ_begin(), E = MBB->succ_end(); I != E; ++I) {
|
I = MBB->succ_begin(), E = MBB->succ_end(); I != E; ++I) {
|
||||||
const MachineBasicBlock *Succ = *I;
|
const MachineBasicBlock *Succ = *I;
|
||||||
const MachineTraceMetrics::TraceBlockInfo *SuccTBI =
|
|
||||||
getHeightResources(Succ);
|
|
||||||
// Ignore invalidated successors.
|
|
||||||
if (!SuccTBI)
|
|
||||||
continue;
|
|
||||||
// Don't consider back-edges.
|
// Don't consider back-edges.
|
||||||
if (CurLoop && Succ == CurLoop->getHeader())
|
if (CurLoop && Succ == CurLoop->getHeader())
|
||||||
continue;
|
continue;
|
||||||
// Don't consider successors in other loops.
|
// Don't consider successors in other loops.
|
||||||
if (getLoopFor(Succ) != CurLoop)
|
if (getLoopFor(Succ) != CurLoop)
|
||||||
continue;
|
continue;
|
||||||
|
const MachineTraceMetrics::TraceBlockInfo *SuccTBI =
|
||||||
|
getHeightResources(Succ);
|
||||||
|
assert(SuccTBI && "Successor must be visited first");
|
||||||
// Pick the successor that would give this block the smallest InstrHeight.
|
// Pick the successor that would give this block the smallest InstrHeight.
|
||||||
unsigned Height = SuccTBI->InstrHeight;
|
unsigned Height = SuccTBI->InstrHeight;
|
||||||
if (!Best || Height < BestHeight)
|
if (!Best || Height < BestHeight)
|
||||||
|
Reference in New Issue
Block a user