RegisterCoalescer: Fix removeCopyByCommutingDef with subreg liveness
authorMatthias Braun <matze@braunis.de>
Fri, 9 Jan 2015 03:01:31 +0000 (03:01 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 9 Jan 2015 03:01:31 +0000 (03:01 +0000)
commitc41acffe2297585ad56aa772de75e82c132070bb
treeeea959dd0bee6b0be2ddc02d36c39650cbb1c2b9
parent4493e98154acae50db5532b5a0ed740a192db9d4
RegisterCoalescer: Fix removeCopyByCommutingDef with subreg liveness

The code that eliminated additional coalescable copies in
removeCopyByCommutingDef() used MergeValueNumberInto() which internally
may merge A into B or B into A. In this case A and B had different Def
points, so we have to reset ValNo.Def to the intended one after merging.

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