[PATCH] D88785: Support {S,U}REMEqFold before legalization

Simonas Kazlauskas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 3 11:33:04 PDT 2020


nagisa created this revision.
nagisa added reviewers: efriedma, lebedev.ri, nikic.
Herald added subscribers: llvm-commits, pengfei, hiraditya, kristof.beyls.
Herald added a project: LLVM.
nagisa requested review of this revision.

This allows these optimisations to apply to e.g. `urem i16` directly
before `urem` is promoted to i32 on architectures where i16 operations
are not intrinsically legal (such as on Aarch64).

Seems like a mixed bag in terms of results. For example tautological {s,u}rem-eq appears to be
worse on both x86_64 and aarch64, while some others (especially vector) operations are better.
However, it also prevents regressions in changes like D87976: Support the division-by-constant strength reduction for more integer types <https://reviews.llvm.org/D87976>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88785

Files:
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/AArch64/srem-seteq-vec-nonsplat.ll
  llvm/test/CodeGen/AArch64/srem-seteq-vec-splat.ll
  llvm/test/CodeGen/AArch64/srem-seteq.ll
  llvm/test/CodeGen/AArch64/urem-seteq-nonzero.ll
  llvm/test/CodeGen/AArch64/urem-seteq-vec-nonsplat.ll
  llvm/test/CodeGen/AArch64/urem-seteq-vec-nonzero.ll
  llvm/test/CodeGen/AArch64/urem-seteq-vec-splat.ll
  llvm/test/CodeGen/AArch64/urem-seteq-vec-tautological.ll
  llvm/test/CodeGen/AArch64/urem-seteq.ll
  llvm/test/CodeGen/X86/omit-urem-of-power-of-two-or-zero-when-comparing-with-zero.ll
  llvm/test/CodeGen/X86/srem-seteq-vec-nonsplat.ll
  llvm/test/CodeGen/X86/srem-seteq-vec-splat.ll
  llvm/test/CodeGen/X86/urem-seteq-nonzero.ll
  llvm/test/CodeGen/X86/urem-seteq-vec-nonsplat.ll
  llvm/test/CodeGen/X86/urem-seteq-vec-nonzero.ll
  llvm/test/CodeGen/X86/urem-seteq-vec-splat.ll
  llvm/test/CodeGen/X86/urem-seteq-vec-tautological.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88785.295993.patch
Type: text/x-patch
Size: 509958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201003/9254b149/attachment-0001.bin>


More information about the llvm-commits mailing list