commit | 1a44f38d2af8724e9819f03d4b76a50615217a8d | [log] [tgz] |
---|---|---|
author | James Newling <james.newling@gmail.com> | Thu May 01 15:50:55 2025 -0700 |
committer | GitHub <noreply@github.com> | Thu May 01 15:50:55 2025 -0700 |
tree | 670c93ea3ea0e5fc312ec2239b61dd76181fb548 | |
parent | ed8d4fe0b1d8088bd1a4f99f77afe33f435ef668 [diff] |
[mlir][vector] Canonicalize/fold 'order preserving' transposes (#135841) Handles special case where transpose doesn't permute any non-1 dimensions (and so is effectively a shape_cast) and is adjacent to a shape_cast that it can fold into. For example ``` %1 = vector.transpose %0, [1, 0, 3, 2] : vector<4x1x1x6xf32> to vector<1x4x6x1xf32> ``` can be folded into an adjacent shape_cast. An alternative to this PR would be to canonicalize such transposes to shape_casts directly, but I think it'll be difficult getting consensus that shape_cast is 'more canonical' than transpose, so this PR compromises with the less opinionated claim that 1) shape_cast is more canonical than shape_cast(transpose) 2) shape_cast is more canonical than transpose(shape_cast) The pattern `ConvertIllegalShapeCastOpsToTransposes` that is specific to transposes with scalable dimensions reverses the canonicalization added here, so I've I've disabled this canonicalization for scalable vectors
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.