[all-commits] [llvm/llvm-project] 5e963a: Rehome an orphaned comment [NFC]

Sanne Wouda via All-commits all-commits at lists.llvm.org
Mon Mar 8 08:37:24 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5e963a24415eb88d512eb74c8addf87051f7969a
      https://github.com/llvm/llvm-project/commit/5e963a24415eb88d512eb74c8addf87051f7969a
  Author: Sanne Wouda <Sanne.Wouda at arm.com>
  Date:   2021-03-08 (Mon, 08 Mar 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp

  Log Message:
  -----------
  Rehome an orphaned comment [NFC]

As seen in 35827164c4, the "shuffle x, x, mask" comment has drifted away
from the implementation of the pattern. Put it back.


  Commit: 05a6e2eb9a412db22309031d2326bf6a3aa0c90c
      https://github.com/llvm/llvm-project/commit/05a6e2eb9a412db22309031d2326bf6a3aa0c90c
  Author: Sanne Wouda <Sanne.Wouda at arm.com>
  Date:   2021-03-08 (Mon, 08 Mar 2021)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
    A llvm/test/Transforms/InstCombine/shuffle-cast-dist.ll

  Log Message:
  -----------
  [InstCombine] Add a combine for a shuffle of similar bitcasts

Some intrinsics wrapper code has the habit of ignoring the type of the
elements in vectors, thinking of vector registers as a "bag of bits". As
a consequence, some operations are shared between vectors of different
types are shared. For example, functions that rearrange elements in a
vector can be shared between vectors of int32 and float.

This can result in bitcasts in awkward places that prevent the backend
from recognizing some instructions. For AArch64 in particular, it
inhibits the selection of dup from a general purpose register (GPR), and
mov from GPR to a vector lane.

This patch adds a pattern in InstCombine to move the bitcasts past the
shufflevector if this is possible. Sometimes this even allows
InstCombine to remove the bitcast entirely, as in the included tests.

Alternatively this could be done with a few extra patterns in the
AArch64 backend, but InstCombine seems like a better place for this.

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


Compare: https://github.com/llvm/llvm-project/compare/dc4ca9b0d43a...05a6e2eb9a41


More information about the All-commits mailing list