[llvm] e7da06a - [SimplifyCFG] Regenerate test checks (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 03:09:36 PDT 2023


Author: Nikita Popov
Date: 2023-06-28T12:09:27+02:00
New Revision: e7da06a0551ff4520aeeb1b71d109fff15d97eae

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

LOG: [SimplifyCFG] Regenerate test checks (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll b/llvm/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll
index 5b5a44b6e3f81..2fe57e429808c 100644
--- a/llvm/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll
+++ b/llvm/test/Transforms/SimplifyCFG/phi-undef-loadstore.ll
@@ -1,8 +1,28 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
 ; RUN: opt -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
 
 declare void @bar() nounwind
 
 define i32 @test1(ptr %a, i32 %b, ptr %c, i32 %d) nounwind {
+; CHECK-LABEL: define i32 @test1
+; CHECK-SAME: (ptr [[A:%.*]], i32 [[B:%.*]], ptr [[C:%.*]], i32 [[D:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
+; CHECK:       if.then:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7:%.*]]
+; CHECK:       if.else:
+; CHECK-NEXT:    [[TOBOOL3:%.*]] = icmp eq i32 [[D]], 0
+; CHECK-NEXT:    [[TMP0:%.*]] = xor i1 [[TOBOOL3]], true
+; CHECK-NEXT:    call void @llvm.assume(i1 [[TMP0]])
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7]]
+; CHECK:       if.end7:
+; CHECK-NEXT:    [[X_0:%.*]] = phi ptr [ [[A]], [[IF_THEN]] ], [ [[C]], [[IF_ELSE]] ]
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[X_0]], align 4
+; CHECK-NEXT:    ret i32 [[TMP9]]
+;
 entry:
   %tobool = icmp eq i32 %b, 0
   br i1 %tobool, label %if.else, label %if.then
@@ -23,15 +43,28 @@ if.end7:                                          ; preds = %if.else, %if.then4,
   %x.0 = phi ptr [ %a, %if.then ], [ %c, %if.then4 ], [ null, %if.else ]
   %tmp9 = load i32, ptr %x.0
   ret i32 %tmp9
-
-; CHECK-LABEL: @test1(
-; CHECK: if.else:
-; CHECK: br label %if.end7
-
-; CHECK: phi ptr [ %a, %if.then ], [ %c, %if.else ]
 }
 
 define i32 @test1_no_null_opt(ptr %a, i32 %b, ptr %c, i32 %d) nounwind #0 {
+; CHECK-LABEL: define i32 @test1_no_null_opt
+; CHECK-SAME: (ptr [[A:%.*]], i32 [[B:%.*]], ptr [[C:%.*]], i32 [[D:%.*]]) #[[ATTR1:[0-9]+]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
+; CHECK:       if.then:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7:%.*]]
+; CHECK:       if.else:
+; CHECK-NEXT:    [[TOBOOL3:%.*]] = icmp eq i32 [[D]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL3]], label [[IF_END7]], label [[IF_THEN4:%.*]]
+; CHECK:       if.then4:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7]]
+; CHECK:       if.end7:
+; CHECK-NEXT:    [[X_0:%.*]] = phi ptr [ [[A]], [[IF_THEN]] ], [ [[C]], [[IF_THEN4]] ], [ null, [[IF_ELSE]] ]
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[X_0]], align 4
+; CHECK-NEXT:    ret i32 [[TMP9]]
+;
 entry:
   %tobool = icmp eq i32 %b, 0
   br i1 %tobool, label %if.else, label %if.then
@@ -52,17 +85,25 @@ if.end7:                                          ; preds = %if.else, %if.then4,
   %x.0 = phi ptr [ %a, %if.then ], [ %c, %if.then4 ], [ null, %if.else ]
   %tmp9 = load i32, ptr %x.0
   ret i32 %tmp9
