diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-04-29 01:41:44 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-04-29 01:41:44 +0000 |
commit | ed3e66b3ff668b088e69a5fbc6c54a623cabb88b (patch) | |
tree | 78e1f15d16ab7819cb86639e4fed658d2b799c68 /lib | |
parent | 12bf21df8317abdcf76780abb517c17102220177 (diff) | |
download | external_llvm-ed3e66b3ff668b088e69a5fbc6c54a623cabb88b.zip external_llvm-ed3e66b3ff668b088e69a5fbc6c54a623cabb88b.tar.gz external_llvm-ed3e66b3ff668b088e69a5fbc6c54a623cabb88b.tar.bz2 |
Another extract_subreg coalescing bug.
e.g.
vr1024<2> extract_subreg vr1025, 2
If vr1024 do not have the same register class as vr1025, it's not safe to coalesce this away. For example, vr1024 might be a GPR32 while vr1025 might be a GPR64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 3ea35c6..6a110f0 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -942,9 +942,11 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) { unsigned OldSubIdx = isExtSubReg ? CopyMI->getOperand(0).getSubReg() : CopyMI->getOperand(2).getSubReg(); if (OldSubIdx) { - if (OldSubIdx == SubIdx) + if (OldSubIdx == SubIdx && !differingRegisterClasses(SrcReg, DstReg)) // r1024<2> = EXTRACT_SUBREG r1025, 2. Then r1024 has already been // coalesced to a larger register so the subreg indices cancel out. + // Also check if the other larger register is of the same register + // class as the would be resulting register. SubIdx = 0; else { DOUT << "\t Sub-register indices mismatch.\n"; |