[PATCH] D142601: [DAGCombiner]: Add transform (and/or (icmp eq/ne (A, C)), (icmp eq/ne (A, -C))) -> (icmp eq/ne (ABS A), ABS(C))

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


goldstein.w.n created this revision.
Herald added subscribers: ecnelises, 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 can be beneficial if there is a fast `ABS` (For example with X86
`vpabs`) or if there is a dominating ABS(A) in the `DAG`.

Note `C` is constant so `ABS(C)` is just a constant.

Alive2 Links:
EQ: https://alive2.llvm.org/ce/z/829F-c
NE: https://alive2.llvm.org/ce/z/tsS8bU


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142601

Files:
  llvm/include/llvm/CodeGen/TargetLowering.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Target/X86/X86ISelLowering.h
  llvm/test/CodeGen/X86/icmp-abs-C-vec.ll
  llvm/test/CodeGen/X86/icmp-abs-C.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142601.492332.patch
Type: text/x-patch
Size: 24739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230126/24dff03c/attachment.bin>


More information about the llvm-commits mailing list