-
-; CHECK-LABEL: @test1_no_null_opt(
-; CHECK: if.then:
-; CHECK: if.else:
-; CHECK: if.then4:
-; CHECK: br label %if.end7
-; CHECK: if.end7:
-; CHECK-NEXT: phi ptr [ %a, %if.then ], [ %c, %if.then4 ], [ null, %if.else ]
 }
 
 define i32 @test2(ptr %a, i32 %b, ptr %c, i32 %d) nounwind {
+; CHECK-LABEL: define i32 @test2
+; CHECK-SAME: (ptr [[A:%.*]], i32 [[B:%.*]], ptr [[C:%.*]], i32 [[D:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
+; CHECK:       if.then:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[A]], align 4
+; CHECK-NEXT:    ret i32 [[TMP9]]
+; CHECK:       if.else:
+; CHECK-NEXT:    [[TOBOOL3:%.*]] = icmp eq i32 [[D]], 0
+; CHECK-NEXT:    [[TMP0:%.*]] = xor i1 [[TOBOOL3]], true
+; CHECK-NEXT:    call void @llvm.assume(i1 [[TMP0]])
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    unreachable
+;
 entry:
   %tobool = icmp eq i32 %b, 0
   br i1 %tobool, label %if.else, label %if.then
@@ -83,14 +124,28 @@ if.end7:                                          ; preds = %if.else, %if.then4,
   %x.0 = phi ptr [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ]
   %tmp9 = load i32, ptr %x.0
   ret i32 %tmp9
-; CHECK-LABEL: @test2(
-; CHECK: if.else:
-; CHECK: unreachable
-
-; CHECK-NOT: phi
 }
 
 define i32 @test2_no_null_opt(ptr %a, i32 %b, ptr %c, i32 %d) nounwind #0 {
+; CHECK-LABEL: define i32 @test2_no_null_opt
+; CHECK-SAME: (ptr [[A:%.*]], i32 [[B:%.*]], ptr [[C:%.*]], i32 [[D:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
+; CHECK:       if.then:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7:%.*]]
+; CHECK:       if.else:
+; CHECK-NEXT:    [[TOBOOL3:%.*]] = icmp eq i32 [[D]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL3]], label [[IF_END7]], label [[IF_THEN4:%.*]]
+; CHECK:       if.then4:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7]]
+; CHECK:       if.end7:
+; CHECK-NEXT:    [[X_0:%.*]] = phi ptr [ [[A]], [[IF_THEN]] ], [ null, [[IF_THEN4]] ], [ null, [[IF_ELSE]] ]
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[X_0]], align 4
+; CHECK-NEXT:    ret i32 [[TMP9]]
+;
 entry:
   %tobool = icmp eq i32 %b, 0
   br i1 %tobool, label %if.else, label %if.then
@@ -111,15 +166,29 @@ if.end7:                                          ; preds = %if.else, %if.then4,
   %x.0 = phi ptr [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ]
   %tmp9 = load i32, ptr %x.0
   ret i32 %tmp9
-; CHECK-LABEL: @test2_no_null_opt(
-; CHECK: if.then:
-; CHECK: if.else:
-; CHECK: if.then4:
-; CHECK: if.end7:
-; CHECK-NEXT: phi ptr [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ]
 }
 
 define i32 @test3(ptr %a, i32 %b, ptr %c, i32 %d) nounwind {
+; CHECK-LABEL: define i32 @test3
+; CHECK-SAME: (ptr [[A:%.*]], i32 [[B:%.*]], ptr [[C:%.*]], i32 [[D:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
+; CHECK:       if.then:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7:%.*]]
+; CHECK:       if.else:
+; CHECK-NEXT:    [[TOBOOL3:%.*]] = icmp eq i32 [[D]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL3]], label [[IF_END7]], label [[IF_THEN4:%.*]]
+; CHECK:       if.then4:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7]]
+; CHECK:       if.end7:
+; CHECK-NEXT:    [[X_0:%.*]] = phi ptr [ [[A]], [[IF_THEN]] ], [ null, [[IF_THEN4]] ], [ null, [[IF_ELSE]] ]
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[X_0]], align 4
+; CHECK-NEXT:    ret i32 [[TMP9]]
+;
 entry:
   %tobool = icmp eq i32 %b, 0
   br i1 %tobool, label %if.else, label %if.then
@@ -141,12 +210,29 @@ if.end7:                                          ; preds = %if.else, %if.then4,
   tail call void @bar() nounwind
   %tmp9 = load i32, ptr %x.0
   ret i32 %tmp9
-; CHECK-LABEL: @test3(
-; CHECK: if.end7:
-; CHECK: phi ptr [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ]
 }
 
 define i32 @test3_no_null_opt(ptr %a, i32 %b, ptr %c, i32 %d) nounwind #0 {
+; CHECK-LABEL: define i32 @test3_no_null_opt
+; CHECK-SAME: (ptr [[A:%.*]], i32 [[B:%.*]], ptr [[C:%.*]], i32 [[D:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
+; CHECK:       if.then:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7:%.*]]
+; CHECK:       if.else:
+; CHECK-NEXT:    [[TOBOOL3:%.*]] = icmp eq i32 [[D]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL3]], label [[IF_END7]], label [[IF_THEN4:%.*]]
+; CHECK:       if.then4:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7]]
+; CHECK:       if.end7:
+; CHECK-NEXT:    [[X_0:%.*]] = phi ptr [ [[A]], [[IF_THEN]] ], [ null, [[IF_THEN4]] ], [ null, [[IF_ELSE]] ]
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[X_0]], align 4
+; CHECK-NEXT:    ret i32 [[TMP9]]
+;
 entry:
   %tobool = icmp eq i32 %b, 0
   br i1 %tobool, label %if.else, label %if.then
