aboutsummaryrefslogtreecommitdiff
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.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeCalc.cpp b/llvm/lib/CodeGen/LiveRangeCalc.cpp
index 26f6e1ede1ad..f7d9e5c44ac2 100644
--- a/llvm/lib/CodeGen/LiveRangeCalc.cpp
+++ b/llvm/lib/CodeGen/LiveRangeCalc.cpp
@@ -217,13 +217,18 @@ bool LiveRangeCalc::findReachingDefs(LiveRange &LR, MachineBasicBlock &UseMBB,
report_fatal_error("Use not jointly dominated by defs.");
}
- if (Register::isPhysicalRegister(PhysReg) && !MBB->isLiveIn(PhysReg)) {
- MBB->getParent()->verify();
+ if (Register::isPhysicalRegister(PhysReg)) {
const TargetRegisterInfo *TRI = MRI->getTargetRegisterInfo();
- errs() << "The register " << printReg(PhysReg, TRI)
- << " needs to be live in to " << printMBBReference(*MBB)
- << ", but is missing from the live-in list.\n";
- report_fatal_error("Invalid global physical register");
+ bool IsLiveIn = MBB->isLiveIn(PhysReg);
+ for (MCRegAliasIterator Alias(PhysReg, TRI, false); !IsLiveIn && Alias.isValid(); ++Alias)
+ IsLiveIn = MBB->isLiveIn(*Alias);
+ if (!IsLiveIn) {
+ MBB->getParent()->verify();
+ errs() << "The register " << printReg(PhysReg, TRI)
+ << " needs to be live in to " << printMBBReference(*MBB)
+ << ", but is missing from the live-in list.\n";
+ report_fatal_error("Invalid global physical register");
+ }
}
#endif
FoundUndef |= MBB->pred_empty();