AMDGPU: Fix producing saveexec when the copy is spilled
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 14 Nov 2017 02:16:54 +0000 (02:16 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 14 Nov 2017 02:16:54 +0000 (02:16 +0000)
commit57c37b2dcd5959660ebab63ca049c8de4da116c7
treecec4daf8d2f4bce662555e759ee701f39d05ee9c
parenta8bd4e3816a0c54411cc97d264de72ccc5333098
AMDGPU: Fix producing saveexec when the copy is spilled

If the register from the copy from exec was spilled,
the copy before the spill was deleted leaving a spill
of undefined register verifier error and miscompiling.
Check for other use instructions of the copy register.

llvm-svn: 318132
llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp
llvm/test/CodeGen/AMDGPU/undefined-physreg-sgpr-spill.mir [new file with mode: 0644]