diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-08-05 02:25:11 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-08-05 02:25:11 +0000 |
commit | b018a1e5a778808e35a12c1e7edd9b59fb8f6295 (patch) | |
tree | b7aa4758163e52720430fd7ff7e22a50230d3bc8 /lib/CodeGen/LowerSubregs.cpp | |
parent | a72dfb522da3f5a3c01fc4b1613565aa439d566d (diff) | |
download | external_llvm-b018a1e5a778808e35a12c1e7edd9b59fb8f6295.zip external_llvm-b018a1e5a778808e35a12c1e7edd9b59fb8f6295.tar.gz external_llvm-b018a1e5a778808e35a12c1e7edd9b59fb8f6295.tar.bz2 |
One more. Transfer kill of the larger register when lowering an EXTRACT_SUBREG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LowerSubregs.cpp')
-rw-r--r-- | lib/CodeGen/LowerSubregs.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/LowerSubregs.cpp b/lib/CodeGen/LowerSubregs.cpp index 358aa16..2a12063 100644 --- a/lib/CodeGen/LowerSubregs.cpp +++ b/lib/CodeGen/LowerSubregs.cpp @@ -56,7 +56,8 @@ namespace { void TransferDeadFlag(MachineInstr *MI, unsigned DstReg, const TargetRegisterInfo &TRI); void TransferKillFlag(MachineInstr *MI, unsigned SrcReg, - const TargetRegisterInfo &TRI); + const TargetRegisterInfo &TRI, + bool AddIfNotFound = false); }; char LowerSubregsInstructionPass::ID = 0; @@ -88,10 +89,11 @@ LowerSubregsInstructionPass::TransferDeadFlag(MachineInstr *MI, void LowerSubregsInstructionPass::TransferKillFlag(MachineInstr *MI, unsigned SrcReg, - const TargetRegisterInfo &TRI) { + const TargetRegisterInfo &TRI, + bool AddIfNotFound) { for (MachineBasicBlock::iterator MII = prior(MachineBasicBlock::iterator(MI)); ; --MII) { - if (MII->addRegisterKilled(SrcReg, &TRI)) + if (MII->addRegisterKilled(SrcReg, &TRI, AddIfNotFound)) break; assert(MII != MI->getParent()->begin() && "copyRegToReg output doesn't reference source register!"); @@ -142,7 +144,7 @@ bool LowerSubregsInstructionPass::LowerExtract(MachineInstr *MI) { if (MI->getOperand(0).isDead()) TransferDeadFlag(MI, DstReg, TRI); if (MI->getOperand(1).isKill()) - TransferKillFlag(MI, SrcReg, TRI); + TransferKillFlag(MI, SuperReg, TRI, true); #ifndef NDEBUG MachineBasicBlock::iterator dMI = MI; |