summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-06-11 00:31:28 +0000
committerMatthias Braun <matze@braunis.de>2016-06-11 00:31:28 +0000
commit959a8c974df3c0b9240172b685cd1563171b30a0 (patch)
treea927eab535b160f0d80cdaae5b0a729780ca0ab4 /llvm/lib/CodeGen
parent940f425a43a6d65ae27bcc9ada16b72ce6af3e50 (diff)
downloadbcm5719-llvm-959a8c974df3c0b9240172b685cd1563171b30a0.tar.gz
bcm5719-llvm-959a8c974df3c0b9240172b685cd1563171b30a0.zip
LiveIntervalAnalysis: findLastUseBefore() must ignore undef uses.
undef uses are no real uses of a register and must be ignored by findLastUseBefore() so that handleMove() does not produce invalid live intervals in some cases. This fixed http://llvm.org/PR28083 llvm-svn: 272446
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 622b9c25d0e..1a8360b226b 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1314,6 +1314,8 @@ private:
if (TargetRegisterInfo::isVirtualRegister(Reg)) {
SlotIndex LastUse = Before;
for (MachineOperand &MO : MRI.use_nodbg_operands(Reg)) {
+ if (MO.isUndef())
+ continue;
unsigned SubReg = MO.getSubReg();
if (SubReg != 0 && LaneMask != 0
&& (TRI.getSubRegIndexLaneMask(SubReg) & LaneMask) == 0)
@@ -1353,7 +1355,7 @@ private:
// Check if MII uses Reg.
for (MIBundleOperands MO(*MII); MO.isValid(); ++MO)
- if (MO->isReg() &&
+ if (MO->isReg() && !MO->isUndef() &&
TargetRegisterInfo::isPhysicalRegister(MO->getReg()) &&
TRI.hasRegUnit(MO->getReg(), Reg))
return Idx.getRegSlot();
OpenPOWER on IntegriCloud