OSDN Git Service

now that addc/adde are gone, "ADDC" in the X86 backend uses EFLAGS results,
authorChris Lattner <sabre@nondot.org>
Mon, 20 Dec 2010 01:37:09 +0000 (01:37 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 20 Dec 2010 01:37:09 +0000 (01:37 +0000)
commit23a0199f05fe61c4bde921d5729ed2b927657bcb
tree8e8ed38c5ca3e41a97332cc4730c770590d79dd8
parent636f15ff04c9188ea3bf91477fda1cc29f2c4a61
now that addc/adde are gone, "ADDC" in the X86 backend uses EFLAGS results,
the same as setcc.  Optimize ADDC(0,0,FLAGS) -> SET_CARRY(FLAGS).  This is
a step towards finishing off PR5443.  In the testcase in that bug we now  get:

movq %rdi, %rax
addq %rsi, %rax
sbbq %rcx, %rcx
testb $1, %cl
setne %dl
ret

instead of:

movq %rdi, %rax
addq %rsi, %rax
movl $0, %ecx
adcq $0, %rcx
testq %rcx, %rcx
setne %dl
ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122219 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/add.ll