OSDN Git Service

PeepholeOptimizer: Remove redundant copies
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 25 Sep 2015 20:22:12 +0000 (20:22 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 25 Sep 2015 20:22:12 +0000 (20:22 +0000)
commit0a70893bb86b38c8efb16c69c74afdfcd49e9942
tree3a5a469e7cade46c93d1e5b2d66e4107257580d7
parentde51d0d4490a7edd93f3f3af8851451821f75482
PeepholeOptimizer: Remove redundant copies

If a virtual register is copied and another copy was already
seen, replace with the previous copy. This only handles the
simplest cases for now.

This pattern shows up from various operand restrictions
AMDGPU has which require inserting copies depending
on the register class of the operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248611 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/PeepholeOptimizer.cpp
test/CodeGen/AMDGPU/address-space.ll
test/CodeGen/AMDGPU/use-sgpr-multiple-times.ll