[all-commits] [llvm/llvm-project] 64bef1: [GlobalISel] Look through truncs and extends in na...

Konstantin Schwarz via All-commits all-commits at lists.llvm.org
Tue Aug 10 04:50:19 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64bef13f083b3d9808beb9456c5bf65434ff748d
      https://github.com/llvm/llvm-project/commit/64bef13f083b3d9808beb9456c5bf65434ff748d
  Author: Konstantin Schwarz <konstantin.schwarz at hightec-rt.com>
  Date:   2021-08-10 (Tue, 10 Aug 2021)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/arm64-atomic-128.ll
    M llvm/test/CodeGen/AArch64/GlobalISel/legalize-and.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/legalize-bswap.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir
    M llvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
    M llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
    M llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp

  Log Message:
  -----------
  [GlobalISel] Look through truncs and extends in narrowScalarShift

If a G_SHL is fed by a G_CONSTANT, the lower and upper bits of the source can be
shifted individually by the constant shift amount.

However in case the shift amount came from a G_TRUNC(G_CONSTANT), the generic shift legalization
code was used, producing intermediate shifts that are potentially illegal on some targets.

This change teaches narrowScalarShift to look through G_TRUNCs and G_*EXTs.

Reviewed By: paquette

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




More information about the All-commits mailing list