[all-commits] [llvm/llvm-project] 4af45f: [GlobalISel] Fold or of shifts to funnel shift.

Abinav Puthan Purayil via All-commits all-commits at lists.llvm.org
Fri Nov 26 04:04:16 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4af45f10cccbaabc87758c4dc50b94bfd31fe848
      https://github.com/llvm/llvm-project/commit/4af45f10cccbaabc87758c4dc50b94bfd31fe848
  Author: Abinav Puthan Purayil <abinav.puthanpurayil at amd.com>
  Date:   2021-11-26 (Fri, 26 Nov 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
    M llvm/include/llvm/Target/GlobalISel/Combine.td
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    A llvm/test/CodeGen/AMDGPU/GlobalISel/combine-fsh.mir
    A llvm/test/CodeGen/AMDGPU/GlobalISel/combine-rot.mir

  Log Message:
  -----------
  [GlobalISel] Fold or of shifts to funnel shift.

This change folds a basic funnel shift idiom:
- (or (shl x, amt), (lshr y, sub(bw, amt))) -> fshl(x, y, amt)
- (or (shl x, sub(bw, amt)), (lshr y, amt)) -> fshr(x, y, amt)

This also helps in folding to rotate shift if x and y are equal since we
already have a funnel shift to rotate combine.

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




More information about the All-commits mailing list