aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/PreAllocSplitting.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-11-02 08:08:18 +0000
committerOwen Anderson <resistor@mac.com>2008-11-02 08:08:18 +0000
commit6423c6c0e8e85d843750f9563180ef7bcfca56c6 (patch)
treed072e1c8b65b776c4e6e672467dcc81c20ec4179 /lib/CodeGen/PreAllocSplitting.cpp
parent2b82b7e77ee20eb601ea12f3ed2f686ab838f08f (diff)
downloadexternal_llvm-6423c6c0e8e85d843750f9563180ef7bcfca56c6.zip
external_llvm-6423c6c0e8e85d843750f9563180ef7bcfca56c6.tar.gz
external_llvm-6423c6c0e8e85d843750f9563180ef7bcfca56c6.tar.bz2
Don't do pre-splitting if doing so would create a value join that did not
exist before. Updating the live intervals in that care is tricky in the general case. Evan, if you see a tighter guard condition for this, let me know. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PreAllocSplitting.cpp')
-rw-r--r--lib/CodeGen/PreAllocSplitting.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/PreAllocSplitting.cpp b/lib/CodeGen/PreAllocSplitting.cpp
index 8f223b36..4044b73 100644
--- a/lib/CodeGen/PreAllocSplitting.cpp
+++ b/lib/CodeGen/PreAllocSplitting.cpp
@@ -89,6 +89,8 @@ namespace {
AU.addPreservedID(StrongPHIEliminationID);
else
AU.addPreservedID(PHIEliminationID);
+ AU.addRequired<MachineLoopInfo>();
+ AU.addPreserved<MachineLoopInfo>();
MachineFunctionPass::getAnalysisUsage(AU);
}
@@ -633,6 +635,14 @@ bool PreAllocSplitting::SplitRegLiveInterval(LiveInterval *LI) {
assert(0 && "Val# is defined by a dead def?");
abort();
}
+
+ // Pre-splitting a vreg that does not have a PHI kill across a barrier
+ // that is within a loop can potentially create a join that was not
+ // present before, which would make updating the live intervals very
+ // difficult. Bailout instead.
+ MachineLoopInfo& MLI = getAnalysis<MachineLoopInfo>();
+ if (!ValNo->hasPHIKill && MLI.getLoopFor(BarrierMBB))
+ return false;
// FIXME: For now, if definition is rematerializable, do not split.
MachineInstr *DefMI = (ValNo->def != ~0U)