diff options
author | Jonas Paulsson <jonas.paulsson@ericsson.com> | 2015-01-07 13:38:29 +0000 |
---|---|---|
committer | Jonas Paulsson <jonas.paulsson@ericsson.com> | 2015-01-07 13:38:29 +0000 |
commit | fcf0cba88cf6b466264f1644536e9491920ae295 (patch) | |
tree | b8236691b9e6e372baadb4feb8e86e7a36aec4a2 /llvm/lib/CodeGen | |
parent | bf408bbe387209b037557ef63d2ac90060827bfd (diff) | |
download | bcm5719-llvm-fcf0cba88cf6b466264f1644536e9491920ae295.tar.gz bcm5719-llvm-fcf0cba88cf6b466264f1644536e9491920ae295.zip |
New method SDep::isNormalMemoryOrBarrier() in ScheduleDAGInstrs.cpp.
Used to iterate over previously added memory dependencies in
adjustChainDeps() and iterateChainSucc().
SDep::isCtrl() was previously used in these places, that also gave
anti and output edges. The code may be worse if these are followed,
because MisNeedChainEdge() will conservatively return true since a
non-memory instruction has no memory operands, and a false chain dep
will be added. It is also unnecessary since all memory accesses of
interest will be reached by memory dependencies, and there is a budget
limit for the number of edges traversed.
This problem was found on an out-of-tree target with enabled alias
analysis. No test case for an in-tree target has been found.
Reviewed by Hal Finkel.
llvm-svn: 225351
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp index 95f1a06e0c0..409e7041907 100644 --- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp +++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp @@ -614,10 +614,10 @@ iterateChainSucc(AliasAnalysis *AA, const MachineFrameInfo *MFI, } // Track current depth. (*Depth)++; - // Iterate over chain dependencies only. + // Iterate over memory dependencies only. for (SUnit::const_succ_iterator I = SUb->Succs.begin(), E = SUb->Succs.end(); I != E; ++I) - if (I->isCtrl()) + if (I->isNormalMemoryOrBarrier()) iterateChainSucc (AA, MFI, SUa, I->getSUnit(), ExitSU, Depth, Visited); return *Depth; } @@ -644,11 +644,12 @@ static void adjustChainDeps(AliasAnalysis *AA, const MachineFrameInfo *MFI, Dep.setLatency(((*I)->getInstr()->mayLoad()) ? LatencyToLoad : 0); (*I)->addPred(Dep); } - // Now go through all the chain successors and iterate from them. - // Keep track of visited nodes. + + // Iterate recursively over all previously added memory chain + // successors. Keep track of visited nodes. for (SUnit::const_succ_iterator J = (*I)->Succs.begin(), JE = (*I)->Succs.end(); J != JE; ++J) - if (J->isCtrl()) + if (J->isNormalMemoryOrBarrier()) iterateChainSucc (AA, MFI, SU, J->getSUnit(), ExitSU, &Depth, Visited); } |