[X86] Emit SBB instead of SETCC_CARRY from LowerSELECT. Break false dependency on...
authorCraig Topper <craig.topper@intel.com>
Wed, 12 Dec 2018 19:20:21 +0000 (19:20 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 12 Dec 2018 19:20:21 +0000 (19:20 +0000)
commit4937adf75f024f5cbd3cc190d5bd57d1761aefc3
treed7a7794e50161f74cfd6aa0c008d32296392121b
parent2ef6c46b2f9a2f9dce73d7b15bf837a2feb0bd8a
[X86] Emit SBB instead of SETCC_CARRY from LowerSELECT. Break false dependency on the SBB input.

I'm hoping we can just replace SETCC_CARRY with SBB. This is another step towards that.

I've explicitly used zero as the input to the setcc to avoid a false dependency that we've had with the SETCC_CARRY. I changed one of the patterns that used NEG to instead use an explicit compare with 0 on the LHS. We needed the zero anyway to avoid the false dependency. The negate would clobber its input register. By using a CMP we can avoid that which could be useful.

Differential Revision: https://reviews.llvm.org/D55414

llvm-svn: 348959
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86InstrCompiler.td
llvm/test/CodeGen/X86/pr35972.ll
llvm/test/CodeGen/X86/scheduler-backtracking.ll
llvm/test/CodeGen/X86/select.ll
llvm/test/CodeGen/X86/shl-crash-on-legalize.ll
llvm/test/CodeGen/X86/vector-compare-any_of.ll