[llvm] afc4dce - [SimplifyCFG] regenerate complete test checks; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 13 11:18:48 PDT 2020
Author: Sanjay Patel
Date: 2020-03-13T14:12:28-04:00
New Revision: afc4dcee8327498616f7dc6ff7260a569d5ad161
URL: https://github.com/llvm/llvm-project/commit/afc4dcee8327498616f7dc6ff7260a569d5ad161
DIFF: https://github.com/llvm/llvm-project/commit/afc4dcee8327498616f7dc6ff7260a569d5ad161.diff
LOG: [SimplifyCFG] regenerate complete test checks; NFC
Added:
Modified:
llvm/test/Transforms/SimplifyCFG/PR17073.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SimplifyCFG/PR17073.ll b/llvm/test/Transforms/SimplifyCFG/PR17073.ll
index e6e98b266879..7c83c2220f4e 100644
--- a/llvm/test/Transforms/SimplifyCFG/PR17073.ll
+++ b/llvm/test/Transforms/SimplifyCFG/PR17073.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; In PR17073 ( http://llvm.org/pr17073 ), we illegally hoisted an operation that can trap.
@@ -13,10 +14,20 @@ target triple = "i386-apple-macosx10.9.0"
@a = common global i32 0, align 4
@b = common global i8 0, align 1
-; CHECK-LABEL: can_trap1
-; CHECK-NOT: or i1 %tobool, icmp eq (i32* bitcast (i8* @b to i32*), i32* @a)
-; CHECK-NOT: select i1 %tobool, i32* null, i32* select (i1 icmp eq (i64 urem (i64 2, i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64)), i64 0), i32* null, i32* @a)
define i32* @can_trap1() {
+; CHECK-LABEL: @can_trap1(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0
+; CHECK-NEXT: br i1 [[TOBOOL]], label [[EXIT:%.*]], label [[BLOCK1:%.*]]
+; CHECK: block1:
+; CHECK-NEXT: br i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a), label [[EXIT]], label [[BLOCK2:%.*]]
+; CHECK: block2:
+; CHECK-NEXT: br label [[EXIT]]
+; CHECK: exit:
+; CHECK-NEXT: [[STOREMERGE:%.*]] = phi i32* [ null, [[ENTRY:%.*]] ], [ null, [[BLOCK2]] ], [ select (i1 icmp eq (i64 urem (i64 2, i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64)), i64 0), i32* null, i32* @a), [[BLOCK1]] ]
+; CHECK-NEXT: ret i32* [[STOREMERGE]]
+;
entry:
%0 = load i32, i32* @a, align 4
%tobool = icmp eq i32 %0, 0
@@ -33,10 +44,17 @@ exit:
ret i32* %storemerge
}
-; CHECK-LABEL: can_trap2
-; CHECK-NOT: or i1 %tobool, icmp eq (i32* bitcast (i8* @b to i32*), i32* @a)
-; CHECK-NOT: select i1 %tobool, i32* select (i1 icmp eq (i64 urem (i64 2, i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64)), i64 0), i32* null, i32* @a), i32* null
define i32* @can_trap2() {
+; CHECK-LABEL: @can_trap2(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0
+; CHECK-NEXT: br i1 [[TOBOOL]], label [[EXIT:%.*]], label [[BLOCK1:%.*]]
+; CHECK: block1:
+; CHECK-NEXT: ret i32* null
+; CHECK: exit:
+; CHECK-NEXT: ret i32* select (i1 icmp eq (i64 urem (i64 2, i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64)), i64 0), i32* null, i32* @a)
+;
entry:
%0 = load i32, i32* @a, align 4
%tobool = icmp eq i32 %0, 0
@@ -53,9 +71,18 @@ exit:
ret i32* %storemerge
}
-; CHECK-LABEL: cannot_trap
-; CHECK: select i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a), i32* select (i1 icmp eq (i64 add (i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64), i64 2), i64 0), i32* null, i32* @a), i32* null
define i32* @cannot_trap() {
+; CHECK-LABEL: @cannot_trap(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* @a, align 4
+; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[TMP0]], 0
+; CHECK-NEXT: br i1 [[TOBOOL]], label [[EXIT:%.*]], label [[BLOCK1:%.*]]
+; CHECK: block1:
+; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a), i32* select (i1 icmp eq (i64 add (i64 zext (i1 icmp eq (i32* bitcast (i8* @b to i32*), i32* @a) to i64), i64 2), i64 0), i32* null, i32* @a), i32* null
+; CHECK-NEXT: ret i32* [[SPEC_SELECT]]
+; CHECK: exit:
+; CHECK-NEXT: ret i32* null
+;
entry:
%0 = load i32, i32* @a, align 4
%tobool = icmp eq i32 %0, 0
More information about the llvm-commits
mailing list