commit | 4abff4d7b2b49f343da68f32ffdae2914ba8ae7f | [log] [tgz] |
---|---|---|
author | Matthias Springer <me@m-sp.org> | Fri Mar 28 14:18:54 2025 +0100 |
committer | GitHub <noreply@github.com> | Fri Mar 28 14:18:54 2025 +0100 |
tree | 9a7f80f4a3444c1e6c2ed0b3a1234a424218ac48 | |
parent | 33cd00f8c82d5df45b1dfd59310929a4d315fd8e [diff] |
[mlir][Transforms] Improve `replaceOpWithMultiple` API (#132608) This commit adds an additional overload to `replaceOpWithMultiple` that accepts additional container types. This has been brought up by users of the new `replaceOpWithMultiple` API. In particular, one missing container type was `SmallVector<SmallVector<Value>>`. The "default" `ArrayRef<ValueRange>` container type can lead to use-after-scope errors in cases such as: ```c++ // Compute the replacement value ranges. Some replacements are single // values, some are value ranges. SmallVector<ValueRange> repl; repl.push_back(someValueRange); // OK for (...) { // push_back(Value) triggers an implicit conversion to ValueRange, // which does not own the range. repl.push_back(someValue); // triggers use-after-scope later } rewriter.replaceOpWithMultiple(op, repl); ``` In this example, users should use `SmallVector<SmallVector<Value>> repl;`.
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.