-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[mlir][dataflow] Add arguemnt print for test-liveness-analysis #169625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
linuxlonelyeagle
merged 3 commits into
llvm:main
from
linuxlonelyeagle:add-argument-print-for-test-liveness-analysis
Nov 27, 2025
Merged
[mlir][dataflow] Add arguemnt print for test-liveness-analysis #169625
linuxlonelyeagle
merged 3 commits into
llvm:main
from
linuxlonelyeagle:add-argument-print-for-test-liveness-analysis
Nov 27, 2025
+24
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
@llvm/pr-subscribers-mlir Author: lonely eagle (linuxlonelyeagle) ChangesAdd arguemnt print for test-liveness-analysis to better debug remove-dead-values pass. Full diff: https://github.com/llvm/llvm-project/pull/169625.diff 2 Files Affected:
diff --git a/mlir/test/Analysis/DataFlow/test-liveness-analysis.mlir b/mlir/test/Analysis/DataFlow/test-liveness-analysis.mlir
index 3748be74eb0f33..74a1abfcedb8f3 100644
--- a/mlir/test/Analysis/DataFlow/test-liveness-analysis.mlir
+++ b/mlir/test/Analysis/DataFlow/test-liveness-analysis.mlir
@@ -184,6 +184,17 @@ func.func private @private0(%0 : i32) -> i32 {
// CHECK-NEXT: result #0: live
// CHECK-LABEL: test_tag: y:
// CHECK-NEXT: result #0: not live
+// CHECK-LABEL: test_tag: for:
+// CHECK-NEXT: operand #0: live
+// CHECK-NEXT: operand #1: live
+// CHECK-NEXT: operand #2: live
+// CHECK-NEXT: operand #3: live
+// CHECK-NEXT: operand #4: not live
+// CHECK-NEXT: result #0: live
+// CHECK-NEXT: result #1: not live
+// CHECK-NEXT: argument: #0: live
+// CHECK-NEXT: argument: #1: not live
+// CHECK-NEXT: argument: #2: not live
func.func @test_7_type_3(%arg0: memref<i32>) {
%c0 = arith.constant {tag = "zero"} 0 : index
%c10 = arith.constant {tag = "ten"} 10 : index
@@ -194,7 +205,7 @@ func.func @test_7_type_3(%arg0: memref<i32>) {
%1 = arith.addi %x, %x : i32
%2 = func.call @private0(%1) : (i32) -> i32
scf.yield %2, %arg3 : i32, i32
- }
+ } {tag = "for"}
memref.store %0#0, %arg0[] : memref<i32>
return
}
diff --git a/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp b/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
index 8e2f03b644e49e..04026008899af5 100644
--- a/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
+++ b/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
@@ -56,6 +56,15 @@ struct TestLivenessAnalysisPass
liveness->print(os);
os << "\n";
}
+ for (mlir::Region ®ion : op->getRegions()) {
+ for (auto [index, argument] : llvm::enumerate(region.getArguments())) {
+ const Liveness *liveness = livenessAnalysis.getLiveness(argument);
+ assert(liveness && "expected a sparse lattice");
+ os << " argument: #" << index << ": ";
+ liveness->print(os);
+ os << "\n";
+ }
+ }
});
}
};
|
joker-eph
reviewed
Nov 26, 2025
joker-eph
reviewed
Nov 26, 2025
joker-eph
approved these changes
Nov 26, 2025
Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
tanji-dg
pushed a commit
to tanji-dg/llvm-project
that referenced
this pull request
Nov 27, 2025
…169625) Add arguemnt print for test-liveness-analysis to better debug remove-dead-values pass. --------- Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
GeneraluseAI
pushed a commit
to GeneraluseAI/llvm-project
that referenced
this pull request
Nov 27, 2025
…169625) Add arguemnt print for test-liveness-analysis to better debug remove-dead-values pass. --------- Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add arguemnt print for test-liveness-analysis to better debug remove-dead-values pass.