AMDGPU: Fix verifier error in SIFoldOperands
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 21 Oct 2015 22:37:50 +0000 (22:37 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 21 Oct 2015 22:37:50 +0000 (22:37 +0000)
commitcaa831cabdbcf3cc5fc0da946e44786b600042bb
treee2a1a59c2697f0cef8e85116d011c75e0ff22c6a
parent07437a8e790e2bde6b76e0a15e5c39b9f5431052
AMDGPU: Fix verifier error in SIFoldOperands

There may be other use operands that also need their kill flags cleared.

This happens in a few tests when SIFoldOperands is moved after
PeepholeOptimizer.

PeepholeOptimizer rewrites cases that look like:
%vreg0 = ...
%vreg1 = COPY %vreg0
use %vreg1<kill>
%vreg2 = COPY %vreg0
use %vreg2<kill>

to use the earlier source to
%vreg0 = ...
use %vreg0
use %vreg0

Currently SIFoldOperands sees the copied registers, so there is
only one use. So far I haven't managed to come up with a test
that currently has multiple uses of a foldable VGPR -> VGPR copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250960 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIFoldOperands.cpp
test/CodeGen/AMDGPU/si-instr-info-correct-implicit-operands.ll