[all-commits] [llvm/llvm-project] 37e17f: [DAG] MatchRotate - remove (redundant) legal type ...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Nov 2 04:39:05 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 37e17f278fb5eee02010d9190ed19a649ffe2646
      https://github.com/llvm/llvm-project/commit/37e17f278fb5eee02010d9190ed19a649ffe2646
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

  Log Message:
  -----------
  [DAG] MatchRotate - remove (redundant) legal type check.

Rely on the hasOperation() instead - as commented on D77804, the mid-term intention is to recognise rotate/funnel-by-constant pre-legalization to help avoid SimplifyDemandedBits regressions.


  Commit: 325031786e08cb65116fdd6f60f3342932f5f4d9
      https://github.com/llvm/llvm-project/commit/325031786e08cb65116fdd6f60f3342932f5f4d9
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/test/CodeGen/AArch64/funnel-shift.ll
    M llvm/test/CodeGen/ARM/funnel-shift-rot.ll
    M llvm/test/CodeGen/ARM/funnel-shift.ll
    M llvm/test/CodeGen/Mips/funnel-shift-rot.ll
    M llvm/test/CodeGen/Mips/funnel-shift.ll
    M llvm/test/CodeGen/PowerPC/funnel-shift-rot.ll
    M llvm/test/CodeGen/PowerPC/funnel-shift.ll
    M llvm/test/CodeGen/RISCV/rv32zbb-zbp.ll
    M llvm/test/CodeGen/RISCV/rv32zbt.ll
    M llvm/test/CodeGen/RISCV/shifts.ll
    M llvm/test/CodeGen/X86/fshl.ll
    M llvm/test/CodeGen/X86/fshr.ll
    M llvm/test/CodeGen/X86/funnel-shift-rot.ll
    M llvm/test/CodeGen/X86/funnel-shift.ll

  Log Message:
  -----------
  [SelectionDAG] Optimize expansion for rotates/funnel shifts

If the type of a funnel shift needs to be expanded, expand it to two funnel shifts instead of regular shifts. For constant shifts, this doesn't make much difference, but for variable shifts it allows a more optimal lowering.

Also use the optimized funnel shift lowering for rotates.

Alive2: https://alive2.llvm.org/ce/z/TvHDB- / https://alive2.llvm.org/ce/z/yzPept

(Branched from D108058 as getting this completed should help unlock some other WIP patches).

Original Patch: @efriedma (Eli Friedman)

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


Compare: https://github.com/llvm/llvm-project/compare/bcad20bc6591...325031786e08


More information about the All-commits mailing list