[PATCH] D151750: [DAGCombine] `select_cc seteq X, 0, 0, cttz_zero_undef(X) -> and(cttz(X), sizeof(X) - 1)`

Mikhail Gudim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 08:31:39 PDT 2023


mgudim updated this revision to Diff 527058.
mgudim added a comment.
Herald added subscribers: kerbowa, jrtc27, fedor.sergeev, jvesely, jyknight.

(1) Added check for legality of `AND`
(2) Made the check before insertion of `AND` stronger. Previous check could be not enough if the type size was not a power of 2.
(3) Updated affected tests


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151750/new/

https://reviews.llvm.org/D151750

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/fold-csel-cttz-and.ll
  llvm/test/CodeGen/AMDGPU/ctlz_zero_undef.ll
  llvm/test/CodeGen/SPARC/cttz.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151750.527058.patch
Type: text/x-patch
Size: 9335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230531/60a6d7bd/attachment.bin>


More information about the llvm-commits mailing list