canonicalize constants to the RHS of addc/adde. If nothing uses the carry out of
authorChris Lattner <sabre@nondot.org>
Sun, 4 Mar 2007 20:03:15 +0000 (20:03 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 4 Mar 2007 20:03:15 +0000 (20:03 +0000)
commit91153686f04bafe3b10c99edb1735444953f7517
treec10b76d5ab01bcb6db46ce33a76b1861d70813e3
parent175415e116feef0def0f7c084cca3646a403412b
canonicalize constants to the RHS of addc/adde.  If nothing uses the carry out of
addc, turn it into add.

This allows us to compile:

long long test(long long A, unsigned B) {
  return (A + ((long long)B << 32)) & 123;
}

into:

_test:
        movl $123, %eax
        andl 4(%esp), %eax
        xorl %edx, %edx
        ret

instead of:
_test:
        xorl %edx, %edx
        movl %edx, %eax
        addl 4(%esp), %eax   ;; add of zero
        andl $123, %eax
        ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34909 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp