Author: Erich Keane
Date: 2026-10-23T12:59:19-07:00
New Revision: 18b3f3c1b03a4ecbc6aa8564d47730ceeea9ad5c

URL: 
https://github.com/llvm/llvm-project/commit/18b3f3c1b03a4ecbc6aa8564d47730ceeea9ad5c
DIFF: 
https://github.com/llvm/llvm-project/commit/18b3f3c1b03a4ecbc6aa8564d47730ceeea9ad5c.diff

LOG: [CIR] Remove 'dead' test that no longer has a purpose. (#235069)

The patch #225814 stops us from rewriting unreachable blocks, and the
purpose of the original patch that wrote this test (#229191) intended to
make sure we handled unreachable blocks correctly.

So this test no longer matters. I left the original code in 229191 as it
is reasonable defensive code.

Added: 
    

Modified: 
    clang/test/CIR/Transforms/canonicalize.cir

Removed: 
    


################################################################################
diff  --git a/clang/test/CIR/Transforms/canonicalize.cir 
b/clang/test/CIR/Transforms/canonicalize.cir
index a786b252e91ad..c5b72f424aa64 100644
--- a/clang/test/CIR/Transforms/canonicalize.cir
+++ b/clang/test/CIR/Transforms/canonicalize.cir
@@ -42,26 +42,6 @@ module {
   // CHECK-NEXT:   cir.return %[[SUM]] : !s32i
   // CHECK-NEXT: }
 
-  // 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.
-  cir.func private @use(!s32i)
-  cir.func @no_merge_self_arg_loop(%arg0: !s32i) -> !s32i {
-    cir.return %arg0 : !s32i
-  ^header(%keep: !s32i):
-    cir.call @use(%keep) : (!s32i) -> ()
-    cir.br ^body
-  ^body:
-    cir.br ^header(%keep : !s32i)
-  }
-  // CHECK:      cir.func{{.*}} @no_merge_self_arg_loop(%[[ARG0:.*]]: !s32i) 
-> !s32i {
-  // 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 ^[[HEADER]](%[[KEEP]] : !s32i)
-  // CHECK-NEXT: }
-
   cir.func @scope_yield_value_fold() -> !u32i {
     %0 = cir.const #cir.int<7> : !u32i
     %1 = cir.scope {


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to