[X86] Attempt to fold EFLAGS into X86ISD::ADD/SUB ops
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 17 May 2022 09:59:14 +0000 (10:59 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 17 May 2022 09:59:24 +0000 (10:59 +0100)
commitc64f5d44ad3bebeaccceb20b2730b4e65bb87297
treeec00d62b3cde0c6fce0bea0adc7c6edac0355ddd
parentb250cca11d5996ed01d72cb1f933867da0e8d5e0
[X86] Attempt to fold EFLAGS into X86ISD::ADD/SUB ops

We already use combineAddOrSubToADCOrSBB to fold extended EFLAGS results into ISD::ADD/SUB ops as X86ISD::ADC/SBB carry ops.

This patch extends this to also try to fold EFLAGS results with X86ISD::ADD/SUB ops

Differential Revision: https://reviews.llvm.org/D125642
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/add-sub-bool.ll
llvm/test/CodeGen/X86/addcarry.ll
llvm/test/CodeGen/X86/combine-sbb.ll
llvm/test/CodeGen/X86/subcarry.ll