Skip to content

[MLIR] Add test fort #110518 cast-to-dyn_cast fix #110563

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
merged 1 commit into from
Oct 1, 2024

Conversation

bjacob
Copy link
Contributor

@bjacob bjacob commented Sep 30, 2024

#110518 fixed assertion failures in cast introduced in #108450.

@bjacob bjacob requested a review from joker-eph September 30, 2024 20:12
@bjacob bjacob marked this pull request as ready for review September 30, 2024 20:12
@llvmbot
Copy link
Member

llvmbot commented Sep 30, 2024

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-affine

Author: Benoit Jacob (bjacob)

Changes

#110518 fixed assertion failures in cast introduced in #108450.


Full diff: https://github.com/llvm/llvm-project/pull/110563.diff

1 Files Affected:

  • (modified) mlir/test/Dialect/Affine/canonicalize.mlir (+11)
diff --git a/mlir/test/Dialect/Affine/canonicalize.mlir b/mlir/test/Dialect/Affine/canonicalize.mlir
index ff0e987bcef6ce..265df1cefb1203 100644
--- a/mlir/test/Dialect/Affine/canonicalize.mlir
+++ b/mlir/test/Dialect/Affine/canonicalize.mlir
@@ -1514,3 +1514,14 @@ func.func @drop_single_loop_delinearize(%arg0 : index, %arg1 : index) -> index {
 //       CHECK:   scf.for %[[IV:[a-zA-Z0-9]+]] =
 //   CHECK-NOT:     affine.delinearize_index
 //       CHECK:     "some_use"(%{{.+}}, %[[IV]])
+
+// -----
+
+// Test for the assertion fix from PR #110518.
+// CHECK-LABEL: func @delinearize_test_assert_pull_110518
+func.func @delinearize_test_assert_pull_110518(%arg0: memref<?xi32>, %i : index, %t0 : index, %t1 : index, %t2 : index) -> index {
+  %c1024 = arith.constant 1024 : index
+  %1 = affine.apply affine_map<(d0)[s0, s1, s2] -> (d0 + s0 + s1 * 64 + s2 * 128)>(%i)[%t0, %t1, %t2]
+  %2 = affine.delinearize_index %1 into (%c1024) : index
+  return %2 : index
+}

@bjacob bjacob changed the title [MLIR] Add test fort https://github.com/llvm/llvm-project/pull/110518 [MLIR] Add test fort #110518 cast-to-dyn_cast fix Sep 30, 2024
@joker-eph
Copy link
Collaborator

LGTM, thanks!

That seems like it will cover only one of the dyn_cast though wouldn't it? Don't we need a second test targeting the other path?

@bjacob
Copy link
Contributor Author

bjacob commented Oct 1, 2024

Ah yes, OK, I was being lazy here. Now here are two testcases that each exercise one of the casts.

Signed-off-by: Benoit Jacob <[email protected]>
@bjacob bjacob merged commit f2f9cdd into llvm:main Oct 1, 2024
6 of 7 checks passed
Sterling-Augustine pushed a commit to Sterling-Augustine/llvm-project that referenced this pull request Oct 3, 2024
llvm#110518 fixed assertion
failures in `cast` introduced in
llvm#108450.

Signed-off-by: Benoit Jacob <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants