RegisterCoalescer: Fix valuesIdentical() in some subrange merge cases.
authorMatthias Braun <matze@braunis.de>
Wed, 7 Jan 2015 23:58:38 +0000 (23:58 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 7 Jan 2015 23:58:38 +0000 (23:58 +0000)
commita065cf13cd6da7ecd142a71957f048f5141d2954
tree9d56bc225ab8afe0d1a6aee472a599f24c8692ae
parentb6eccdd6b0f82d80082e4aa30210254e0ca34069
RegisterCoalescer: Fix valuesIdentical() in some subrange merge cases.

I got confused and assumed SrcIdx/DstIdx of the CoalescerPair is a
subregister index in SrcReg/DstReg, but they are actually subregister
indices of the coalesced register that get you back to SrcReg/DstReg
when applied.

Fixed the bug, improved comments and simplified code accordingly.

Testcase by Tom Stellard!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225415 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegisterCoalescer.cpp
test/CodeGen/R600/subreg-coalescer-crash.ll [new file with mode: 0644]