diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-05-26 18:22:53 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2016-05-26 18:22:53 +0000 |
commit | 143f684a79a28a02a85eb450ad5cee7a86062b1a (patch) | |
tree | 117cbd292560f9b715ba06621e4e2ed55ca2944c /llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp | |
parent | 7abf9d5927b39abf8e2d29a2edc66fc7f828289c (diff) | |
download | bcm5719-llvm-143f684a79a28a02a85eb450ad5cee7a86062b1a.tar.gz bcm5719-llvm-143f684a79a28a02a85eb450ad5cee7a86062b1a.zip |
Do not rename registers that do not start an independent live range
llvm-svn: 270885
Diffstat (limited to 'llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp b/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp index db75df87927..a736884be67 100644 --- a/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp +++ b/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp @@ -787,6 +787,8 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies( DEBUG(dbgs() << '\n'); #endif + BitVector RegAliases(TRI->getNumRegs()); + // Attempt to break anti-dependence edges. Walk the instructions // from the bottom up, tracking information about liveness as we go // to help determine which registers are available. @@ -898,6 +900,29 @@ unsigned AggressiveAntiDepBreaker::BreakAntiDependencies( } if (AntiDepReg == 0) continue; + + // If the definition of the anti-dependency register does not start + // a new live range, bail out. This can happen if the anti-dep + // register is a sub-register of another register whose live range + // spans over PathSU. In such case, PathSU defines only a part of + // the larger register. + RegAliases.reset(); + for (MCRegAliasIterator AI(AntiDepReg, TRI, true); AI.isValid(); ++AI) + RegAliases.set(*AI); + for (SDep S : PathSU->Succs) { + SDep::Kind K = S.getKind(); + if (K != SDep::Data && K != SDep::Output && K != SDep::Anti) + continue; + unsigned R = S.getReg(); + if (!RegAliases[R]) + continue; + if (R == AntiDepReg || TRI->isSubRegister(AntiDepReg, R)) + continue; + AntiDepReg = 0; + break; + } + + if (AntiDepReg == 0) continue; } assert(AntiDepReg != 0); |