[RegisterCoalescer] Use substPhysReg in reMaterializeTrivialDef
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Tue, 21 Aug 2018 19:47:32 +0000 (19:47 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Tue, 21 Aug 2018 19:47:32 +0000 (19:47 +0000)
commite06321382bfd6d2f0ef8ecc80b3e81144485cb93
treede0836a6a03e6748df9f513bbb84bac7e373c6c2
parented5e06b0a7174b8da1f9a21e9a182a944a116ceb
[RegisterCoalescer] Use substPhysReg in reMaterializeTrivialDef

Summary:
When RegisterCoalescer::reMaterializeTrivialDef is substituting
a register use in a DBG_VALUE instruction, and the old register
is a subreg, and the new register is a physical register,
then we need to use substPhysReg in order to extract the correct
subreg.

Reviewers: wmi, aprantl

Reviewed By: wmi

Subscribers: hiraditya, MatzeB, qcolombet, tpr, llvm-commits

Differential Revision: https://reviews.llvm.org/D50844

llvm-svn: 340326
llvm/lib/CodeGen/RegisterCoalescer.cpp
llvm/test/CodeGen/X86/coalesce-dbg-value-subreg-rewrite.mir [new file with mode: 0644]