[X86] Fix perf bug in `permilps` -> `shufd` in X86FixupInstTuning.
authorNoah Goldstein <goldstein.w.n@gmail.com>
Mon, 10 Apr 2023 00:23:23 +0000 (19:23 -0500)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Mon, 10 Apr 2023 05:16:54 +0000 (00:16 -0500)
commit2ce1698a343c599910bceed399ca7020816b230e
tree77ead760694676345a1c29478fdbcffa32eba091
parente2f65276908e6e3ca0129df08a64c973e27bcc46
[X86] Fix perf bug in `permilps` -> `shufd` in X86FixupInstTuning.

We shouldn't do the transformation if we either have bypass delay OR
the new opcode has worse performance. Previous code was incorrectly
using AND.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D147727
llvm/lib/Target/X86/X86FixupInstTuning.cpp
llvm/test/CodeGen/X86/tuning-shuffle-permilps-avx512.ll
llvm/test/CodeGen/X86/tuning-shuffle-permilps.ll