| commit | 5954e9c1a56fc313394b9dcc21f20c20c058f83d | [log] [tgz] |
|---|---|---|
| author | Niklas Degener <niklas.degener@amd.com> | Thu Jul 10 16:09:49 2025 +0200 |
| committer | GitHub <noreply@github.com> | Thu Jul 10 16:09:49 2025 +0200 |
| tree | 6106ba4e0c0e2118889bf1b7a915dff017871ed5 | |
| parent | 18627e995c361124087480c199169e2ce000ad49 [diff] |
[MLIR][Target/Cpp] Fix variable naming conflict for function declarations (#147927) This is a fix for https://github.com/llvm/llvm-project/pull/136102. It missed scoping for `DeclareFuncOps`. In scenarios with multiple function declarations, the `valueMapper` wasn't updated and later uses of values in other functions still used the assigned names in prior functions. This is visible in the reproducer here https://github.com/iree-org/iree/issues/21303: Although the counter for variable enumeration was reset, as it is visible for the local vars, the function arguments were mapped to old names. Due to this mapping, the counter was never increased, and the local variables conflicted with the arguments. This fix adds proper scoping for declarations and a test-case to cover the scenario with multiple `DeclareFuncOps`.
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.