[X86] Teach combineTruncatedArithmetic to handle some cases of ISD::SUB
authorCraig Topper <craig.topper@intel.com>
Mon, 20 Aug 2018 20:57:35 +0000 (20:57 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 20 Aug 2018 20:57:35 +0000 (20:57 +0000)
commit7dcb2c4b0a4843f75c7c421426c872876f847aae
tree4a4b0fa1239615351f2b408ee73d498b35c6f262
parent08e7e04998b59c52dc43d8e818362436bbc216a7
[X86] Teach combineTruncatedArithmetic to handle some cases of ISD::SUB

We can safely avoid interfering with the subus combine if both inputs are freely truncatable. Either both extends, or an extend and a constant vector.

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

llvm-svn: 340212
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-trunc-math.ll