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

[mlir][ArmSME] Pattern to swap shape_cast(tranpose) with transpose(shape_cast) #100731

Merged
merged 2 commits into from
Jul 26, 2024

Commits on Jul 26, 2024

  1. [mlir][ArmSME] Pattern to swap shape_cast(tranpose) with transpose(sh…

    …ape_cast)
    
    This applies when the shape_cast is simply for dropping unit dims, and
    the result rank is >= 2.
    
    This simplifies the transpose making it possible for other ArmSME
    legalization patterns to handle it.
    
    Example:
    
    ```mlir
    %0 = vector.transpose %vector, [3, 0, 1, 2]
           : vector<1x1x4x[4]xf32> to vector<[4]x1x1x4xf32>
    %1 = vector.shape_cast %0 : vector<[4]x1x1x4xf32> to vector<[4]x4xf32>
    ```
    
    ```mlir
    %0 = vector.shape_cast %arg0 : vector<1x1x4x[4]xf32> to vector<4x[4]xf32>
    %1 = vector.transpose %0, [1, 0] : vector<4x[4]xf32> to vector<[4]x4xf32>
    ```
    MacDue committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    f91360b View commit details
    Browse the repository at this point in the history
  2. Review fixups

    MacDue committed Jul 26, 2024
    Configuration menu
    Copy the full SHA
    4b4a3aa View commit details
    Browse the repository at this point in the history