[all-commits] [llvm/llvm-project] a12829: GlobalISel: Make type for lower action more consis...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Aug 17 13:25:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a128292b90189ca3b802e9035f896e9b454ce366
      https://github.com/llvm/llvm-project/commit/a128292b90189ca3b802e9035f896e9b454ce366
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2020-08-17 (Mon, 17 Aug 2020)

  Changed paths:
    M llvm/docs/GlobalISel/Legalizer.rst
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp

  Log Message:
  -----------
  GlobalISel: Make type for lower action more consistently optional

Some of the lower implementations were relying on this, however the
type was not set depending on which form .lower* helper form you were
using. For instance, if you used an unconditonal lower(), the type was
never set. Most of the lower actions do not benefit from a type
parameter, and just expand in terms of the original operation's types.

However, some lowerings could benefit from an additional type hint to
combine a promotion and an expansion. An example of this is for
add/sub sat. The DAG integer legalization tries to use smarter
expansions directly when promoting the integer type, and doesn't
always produce the same instruction with a wider type.

Treat this as an optional hint argument, that only means something for
specific lower actions. It may be useful to generalize this mechanism
to pass a full list of type indexes and desired types, but I haven't
run into a case like that yet.




More information about the All-commits mailing list