[all-commits] [llvm/llvm-project] 179414: [TargetLowering] Improve expansion of FSHL/FSHR

jayfoad via All-commits all-commits at lists.llvm.org
Thu May 14 08:36:48 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 17941437a2ed8abefef719345391da94e6df8ebb
      https://github.com/llvm/llvm-project/commit/17941437a2ed8abefef719345391da94e6df8ebb
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2020-05-14 (Thu, 14 May 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/X86/fshl.ll
    M llvm/test/CodeGen/X86/fshr.ll

  Log Message:
  -----------
  [TargetLowering] Improve expansion of FSHL/FSHR

Use an extra shift-by-1 instead of a compare and select to handle the
shift-by-zero case. This sometimes saves one instruction (if the compare
couldn't be combined with a previous instruction). It also works better
on targets that don't have good select instructions.

Note that currently this change doesn't affect most targets because
expandFunnelShift is not used because funnel shift intrinsics are
lowered early in SelectionDAGBuilder. But there is work afoot to change
that; see D77152.

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




More information about the All-commits mailing list