https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/235078
https://github.com/llvm/llvm-project/pull/225814 changed how the core MLIR pattern rewriter handles unreachable blocks. The change missed a CIR test that produces different output after the change. This updates the test. >From 119e120864c7c1174c69b6aa156444896538dc35 Mon Sep 17 00:00:00 2001 From: Andy Kaylor <[email protected]> Date: Fri, 23 Oct 2026 12:59:38 -0700 Subject: [PATCH] [CIR] Fix the cir.canonicalize test https://github.com/llvm/llvm-project/pull/225814 changed how the core MLIR pattern rewriter handles unreachable blocks. The change missed a CIR test that produces different output after the change. This updates the test. --- clang/test/CIR/Transforms/canonicalize.cir | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clang/test/CIR/Transforms/canonicalize.cir b/clang/test/CIR/Transforms/canonicalize.cir index a786b252e91ad6..b76d6b462eee01 100644 --- a/clang/test/CIR/Transforms/canonicalize.cir +++ b/clang/test/CIR/Transforms/canonicalize.cir @@ -45,7 +45,9 @@ module { // In this unreachable cycle, ^header is the only predecessor of ^body and // ^body the only predecessor of ^header, and ^body passes ^header's own // argument back to it. ^header must not be merged into ^body: %keep would be - // replaced by itself, and its use in the call would outlive ^header. + // replaced by itself, and its use in the call would outlive ^header. The + // greedy driver does not rewrite operations in unreachable blocks, so the + // cycle is left as written. cir.func private @use(!s32i) cir.func @no_merge_self_arg_loop(%arg0: !s32i) -> !s32i { cir.return %arg0 : !s32i @@ -59,6 +61,8 @@ module { // CHECK-NEXT: cir.return %[[ARG0]] : !s32i // CHECK-NEXT: ^[[HEADER:bb[0-9]+]](%[[KEEP:.*]]: !s32i): // CHECK-NEXT: cir.call @use(%[[KEEP]]) : (!s32i) -> () + // CHECK-NEXT: cir.br ^[[BODY:bb[0-9]+]] + // CHECK-NEXT: ^[[BODY]]: // CHECK-NEXT: cir.br ^[[HEADER]](%[[KEEP]] : !s32i) // CHECK-NEXT: } _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
