[all-commits] [llvm/llvm-project] bf8207: [SDAG] try to avoid multiply for X*Y==0

Sanjay Patel via All-commits all-commits at lists.llvm.org
Fri Jan 6 06:07:47 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bf82070ea465969e9ae86a31dfcbf94c2a7b4c4c
      https://github.com/llvm/llvm-project/commit/bf82070ea465969e9ae86a31dfcbf94c2a7b4c4c
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2023-01-06 (Fri, 06 Jan 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/AArch64/aarch64-dup-ext.ll
    M llvm/test/CodeGen/AArch64/mul-cmp.ll
    M llvm/test/CodeGen/X86/mul-cmp.ll

  Log Message:
  -----------
  [SDAG] try to avoid multiply for X*Y==0

Forking this off from D140850 -
https://alive2.llvm.org/ce/z/TgBeK_
https://alive2.llvm.org/ce/z/STVD7d

We could almost justify doing this in IR, but consideration for
"minsize" requires that we only try it in codegen -- the
transform is not reversible.

In all other cases, avoiding multiply should be a win because a
mul is more expensive than simple/parallelizable compares. AArch
even has a trick to keep instruction count even for some types.

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




More information about the All-commits mailing list