]> granicus.if.org Git - llvm/commit
Merging r360293:
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 5 Jun 2019 21:43:28 +0000 (21:43 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 5 Jun 2019 21:43:28 +0000 (21:43 +0000)
commitb62d86c829703ac35cc2fd2516c3b10495f14aa7
tree6ccefd5582163928af7ec6cfa211612d82dfcebe
parentd3708b919620411c4d5d9d57e379e3da48619d94
Merging r360293:
------------------------------------------------------------------------
r360293 | arsenm | 2019-05-08 15:09:57 -0700 (Wed, 08 May 2019) | 21 lines

AMDGPU: Select VOP3 form of add

The VOP3 form should always be the preferred selection, to be shrunk
later. This should only be an optimization issue, but this partially
works around a problem from clobbering VCC when SIFixSGPRCopies
rewrites an SCC defining operation directly to VCC.

3 of the testcases are regressions from failing to fold the immediate
in cases it should. These can be avoided by improving the VCC liveness
handling in SIFoldOperands. Simply increasing the threshold to
computeRegisterLiveness works, although this is common enough that VCC
liveness should probably be tracked throughout the pass. The hack of
leaving behind an implicit_def instruction to avoid breaking iterator
wastes instruction count, which inhibits finding the VCC def in long
chains of adds. Doing this however exposes different, worse looking
regressions from poor scheduling behavior. This could probably be
avoided around by forcing the shrink of the addc here, but the
scheduler should probably be fixed.

The r600 add test needs to be split out because it asserts on the
arguments in the new test during the calling convention lowering.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_80@362658 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/VOP2Instructions.td
test/CodeGen/AMDGPU/add.ll
test/CodeGen/AMDGPU/ds-negative-offset-addressing-mode-loop.ll
test/CodeGen/AMDGPU/fence-barrier.ll
test/CodeGen/AMDGPU/llvm.amdgcn.update.dpp.ll
test/CodeGen/AMDGPU/r600.add.ll [new file with mode: 0644]
test/CodeGen/AMDGPU/salu-to-valu.ll
test/tools/llvm-objdump/AMDGPU/source-lines.ll