diff options
author | Owen Anderson <resistor@mac.com> | 2008-10-08 04:30:51 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-10-08 04:30:51 +0000 |
commit | 04764deac8a05a74ff9399cf406f5525ff68543d (patch) | |
tree | ee915c82c621081a2d7f20b7cdd83065bed425cb /lib | |
parent | eb0d6abee36c274cf081948795f4675d8f33fc6f (diff) | |
download | external_llvm-04764deac8a05a74ff9399cf406f5525ff68543d.zip external_llvm-04764deac8a05a74ff9399cf406f5525ff68543d.tar.gz external_llvm-04764deac8a05a74ff9399cf406f5525ff68543d.tar.bz2 |
Fix the case where an instruction is not properly marked as using all registers that alias its inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57286 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/RegAllocLocal.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 82691ba..4792452 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/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) { |