diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-10-20 18:45:55 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-10-20 18:45:55 +0000 |
commit | 9b131a004f60a92cfb8eaef772630249a769003d (patch) | |
tree | 4c3bc292f60d5c26d309195f11cf9b8e97956752 | |
parent | 2e431cea8402cdd4fb0fcd8b1941a60da310aece (diff) | |
download | bcm5719-llvm-9b131a004f60a92cfb8eaef772630249a769003d.tar.gz bcm5719-llvm-9b131a004f60a92cfb8eaef772630249a769003d.zip |
When SimpleRegisterCoalescing is trimming kill flags on a physical register
operand, also check if subregisters are killed.
Add <imp-def> operands for subregisters that remain alive after a super register
is killed.
I don't have a testcase for this that reproduces on trunk. <rdar://problem/8441758>
llvm-svn: 116940
-rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index 41be8d551f5..2f73551aa6d 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -1767,8 +1767,18 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) { if (!MO.isReg() || !MO.isKill()) continue; unsigned reg = MO.getReg(); if (!reg || !li_->hasInterval(reg)) continue; - if (!li_->getInterval(reg).killedAt(DefIdx)) + if (!li_->getInterval(reg).killedAt(DefIdx)) { MO.setIsKill(false); + continue; + } + // When leaving a kill flag on a physreg, check if any subregs should + // remain alive. + if (!TargetRegisterInfo::isPhysicalRegister(reg)) + continue; + for (const unsigned *SR = tri_->getSubRegisters(reg); + unsigned S = *SR; ++SR) + if (li_->hasInterval(S) && li_->getInterval(S).liveAt(DefIdx)) + MI->addRegisterDefined(S, tri_); } } } |