[all-commits] [llvm/llvm-project] 35950f: [GlobalISel] support narrow G_IMPLICIT_DEF for Dst...

Dominik Montada via All-commits all-commits at lists.llvm.org
Wed Apr 8 02:00:12 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 35950fea8d4f175d04aa27e5e0350e28bef36429
      https://github.com/llvm/llvm-project/commit/35950fea8d4f175d04aa27e5e0350e28bef36429
  Author: Dominik Montada <dominik.montada at hightec-rt.com>
  Date:   2020-04-08 (Wed, 08 Apr 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    A llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-implicit-def-s1025.mir
    M llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-implicit-def.mir
    M llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp

  Log Message:
  -----------
  [GlobalISel] support narrow G_IMPLICIT_DEF for DstSize % NarrowSize != 0

Summary:
When narrowing G_IMPLICIT_DEF where the original size is not a multiple
of the narrow size, emit a smaller G_IMPLICIT_DEF and use G_ANYEXT.

To prevent a potential endless loop in the legalizer, the condition
to combine G_ANYEXT(G_IMPLICIT_DEF) is changed from isInstUnsupported
to !isInstLegal, since in this case the combine is only valid if
consequent legalization of the newly combined G_IMPLICIT_DEF does not
introduce G_ANYEXT due to narrowing.

Although this legalization for G_IMPLICIT_DEF would also be valid for
the general case, it actually caused a lot of code regressions when
tried due to superfluous COPYs and combines not getting hit anymore.

Reviewers: dsanders, aemerson, volkan, arsenm, aditya_nandakumar

Reviewed By: arsenm

Subscribers: jvesely, nhaehnle, kerbowa, wdng, rovka, hiraditya, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list