[all-commits] [llvm/llvm-project] b631f8: [TLI][PowerPC] Introduce TLI query to check if MUL...

Amy Kwan via All-commits all-commits at lists.llvm.org
Sat May 23 14:48:56 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b631f86ac5b9df3f87ae963415d17e35104eca86
      https://github.com/llvm/llvm-project/commit/b631f86ac5b9df3f87ae963415d17e35104eca86
  Author: Amy Kwan <amy.kwan1 at ibm.com>
  Date:   2020-05-23 (Sat, 23 May 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    M llvm/lib/Target/PowerPC/PPCISelLowering.h
    M llvm/test/CodeGen/PowerPC/loop-instr-form-prepare.ll
    M llvm/test/CodeGen/PowerPC/machine-pre.ll
    M llvm/test/CodeGen/PowerPC/ppc64-P9-mod.ll
    M llvm/test/CodeGen/PowerPC/srem-vector-lkk.ll
    M llvm/test/CodeGen/PowerPC/urem-vector-lkk.ll

  Log Message:
  -----------
  [TLI][PowerPC] Introduce TLI query to check if MULH is cheaper than MUL + SHIFT

This patch introduces a TargetLowering query, isMulhCheaperThanMulShift.

Currently in DAG Combine, it will transform mulhs/mulhu into a
wider multiply and a shift if the wide multiply is legal.

This TLI function is implemented on 64-bit PowerPC, as it is more desirable to
have multiply-high over multiply + shift for words and doublewords. Having
multiply-high can also aid in further transformations that can be done.

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




More information about the All-commits mailing list