Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AArch64][GlobalISel] Combine G_EXTRACT_VECTOR_ELT and G_BUILD_VECTOR sequences into G_SHUFFLE_VECTOR #110545

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Commits on Sep 27, 2024

  1. [GlobalISel] Remove inaccurate input vector restriction

    In the buildShuffleVector method, there is a restriction that the
    input vectors must be larger than the mask. However, this is not
    the definition of a ShuffleVector instruction that is used inside
    of our test suite.
    
    For example:
    shuffle_concat_1 in combine_shuffle_vector.mir: 4xs8 -> 16xs8
    v3s8_crash in legalize_insert_vector_elt: 3xs8 -> 12xs8
    shuffle_vector_to_concat_vector_45670123 in prelegalizercombiner-shuffle-vector: 4xs32 -> 12xs32
    ValentijnvdBeek committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    76d4bda View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2024

  1. Configuration menu
    Copy the full SHA
    0d5d582 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2024

  1. Configuration menu
    Copy the full SHA
    4f2fdcd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    633b8fc View commit details
    Browse the repository at this point in the history
  3. [AArch64][GlobalISel] Combine G_EXTRACT_VECTOR_ELT and G_BUILD_VECTOR…

    … sequences into G_SHUFFLE_VECTOR
    
    This combine tries to find all the build vectors whose source elements all originate from a G_EXTRACT_VECTOR_ELT from one or two donor vectors. One example where this may happen is for AI chips where there are a lot of matrix multiplications. Typically there vectors are disected and then  rearranged into the right transformation.
    E.g.
      %donor1(<2 x s32>) = COPY $d0
      %donor2(<2 x s32>) = COPY $d1
      %ext1 = G_EXTRACT_VECTOR_ELT %donor1, 0
      %ext2 = G_EXTRACT_VECTOR_ELT %donor1, 1
      %ext3 = G_EXTRACT_VECTOR_ELT %donor2, 0
      %ext4 = G_EXTRACT_VECTOR_ELT %donor2, 1
      %vector = G_BUILD_VECTOR %ext1, %ext2, %ext3, %ext4
      ==>
      replace with:  %vector = G_SHUFFLE_VECTOR %donor1, %donor2, shufflemask(0, 1, 2, 3)
    ValentijnvdBeek committed Oct 22, 2024
    Configuration menu
    Copy the full SHA
    f464323 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6cb6d38 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f93503c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    35500c6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1ef5773 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3bdebfa View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    baa7cd8 View commit details
    Browse the repository at this point in the history