[PATCH] D149383: [SelectionDAG][WIP] Add support for evaluating SetCC based on knownbits

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 14:29:10 PDT 2023


goldstein.w.n created this revision.
goldstein.w.n added reviewers: RKSimon, pengfei, craig.topper.
Herald added subscribers: luke, foad, armkevincheng, sjarus, eric-k256, frasercrmck, ecnelises, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
Herald added a project: All.
goldstein.w.n requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, MaskRay.
Herald added a project: LLVM.

In some cases folds done through ISel/DAGCombining result in SetCC
conditions that we can easily simplify using known bits.

This patch adds support for that.

NB: The medium-term goal is to get this patch in, then use comparisons
against zero for testing future improvements to `isKnownNeverZero` as
there are issues using `cttz`/`ctlz` for that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149383

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/test/CodeGen/AArch64/aarch64-split-and-bitmask-immediate.ll
  llvm/test/CodeGen/AArch64/andcompare.ll
  llvm/test/CodeGen/AArch64/cmp-const-max.ll
  llvm/test/CodeGen/AArch64/hoist-and-by-const-from-shl-in-eqcmp-zero.ll
  llvm/test/CodeGen/AArch64/pr59902.ll
  llvm/test/CodeGen/AArch64/urem-seteq-vec-tautological.ll
  llvm/test/CodeGen/ARM/bfi.ll
  llvm/test/CodeGen/ARM/cmp-peephole.ll
  llvm/test/CodeGen/ARM/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll
  llvm/test/CodeGen/ARM/hoist-and-by-const-from-shl-in-eqcmp-zero.ll
  llvm/test/CodeGen/ARM/sub-cmp-peephole.ll
  llvm/test/CodeGen/Hexagon/vect/zext-v4i1.ll
  llvm/test/CodeGen/Lanai/sub-cmp-peephole.ll
  llvm/test/CodeGen/RISCV/fpclamptosat.ll
  llvm/test/CodeGen/RISCV/sextw-removal.ll
  llvm/test/CodeGen/SystemZ/int-cmp-46.ll
  llvm/test/CodeGen/SystemZ/int-cmp-47.ll
  llvm/test/CodeGen/Thumb/cmp-and-fold.ll
  llvm/test/CodeGen/X86/2007-10-12-CoalesceExtSubReg.ll
  llvm/test/CodeGen/X86/2012-08-17-legalizer-crash.ll
  llvm/test/CodeGen/X86/avx512-mask-op.ll
  llvm/test/CodeGen/X86/cmp.ll
  llvm/test/CodeGen/X86/fold-rmw-ops.ll
  llvm/test/CodeGen/X86/hoist-and-by-const-from-shl-in-eqcmp-zero.ll
  llvm/test/CodeGen/X86/is_fpclass-fp80.ll
  llvm/test/CodeGen/X86/omit-urem-of-power-of-two-or-zero-when-comparing-with-zero.ll
  llvm/test/CodeGen/X86/or-with-overflow.ll
  llvm/test/CodeGen/X86/pr16031.ll
  llvm/test/CodeGen/X86/pr28444.ll
  llvm/test/CodeGen/X86/select.ll
  llvm/test/CodeGen/X86/shrink-compare-pgso.ll
  llvm/test/CodeGen/X86/shrink-compare.ll
  llvm/test/CodeGen/X86/smul_fix_sat_constants.ll
  llvm/test/CodeGen/X86/vector-mulfix-legalize.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149383.517717.patch
Type: text/x-patch
Size: 79697 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230427/fdf1a254/attachment.bin>


More information about the llvm-commits mailing list