[all-commits] [llvm/llvm-project] 4298fc: [RISCV] Move strength reduction of mul X, 3/5/9*2^...

Philip Reames via All-commits all-commits at lists.llvm.org
Wed May 8 10:13:22 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4298fc5eb5c483fb72db6fce062352087dfd0acf
      https://github.com/llvm/llvm-project/commit/4298fc5eb5c483fb72db6fce062352087dfd0acf
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2024-05-08 (Wed, 08 May 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td
    M llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
    M llvm/test/CodeGen/RISCV/addimm-mulimm.ll
    M llvm/test/CodeGen/RISCV/rv64-legal-i32/rv64zba.ll
    M llvm/test/CodeGen/RISCV/rv64zba.ll

  Log Message:
  -----------
  [RISCV] Move strength reduction of mul X, 3/5/9*2^N to combine (#89966)

This moves our last major category tablegen driven multiply strength
reduction into the post legalize combine framework. The one slightly
tricky bit is making sure that we use a leading shl if we can form a
slli.uw, and trailing shl otherwise. Having the trailing shl is critical
for shNadd matching, and folding any following sext.w.

As can be seen in the TD deltas, this allows us to kill off both the
actual multiply patterns and the explicit add (mul X, C) Y patterns. The
later are now handled by the generic shNadd matching code, with the
exception of the THead only C=200 case because we don't (yet) have a
multiply expansion with two shNadd + a shift.

---------

Co-authored-by: Yingwei Zheng <dtcxzyw at qq.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list