[Mlir-commits] [mlir] 3ea39a5 - [utils] Process attribute references in lines defining attrs. (#156541)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Sep 8 09:08:01 PDT 2025
Author: Slava Zakharin
Date: 2025-09-08T09:07:57-07:00
New Revision: 3ea39a5899436ef419b7444d9015f096a0e665cd
URL: https://github.com/llvm/llvm-project/commit/3ea39a5899436ef419b7444d9015f096a0e665cd
DIFF: https://github.com/llvm/llvm-project/commit/3ea39a5899436ef419b7444d9015f096a0e665cd.diff
LOG: [utils] Process attribute references in lines defining attrs. (#156541)
Here is an example of TBAA attributes generated by Flang:
```
#tbaa_root = #llvm.tbaa_root<id = "Flang function root _QPtest6">
#tbaa_type_desc = #llvm.tbaa_type_desc<id = "any access", members = {<#tbaa_root, 0>}>
```
We have to process the text after `=` to replace the attribute
references with proper check variables.
Added:
Modified:
mlir/utils/generate-test-checks.py
Removed:
################################################################################
diff --git a/mlir/utils/generate-test-checks.py b/mlir/utils/generate-test-checks.py
index 14a790e6d0e6e..f80a1811f418c 100755
--- a/mlir/utils/generate-test-checks.py
+++ b/mlir/utils/generate-test-checks.py
@@ -229,7 +229,9 @@ def process_attribute_definition(line, attribute_namer):
"// CHECK: #[["
+ attribute_name
+ ":.+]] ="
- + line[len(m.group(0)) :]
+ # The rest of the line may contain attribute references,
+ # so we have to process them.
+ + process_attribute_references(line[len(m.group(0)) :], attribute_namer)
+ "\n"
)
return None
More information about the Mlir-commits
mailing list