summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveRangeCalc.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2015-02-20 23:43:14 +0000
committerMatthias Braun <matze@braunis.de>2015-02-20 23:43:14 +0000
commit876e7172eed7e37f4ebf97a432dea7223b85ede5 (patch)
tree493c5d60581fc6efb70036e127ec596aef8dcbff /llvm/lib/CodeGen/LiveRangeCalc.cpp
parent162feb5f8e45fbdb786d3439cb575dc6eb9da89f (diff)
downloadbcm5719-llvm-876e7172eed7e37f4ebf97a432dea7223b85ede5.tar.gz
bcm5719-llvm-876e7172eed7e37f4ebf97a432dea7223b85ede5.zip
LiveRangeCalc: Don't start liveranges of PHI instruction at the block begin.
Summary: Letting them begin at the PHI instruction slightly simplifies the code but more importantly avoids breaking the assumption that live ranges starting at the block begin are also live at the end of the predecessor blocks. The MachineVerifier checks that but was apparently never run in the few instances where liveranges are calculated for machine-SSA functions. Reviewers: qcolombet Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7779 llvm-svn: 230093
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeCalc.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveRangeCalc.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeCalc.cpp b/llvm/lib/CodeGen/LiveRangeCalc.cpp
index a07c3a35dc7..d804b39c597 100644
--- a/llvm/lib/CodeGen/LiveRangeCalc.cpp
+++ b/llvm/lib/CodeGen/LiveRangeCalc.cpp
@@ -43,11 +43,8 @@ void LiveRangeCalc::reset(const MachineFunction *mf,
static void createDeadDef(SlotIndexes &Indexes, VNInfo::Allocator &Alloc,
LiveRange &LR, const MachineOperand &MO) {
const MachineInstr *MI = MO.getParent();
- SlotIndex DefIdx;
- if (MI->isPHI())
- DefIdx = Indexes.getMBBStartIdx(MI->getParent());
- else
- DefIdx = Indexes.getInstructionIndex(MI).getRegSlot(MO.isEarlyClobber());
+ SlotIndex DefIdx =
+ Indexes.getInstructionIndex(MI).getRegSlot(MO.isEarlyClobber());
// Create the def in LR. This may find an existing def.
LR.createDeadDef(DefIdx, Alloc);
OpenPOWER on IntegriCloud