Minor optimization:
authorEvan Cheng <evan.cheng@apple.com>
Sun, 1 Mar 2009 02:03:43 +0000 (02:03 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sun, 1 Mar 2009 02:03:43 +0000 (02:03 +0000)
commit870b80722f7ce3232dd45e95cff663d177e0acc0
treea0a428b5e0b242fc7933c68473a838892e767434
parent890484984bd0d3a5f9d80808b0d251424c7ddf7a
Minor optimization:

Look for situations like this:
%reg1024<def> = MOV r1
%reg1025<def> = MOV r0
%reg1026<def> = ADD %reg1024, %reg1025
r0            = MOV %reg1026
Commute the ADD to hopefully eliminate an otherwise unavoidable copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65752 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TwoAddressInstructionPass.cpp
test/CodeGen/X86/twoaddr-coalesce-2.ll [new file with mode: 0644]
test/CodeGen/X86/twoaddr-coalesce.ll