[x86] add special-case lowering for usubsat for AVX512
authorSanjay Patel <spatel@rotateright.com>
Wed, 20 Oct 2021 20:09:15 +0000 (16:09 -0400)
committerSanjay Patel <spatel@rotateright.com>
Wed, 20 Oct 2021 20:41:13 +0000 (16:41 -0400)
commit40163f1df8c60f987e8adc0cb78edb289f73b771
tree54271a0a48e59837cf3f00c0f2763312b10e8322
parent048688fd80fadce1c72c365b0d74599a33389cfb
[x86] add special-case lowering for usubsat for AVX512

This is a small extension of D112095 to avoid another regression
seen with D112085.
In this case, we allow the same conversion from usubsat to ALU
ops if the target supports vpternlog.

That pattern will get converted later in X86DAGToDAGISel::tryVPTERNLOG().
This seems better than putting a magic immediate constant directly in
this code to create the exact vpternlog that we need. It's possible that
there are other special-cases along these lines, so we should try to
keep all of the vpternlog magic in one place.

Differential Revision: https://reviews.llvm.org/D112138
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/psubus.ll