[PATCH] D69157: [X86] Prefer KORTEST on Knights Landing or later for memcmp()

David Zarzycki via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 21:24:18 PDT 2019


davezarzycki created this revision.
davezarzycki added reviewers: craig.topper, RKSimon, spatel.
davezarzycki added a project: LLVM.

PTEST and especially the MOVMSK instructions are slow on Knights Landing or later. As a bonus, this patch increases instruction parallelism by emitting.

  KORTEST(PCMPNEQ(a, b), PCMPNEQ(c, d)) == 0

Instead of:

  KORTEST(AND(PCMPEQ(a, b), PCMPEQ(c, d))) == ~0


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69157

Files:
  lib/Target/X86/X86.td
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86Subtarget.h
  lib/Target/X86/X86TargetTransformInfo.h
  test/CodeGen/X86/memcmp.ll
  test/CodeGen/X86/setcc-wide-types.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69157.225566.patch
Type: text/x-patch
Size: 26146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191018/11ac13ff/attachment.bin>


More information about the llvm-commits mailing list