commit | 7ff3d3bd1d5b0c9096377bf4c89d0de043dec805 | [log] [tgz] |
---|---|---|
author | Andrzej Warzyński <andrzej.warzynski@arm.com> | Fri Apr 25 17:20:04 2025 +0100 |
committer | GitHub <noreply@github.com> | Fri Apr 25 17:20:04 2025 +0100 |
tree | 4291ddb94612fa81010b92375d9c0c5ca1ac648b | |
parent | bd4a7aa64a79ee62b81f13ba7c45697ace386220 [diff] |
[mlir][utils] Update generate-test-checks.py (use SSA names) (#136819) This patch updates generate-test-checks.py to preserve original SSA names (capitalized) when generating LIT variable names for function arguments (i.e. for `CHECK-SAME` lines). This improves readability and helps maintain consistency between the input MLIR and the expected FileCheck/LIT output. For example, given the following function: ```mlir func.func @example( %input: memref<4x6x3xf32>, %filter: memref<1x3x8xf32>, %output: memref<4x2x8xf32>) { linalg.conv_1d_nwc_wcf {dilations = dense<1> : tensor<1xi64>, strides = dense<3> : tensor<1xi64>} ins(%input, %filter : memref<4x6x3xf32>, memref<1x3x8xf32>) outs(%output : memref<4x2x8xf32>) return } ``` The generated output becomes: ```mlir // CHECK-LABEL: func.func @conv1d_nwc_4x2x8_memref( // CHECK-SAME: %[[INPUT:.*]]: memref<4x6x3xf32>, // CHECK-SAME: %[[FILTER:.*]]: memref<1x3x8xf32>, // CHECK-SAME: %[[OUTPUT:.*]]: memref<4x2x8xf32>) { // CHECK: linalg.conv_1d_nwc_wcf // CHECK: {dilations = dense<1> : tensor<1xi64>, strides = dense<3> : tensor<1xi64>} // CHECK: ins(%[[INPUT]], %[[FILTER]] : memref<4x6x3xf32>, memref<1x3x8xf32>) // CHECK: outs(%[[OUTPUT]] : memref<4x2x8xf32>) // CHECK: return // CHECK: } ``` By contrast, the current version of the script would generate: ```mlir // CHECK-LABEL: func.func @conv1d_nwc_4x2x8_memref( // CHECK-SAME: %[[VAL_0:.*]]: memref<4x6x3xf32>, // CHECK-SAME: %[[VAL_1:.*]]: memref<1x3x8xf32>, // CHECK-SAME: %[[VAL_2:.*]]: memref<4x2x8xf32>) { // CHECK: linalg.conv_1d_nwc_wcf // CHECK: {dilations = dense<1> : tensor<1xi64>, strides = dense<3> : tensor<1xi64>} // CHECK: ins(%[[VAL_0]], %[[VAL_1]] : memref<4x6x3xf32>, memref<1x3x8xf32>) // CHECK: outs(%[[VAL_2]] : memref<4x2x8xf32>) // CHECK: return // CHECK: } ```
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.