aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SimpleRegisterCoalescing.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/SimpleRegisterCoalescing.cpp
parent23d3d4595c23784494cba422a76428e48431413a (diff)
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/SimpleRegisterCoalescing.cpp')
-rw-r--r--lib/CodeGen/SimpleRegisterCoalescing.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp
index ed3c243ff3..7c1bc47fa9 100644
--- a/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp
@@ -848,19 +848,7 @@ SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg,
continue;
}
- // Sub-register indexes goes from small to large. e.g.
- // RAX: 1 -> AL, 2 -> AX, 3 -> EAX
- // EAX: 1 -> AL, 2 -> AX
- // So RAX's sub-register 2 is AX, RAX's sub-regsiter 3 is EAX, whose
- // sub-register 2 is also AX.
- //
- // FIXME: Properly compose subreg indices for all targets.
- //
- if (SubIdx && OldSubIdx && SubIdx != OldSubIdx)
- ;
- else if (SubIdx)
- O.setSubReg(SubIdx);
- O.setReg(DstReg);
+ O.substVirtReg(DstReg, SubIdx, *tri_);
DEBUG({
dbgs() << "\t\tupdated: ";