| commit | c6ff2446a4650f23afc9faffb55020aa68cf678c | [log] [tgz] |
|---|---|---|
| author | Matthias Springer <me@m-sp.org> | Wed Jun 19 09:58:37 2024 +0200 |
| committer | GitHub <noreply@github.com> | Wed Jun 19 09:58:37 2024 +0200 |
| tree | 25e4e12975f4805b0946bcff7f48a2bb91fc5db5 | |
| parent | bacbf26b4cb64dbf77819ff5a2b0f4c26d111c66 [diff] |
[mlir][vector] Add `vector.from_elements` op (#95938) This commit adds a new operation to the vector dialect: `vector.from_elements` The op constructs a new vector from a given list of scalar values. It is similar to `tensor.from_elements`. ```mlir %0 = vector.from_elements %a, %b, %c, %a, %a, %a : vector<2x3xf32> ``` Constructing a new vector from elements was tedious before this op existed: a typical way was to define an `arith.constant ... : vector<...>`, followed by a chain of `vector.insert`. Folders/canonicalizations are added that can fold `vector.extract` ops and convert the `vector.from_elements` op into a `vector.splat` op. The LLVM lowering generates an `llvm.mlir.undef`, followed by a sequence of scalar insertions in the form of `llvm.insertelement`. Only 0-D and 1-D vectors are currently supported in the LLVM lowering.
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.