@@ -168,15 +254,28 @@ if.end7:                                          ; preds = %if.else, %if.then4,
   tail call void @bar() nounwind
   %tmp9 = load i32, ptr %x.0
   ret i32 %tmp9
-; CHECK-LABEL: @test3_no_null_opt(
-; CHECK: if.then:
-; CHECK: if.else:
-; CHECK: if.then4:
-; CHECK: if.end7:
-; CHECK-NEXT: phi ptr [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ]
 }
 
 define i32 @test4(ptr %a, i32 %b, ptr %c, i32 %d) nounwind {
+; CHECK-LABEL: define i32 @test4
+; CHECK-SAME: (ptr [[A:%.*]], i32 [[B:%.*]], ptr [[C:%.*]], i32 [[D:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
+; CHECK:       if.then:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    [[GEP:%.*]] = getelementptr i32, ptr [[A]], i32 10
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[GEP]], align 4
+; CHECK-NEXT:    [[TMP10:%.*]] = or i32 [[TMP9]], 1
+; CHECK-NEXT:    store i32 [[TMP10]], ptr [[GEP]], align 4
+; CHECK-NEXT:    ret i32 [[TMP9]]
+; CHECK:       if.else:
+; CHECK-NEXT:    [[TOBOOL3:%.*]] = icmp eq i32 [[D]], 0
+; CHECK-NEXT:    [[TMP0:%.*]] = xor i1 [[TOBOOL3]], true
+; CHECK-NEXT:    call void @llvm.assume(i1 [[TMP0]])
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    unreachable
+;
 entry:
   %tobool = icmp eq i32 %b, 0
   br i1 %tobool, label %if.else, label %if.then
@@ -200,11 +299,31 @@ if.end7:                                          ; preds = %if.else, %if.then4,
   %tmp10 = or i32 %tmp9, 1
   store i32 %tmp10, ptr %gep
   ret i32 %tmp9
-; CHECK-LABEL: @test4(
-; CHECK-NOT: phi
 }
 
 define i32 @test4_no_null_opt(ptr %a, i32 %b, ptr %c, i32 %d) nounwind #0 {
+; CHECK-LABEL: define i32 @test4_no_null_opt
+; CHECK-SAME: (ptr [[A:%.*]], i32 [[B:%.*]], ptr [[C:%.*]], i32 [[D:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[TOBOOL:%.*]] = icmp eq i32 [[B]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL]], label [[IF_ELSE:%.*]], label [[IF_THEN:%.*]]
+; CHECK:       if.then:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7:%.*]]
+; CHECK:       if.else:
+; CHECK-NEXT:    [[TOBOOL3:%.*]] = icmp eq i32 [[D]], 0
+; CHECK-NEXT:    br i1 [[TOBOOL3]], label [[IF_END7]], label [[IF_THEN4:%.*]]
+; CHECK:       if.then4:
+; CHECK-NEXT:    tail call void @bar() #[[ATTR0]]
+; CHECK-NEXT:    br label [[IF_END7]]
+; CHECK:       if.end7:
+; CHECK-NEXT:    [[X_0:%.*]] = phi ptr [ [[A]], [[IF_THEN]] ], [ null, [[IF_THEN4]] ], [ null, [[IF_ELSE]] ]
+; CHECK-NEXT:    [[GEP:%.*]] = getelementptr i32, ptr [[X_0]], i32 10
+; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[GEP]], align 4
+; CHECK-NEXT:    [[TMP10:%.*]] = or i32 [[TMP9]], 1
+; CHECK-NEXT:    store i32 [[TMP10]], ptr [[GEP]], align 4
+; CHECK-NEXT:    ret i32 [[TMP9]]
+;
 entry:
   %tobool = icmp eq i32 %b, 0
   br i1 %tobool, label %if.else, label %if.then
@@ -228,12 +347,6 @@ if.end7:                                          ; preds = %if.else, %if.then4,
   %tmp10 = or i32 %tmp9, 1
   store i32 %tmp10, ptr %gep
   ret i32 %tmp9
-; CHECK-LABEL: @test4_no_null_opt(
-; CHECK: if.then:
-; CHECK: if.else:
-; CHECK: if.then4:
-; CHECK: if.end7:
-; CHECK-NEXT: phi ptr [ %a, %if.then ], [ null, %if.then4 ], [ null, %if.else ]
 }
 
 attributes #0 = { null_pointer_is_valid }


        


More information about the llvm-commits mailing list