[PATCH] D142602: [X86] Expand transform (icmp eq/ne (ABS A), C) -> (and/or (icmp eq/ne A, C), (icmp eq/ne A, -C))

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 22:14:29 PST 2023


goldstein.w.n created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
goldstein.w.n requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This also makes sense if `A` is a vector type with `i64` elements but
the target doesn't have avx512 but has avx2/sse4.1 (for ymm/xmm respectively).

In that case `ABS` will expand with 3 instructions `blendv(A, sub(set0,
A))` so its better to just to transform the version with fewer/faster
instructions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142602

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/icmp-abs-C-vec.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142602.492333.patch
Type: text/x-patch
Size: 11105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230126/ae5dc8ce/attachment.bin>


More information about the llvm-commits mailing list