[PATCH] D130765: [DAG] Turn a wider range of select of constants into math

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 05:35:53 PDT 2022


deadalnix created this revision.
deadalnix added reviewers: PowerPC, laytonio, RKSimon, spatel, gchatelet, lei, nemanjai, steven.zhang.
Herald added subscribers: pengfei, kbarton, hiraditya.
Herald added a project: All.
deadalnix requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

select Cond, 0, C2 --> (zext(not Cond) << log2(C2))
select Cond, C1 <https://reviews.llvm.org/C1>, C2 --> (zext(Cond) << log2(C1 <https://reviews.llvm.org/C1> - C2)) + C2 if C1 <https://reviews.llvm.org/C1> -C2 is a power of 2.

Remove select Cond, Pow2, 0 --> (zext Cond) << log2(Pow2) because it is
a special case of what's added in this diff.

This addresses some regressions in D130675 <https://reviews.llvm.org/D130675> . It is a bit of a mixed bag for PowerPC .


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130765

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/PowerPC/fp-strict-conv-f128.ll
  llvm/test/CodeGen/PowerPC/ppc64-P9-setb.ll
  llvm/test/CodeGen/PowerPC/ppcf128-constrained-fp-intrinsics.ll
  llvm/test/CodeGen/PowerPC/pr49509.ll
  llvm/test/CodeGen/PowerPC/pzero-fp-xored.ll
  llvm/test/CodeGen/PowerPC/select_const.ll
  llvm/test/CodeGen/X86/select.ll
  llvm/test/CodeGen/X86/zext-sext.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130765.448598.patch
Type: text/x-patch
Size: 14723 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220729/4c6eee22/attachment.bin>


More information about the llvm-commits mailing list