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)
commit7e87384592c45532d794ebf252fd5afe506427db
tree4d1e1511d4c3be8edb21005d7dcbc8111b446c54
parentea399e59cfc6a93496b6a0aeb7443281d5a1a5e4
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.

llvm-svn: 225503
llvm/lib/CodeGen/RegisterCoalescer.cpp
llvm/test/CodeGen/X86/coalesce_commute_subreg.ll [new file with mode: 0644]