[PATCH] D137422: [DAGCombine] Generalize foldSelectCCToShiftAnd

Mikhail Gudim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 05:39:24 PST 2022


mgudim updated this revision to Diff 482823.
mgudim added a comment.

Implemented approach suggested by @reames : instead of considering all the possible cases, assume that the zero constant always appears as the "false" option of select and if not, invert the comparison, switch the true and false option and call `foldSelectCCToShiftAnd` recursively.

Updated test to run all the way to final assembly.


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

https://reviews.llvm.org/D137422

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/arm64-fmax.ll
  llvm/test/CodeGen/RISCV/select-to-shift-and.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137422.482823.patch
Type: text/x-patch
Size: 5014 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221214/ca8d5717/attachment.bin>


More information about the llvm-commits mailing list