[llvm] 4224075 - [Test] Add motivating test for revert of fix of PR60234
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 31 03:33:59 PST 2023
Author: Max Kazantsev
Date: 2023-01-31T18:33:19+07:00
New Revision: 42240756427ab6866d76cdc50a96776c2543adb5
URL: https://github.com/llvm/llvm-project/commit/42240756427ab6866d76cdc50a96776c2543adb5
DIFF: https://github.com/llvm/llvm-project/commit/42240756427ab6866d76cdc50a96776c2543adb5.diff
LOG: [Test] Add motivating test for revert of fix of PR60234
Added:
llvm/test/Transforms/GuardWidening/pr60234_recommit.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/GuardWidening/pr60234_recommit.ll b/llvm/test/Transforms/GuardWidening/pr60234_recommit.ll
new file mode 100644
index 0000000000000..962aacebf4c20
--- /dev/null
+++ b/llvm/test/Transforms/GuardWidening/pr60234_recommit.ll
@@ -0,0 +1,57 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -passes=guard-widening -S < %s | FileCheck %s
+
+define ptr @test(i1 %cond, ptr %p) {
+; CHECK-LABEL: @test(
+; CHECK-NEXT: bb:
+; CHECK-NEXT: [[VAR:%.*]] = call i1 @llvm.experimental.widenable.condition()
+; CHECK-NEXT: [[VAR2:%.*]] = call i1 @llvm.experimental.widenable.condition()
+; CHECK-NEXT: [[VAR3:%.*]] = and i1 [[COND:%.*]], [[VAR2]]
+; CHECK-NEXT: br label [[BB4:%.*]]
+; CHECK: bb4:
+; CHECK-NEXT: [[VAR5:%.*]] = load atomic i32, ptr [[P:%.*]] unordered, align 8
+; CHECK-NEXT: [[VAR6:%.*]] = icmp ugt i32 [[VAR5]], 0
+; CHECK-NEXT: [[WIDE_CHK:%.*]] = and i1 [[VAR6]], [[COND]]
+; CHECK-NEXT: [[VAR7:%.*]] = and i1 [[WIDE_CHK]], [[VAR]]
+; CHECK-NEXT: br i1 [[VAR7]], label [[BB10:%.*]], label [[BB8:%.*]]
+; CHECK: bb8:
+; CHECK-NEXT: [[VAR9:%.*]] = call ptr (...) @llvm.experimental.deoptimize.p0(i32 13) [ "deopt"(i32 0) ]
+; CHECK-NEXT: ret ptr [[VAR9]]
+; CHECK: bb10:
+; CHECK-NEXT: br i1 true, label [[BB13:%.*]], label [[BB11:%.*]]
+; CHECK: bb11:
+; CHECK-NEXT: [[VAR12:%.*]] = call ptr (...) @llvm.experimental.deoptimize.p0(i32 13) [ "deopt"(i32 1) ]
+; CHECK-NEXT: ret ptr [[VAR12]]
+; CHECK: bb13:
+; CHECK-NEXT: unreachable
+;
+bb:
+ %var = call i1 @llvm.experimental.widenable.condition()
+ %var2 = call i1 @llvm.experimental.widenable.condition()
+ %var3 = and i1 %cond, %var2
+ br label %bb4
+
+bb4: ; preds = %bb
+ %var5 = load atomic i32, ptr %p unordered, align 8
+ %var6 = icmp ugt i32 %var5, 0
+ %var7 = and i1 %var6, %var
+ br i1 %var7, label %bb10, label %bb8
+
+bb8: ; preds = %bb4
+ %var9 = call ptr (...) @llvm.experimental.deoptimize.p0(i32 13) [ "deopt"(i32 0) ]
+ ret ptr %var9
+
+bb10: ; preds = %bb4
+ br i1 %var3, label %bb13, label %bb11
+
+bb11: ; preds = %bb10
+ %var12 = call ptr (...) @llvm.experimental.deoptimize.p0(i32 13) [ "deopt"(i32 1) ]
+ ret ptr %var12
+
+bb13: ; preds = %bb10
+ unreachable
+}
+
+declare ptr @llvm.experimental.deoptimize.p0(...)
+
+declare i1 @llvm.experimental.widenable.condition()
More information about the llvm-commits
mailing list