[llvm] [llvm] Remove `br i1 undef` from regression tests (PR #117292)

Nuno Lopes via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 09:01:03 PST 2024


================
@@ -4,31 +4,35 @@
 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
-define dso_local void @print_long_format() #0 {
+define dso_local void @print_long_format(i32 %arg) #0 {
 ; CHECK-LABEL: define dso_local void @print_long_format(
-; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+; CHECK-SAME: i32 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    switch i32 undef, label [[SW_DEFAULT:%.*]] [
+; CHECK-NEXT:    switch i32 0, label [[SW_DEFAULT:%.*]] [
 ; CHECK-NEXT:      i32 1, label [[SW_BB:%.*]]
 ; CHECK-NEXT:      i32 0, label [[SW_BB19:%.*]]
 ; CHECK-NEXT:      i32 2, label [[SW_BB23:%.*]]
 ; CHECK-NEXT:    ]
 ; CHECK:       sw.bb:
+; CHECK-NEXT:    store i8 poison, ptr null, align 1
 ; CHECK-NEXT:    unreachable
 ; CHECK:       sw.bb19:
-; CHECK-NEXT:    br i1 undef, label [[IF_THEN37:%.*]], label [[IF_END50:%.*]]
+; CHECK-NEXT:    br i1 false, label [[IF_THEN37:%.*]], label [[IF_END50:%.*]]
 ; CHECK:       sw.bb23:
+; CHECK-NEXT:    store i8 poison, ptr null, align 1
 ; CHECK-NEXT:    unreachable
 ; CHECK:       sw.default:
+; CHECK-NEXT:    store i8 poison, ptr null, align 1
 ; CHECK-NEXT:    unreachable
 ; CHECK:       if.then37:
+; CHECK-NEXT:    store i8 poison, ptr null, align 1
 ; CHECK-NEXT:    unreachable
 ; CHECK:       if.end50:
 ; CHECK-NEXT:    [[CALL180:%.*]] = call i32 @timespec_cmp() #[[ATTR2:[0-9]+]]
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  switch i32 undef, label %sw.default [
+  switch i32 0, label %sw.default [
----------------
nunoplopes wrote:

you can use an argument here as well to avoid making most BBs unreachable

https://github.com/llvm/llvm-project/pull/117292


More information about the llvm-commits mailing list