[X86] fold select to mask instructions.
authorLuo, Yuanke <yuanke.luo@intel.com>
Fri, 26 May 2023 05:28:59 +0000 (13:28 +0800)
committerLuo, Yuanke <yuanke.luo@intel.com>
Fri, 26 May 2023 13:53:03 +0000 (21:53 +0800)
commit969c686e54501e71123f102cff280ab8fba52e06
treec13759161f3b9c2475a407448e730bd5104f298e
parentfd89df1e0a9ca5ade1d5504f0ea069dfeece2560
[X86] fold select to mask instructions.

When avx512 is available the lhs operand of select instruction can be
folded with mask instruction, while the rhs operand can't. This patch is
to commute the lhs and rhs of the select instruction to create the
opportunity of folding.

Differential Revision: https://reviews.llvm.org/D151535
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx512f-vec-test-testn.ll
llvm/test/CodeGen/X86/combine-rotates.ll
llvm/test/CodeGen/X86/paddus.ll
llvm/test/CodeGen/X86/sat-add.ll
llvm/test/CodeGen/X86/vector-bo-select-avx512.ll
llvm/test/CodeGen/X86/vector-bo-select.ll