summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-10-08 04:30:51 +0000
committerOwen Anderson <resistor@mac.com>2008-10-08 04:30:51 +0000
commitbfe12ee668f97ebae6f1d94b162ad827b07df5f7 (patch)
tree2f0636d870f72faac530be262e7bc946dd6e316b /llvm/lib/CodeGen
parentd9959aee34a875df5ac0cd688f01422eef532056 (diff)
downloadbcm5719-llvm-bfe12ee668f97ebae6f1d94b162ad827b07df5f7.tar.gz
bcm5719-llvm-bfe12ee668f97ebae6f1d94b162ad827b07df5f7.zip
Fix the case where an instruction is not properly marked as using all registers that alias its inputs.
llvm-svn: 57286
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAllocLocal.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLocal.cpp b/llvm/lib/CodeGen/RegAllocLocal.cpp
index 82691baf3db..479245224ea 100644
--- a/llvm/lib/CodeGen/RegAllocLocal.cpp
+++ b/llvm/lib/CodeGen/RegAllocLocal.cpp
@@ -575,8 +575,26 @@ void RALocal::ComputeLocalLiveness(MachineBasicBlock& MBB) {
// them for later. Also, we have to process these
// _before_ processing the defs, since an instr
// uses regs before it defs them.
- if (MO.isReg() && MO.getReg() && MO.isUse())
+ if (MO.isReg() && MO.getReg() && MO.isUse()) {
LastUseDef[MO.getReg()] = std::make_pair(I, i);
+
+
+ if (TargetRegisterInfo::isVirtualRegister(MO.getReg())) continue;
+
+ const unsigned* subregs = TRI->getAliasSet(MO.getReg());
+ if (subregs) {
+ while (*subregs) {
+ DenseMap<unsigned, std::pair<MachineInstr*, unsigned> >::iterator
+ alias = LastUseDef.find(*subregs);
+
+ if (alias != LastUseDef.end() &&
+ alias->second.first != I)
+ LastUseDef[*subregs] = std::make_pair(I, i);
+
+ ++subregs;
+ }
+ }
+ }
}
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i) {
OpenPOWER on IntegriCloud