summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveRangeCalc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeCalc.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveRangeCalc.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeCalc.cpp b/llvm/lib/CodeGen/LiveRangeCalc.cpp
index e449b240d70..1d46161ad71 100644
--- a/llvm/lib/CodeGen/LiveRangeCalc.cpp
+++ b/llvm/lib/CodeGen/LiveRangeCalc.cpp
@@ -105,8 +105,9 @@ void LiveRangeCalc::calculate(LiveInterval &LI) {
}
}
- // Create the def in the main liverange.
- if (MO.isDef())
+ // Create the def in the main liverange. We do not have to do this if
+ // subranges are tracked as we recreate the main range later in this case.
+ if (MO.isDef() && !LI.hasSubRanges())
createDeadDef(*Indexes, *Alloc, LI, MO);
}
@@ -116,13 +117,17 @@ void LiveRangeCalc::calculate(LiveInterval &LI) {
// Step 2: Extend live segments to all uses, constructing SSA form as
// necessary.
- for (LiveInterval::SubRange &S : LI.subranges()) {
+ if (LI.hasSubRanges()) {
+ for (LiveInterval::SubRange &S : LI.subranges()) {
+ resetLiveOutMap();
+ extendToUses(S, Reg, S.LaneMask);
+ }
+ LI.clear();
+ LI.constructMainRangeFromSubranges(*Indexes, *Alloc);
+ } else {
resetLiveOutMap();
- extendToUses(S, Reg, S.LaneMask);
+ extendToUses(LI, Reg, ~0u);
}
-
- resetLiveOutMap();
- extendToUses(LI, Reg, ~0u);
}
OpenPOWER on IntegriCloud