[all-commits] [llvm/llvm-project] 777a58: Support {S, U}REMEqFold before legalization

Simonas Kazlauskas via All-commits all-commits at lists.llvm.org
Wed Mar 31 15:35:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 777a58e05b22973d902e78091a2e06b99c71b65c
      https://github.com/llvm/llvm-project/commit/777a58e05b22973d902e78091a2e06b99c71b65c
  Author: Simonas Kazlauskas <git at kazlauskas.me>
  Date:   2021-04-01 (Thu, 01 Apr 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/AArch64/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/AArch64/srem-seteq-vec-nonsplat.ll
    M llvm/test/CodeGen/AArch64/srem-seteq-vec-splat.ll
    M llvm/test/CodeGen/AArch64/srem-seteq.ll
    M llvm/test/CodeGen/AArch64/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/AArch64/urem-seteq-nonzero.ll
    M llvm/test/CodeGen/AArch64/urem-seteq-vec-nonsplat.ll
    M llvm/test/CodeGen/AArch64/urem-seteq-vec-nonzero.ll
    M llvm/test/CodeGen/AArch64/urem-seteq-vec-splat.ll
    M llvm/test/CodeGen/AArch64/urem-seteq.ll
    M llvm/test/CodeGen/AMDGPU/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/AMDGPU/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/ARM/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/ARM/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/Mips/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/Mips/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/PowerPC/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/PowerPC/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/RISCV/rvv/vmulh-sdnode-rv32.ll
    M llvm/test/CodeGen/RISCV/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/RISCV/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/Thumb/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/Thumb/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/Thumb2/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/Thumb2/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/X86/omit-urem-of-power-of-two-or-zero-when-comparing-with-zero.ll
    M llvm/test/CodeGen/X86/srem-seteq-illegal-types.ll
    M llvm/test/CodeGen/X86/srem-seteq-vec-nonsplat.ll
    M llvm/test/CodeGen/X86/srem-seteq-vec-splat.ll
    M llvm/test/CodeGen/X86/urem-seteq-illegal-types.ll
    M llvm/test/CodeGen/X86/urem-seteq-nonzero.ll
    M llvm/test/CodeGen/X86/urem-seteq-vec-nonsplat.ll
    M llvm/test/CodeGen/X86/urem-seteq-vec-nonzero.ll
    M llvm/test/CodeGen/X86/urem-seteq-vec-splat.ll

  Log Message:
  -----------
  Support {S,U}REMEqFold before legalization

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). The legalization then
later can happen more directly and generated code gets a chance to avoid
wasting time on computing results in types wider than necessary, in the end.

Seems like mostly an improvement in terms of results at least as far as x86_64 and aarch64 are concerned, with a few regressions here and there. It also helps in preventing regressions in changes like {D87976}.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D88785




More information about the All-commits mailing list