From 576225daf5f0c85183369a86ab1be01455c383bc Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Wed, 31 Aug 2016 18:02:19 +0000 Subject: [PATCH] Add an optional parameter with a list of undefs to extendToIndices llvm-svn: 280268 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h | 11 ++++++++--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h b/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h index d65c655983b0..b3f6fd51a9f6 100644 --- a/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -164,14 +164,19 @@ extern cl::opt UseSegmentSetForPhysRegs; void shrinkToUses(LiveInterval::SubRange &SR, unsigned Reg); /// Extend the live range @p LR to reach all points in @p Indices. The - /// points in the @p Indices array must be jointly dominated by existing - /// defs in @p LR. PHI-defs are added as needed to maintain SSA form. + /// points in the @p Indices array must be jointly dominated by the union + /// of the existing defs in @p LR and points in @p Undefs. + /// + /// PHI-defs are added as needed to maintain SSA form. /// /// If a SlotIndex in @p Indices is the end index of a basic block, @p LR /// will be extended to be live out of the basic block. + /// If a SlotIndex in @p Indices is jointy dominated only by points in + /// @p Undefs, the live range will not be extended to that point. /// /// See also LiveRangeCalc::extend(). - void extendToIndices(LiveRange &LR, ArrayRef Indices); + void extendToIndices(LiveRange &LR, ArrayRef Indices, + ArrayRef Undefs = {}); /// If @p LR has a live value at @p Kill, prune its live range by removing /// any liveness reachable from Kill. Add live range end points to diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index ba34d7682fe4..a3122763806f 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -568,11 +568,12 @@ void LiveIntervals::shrinkToUses(LiveInterval::SubRange &SR, unsigned Reg) { } void LiveIntervals::extendToIndices(LiveRange &LR, - ArrayRef Indices) { + ArrayRef Indices, + ArrayRef Undefs) { assert(LRCalc && "LRCalc not initialized."); LRCalc->reset(MF, getSlotIndexes(), DomTree, &getVNInfoAllocator()); for (unsigned i = 0, e = Indices.size(); i != e; ++i) - LRCalc->extend(LR, Indices[i], /*PhysReg=*/0, /*Undefs=*/{}); + LRCalc->extend(LR, Indices[i], /*PhysReg=*/0, Undefs); } void LiveIntervals::pruneValue(LiveRange &LR, SlotIndex Kill, -- 2.34.1