[all-commits] [llvm/llvm-project] a52206: [SDAG] Convert FSHL <--> FSHR if the target only s...

jayfoad via All-commits all-commits at lists.llvm.org
Mon Aug 24 09:48:16 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a52206769234b38e67373ca5f5a2bfa7ff1ea664
      https://github.com/llvm/llvm-project/commit/a52206769234b38e67373ca5f5a2bfa7ff1ea664
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2020-08-24 (Mon, 24 Aug 2020)

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

  Log Message:
  -----------
  [SDAG] Convert FSHL <--> FSHR if the target only supports one of them

D77152 tried to do this but got it wrong in the shift-by-zero case.
D86430 reverted the wrong code. Reimplement the optimization with
different code depending on whether the shift amount is known to be
non-zero (modulo bitwidth).

This improves code quality for fshl tests on AMDGPU, which only has an
fshr instruction.

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




More information about the All-commits mailing list