summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-01 22:39:25 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-01 22:39:25 +0000
commita5135f60dd95275dcbc1123f866889151ced933d (patch)
tree5e0dc69e54f439ac7bb172b3d378844eed75e103 /lib/CodeGen/MachineInstr.cpp
parent23d3d4595c23784494cba422a76428e48431413a (diff)
downloadllvm-a5135f60dd95275dcbc1123f866889151ced933d.tar.gz
llvm-a5135f60dd95275dcbc1123f866889151ced933d.tar.bz2
llvm-a5135f60dd95275dcbc1123f866889151ced933d.tar.xz
Properly compose subregister indices when coalescing.
The comment about ordering of subreg indices is no longer true. This exposed a bug in the new substVirtReg method that is also fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineInstr.cpp')
-rw-r--r--lib/CodeGen/MachineInstr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index ce0c5e6a87..402178dc6d 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/lib/CodeGen/MachineInstr.cpp
@@ -117,7 +117,8 @@ void MachineOperand::substVirtReg(unsigned Reg, unsigned SubIdx,
if (SubIdx && getSubReg())
SubIdx = TRI.composeSubRegIndices(SubIdx, getSubReg());
setReg(Reg);
- setSubReg(SubIdx);
+ if (SubIdx)
+ setSubReg(SubIdx);
}
void MachineOperand::substPhysReg(unsigned Reg, const TargetRegisterInfo &TRI) {