Turn a 2-address instruction into a 3-address one when it's profitable even if the...
authorEvan Cheng <evan.cheng@apple.com>
Mon, 30 Mar 2009 21:34:07 +0000 (21:34 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 30 Mar 2009 21:34:07 +0000 (21:34 +0000)
commite6f350d7558f2db6c39c0a9fc8beafb796d9919a
tree8be8aeaddc0757d52150e560092aecbc5a4062ab
parentf54229192c22559389b0ef47e731fd628db963c5
Turn a 2-address instruction into a 3-address one when it's profitable even if the two-address operand is killed.
e.g.
%reg1024<def> = MOV r1
%reg1025<def> = ADD %reg1024, %reg1026
r0            = MOV %reg1025

If it's not possible / profitable to commute ADD, then turning ADD into a LEA saves a copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68065 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/TwoAddressInstructionPass.cpp
test/CodeGen/X86/inline-asm-2addr.ll