[llvm] e80a8b4 - [NFC] Add test for #66382
Danila Malyutin via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 14 11:10:41 PDT 2023
Author: Danila Malyutin
Date: 2023-09-14T21:10:00+03:00
New Revision: e80a8b4ab61ef6aba119adf5f64a4644b7e0a44b
URL: https://github.com/llvm/llvm-project/commit/e80a8b4ab61ef6aba119adf5f64a4644b7e0a44b
DIFF: https://github.com/llvm/llvm-project/commit/e80a8b4ab61ef6aba119adf5f64a4644b7e0a44b.diff
LOG: [NFC] Add test for #66382
Added:
llvm/test/Transforms/LoopPredication/pr66382.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LoopPredication/pr66382.ll b/llvm/test/Transforms/LoopPredication/pr66382.ll
new file mode 100644
index 000000000000000..3ac4cac0615f464
--- /dev/null
+++ b/llvm/test/Transforms/LoopPredication/pr66382.ll
@@ -0,0 +1,32 @@
+; XFAIL: *
+; RUN: opt -S -loop-predication-skip-profitability-checks=false -passes='require<scalar-evolution>,loop-mssa(loop-predication)' %s | FileCheck %s
+
+target triple = "x86_64-unknown-linux-gnu"
+
+; Function Attrs: nocallback nofree nosync willreturn
+declare void @llvm.experimental.guard(i1, ...) #0
+
+define void @foo() {
+entry:
+ br label %Header
+
+Header: ; preds = %Latch, %entry
+ %j2 = phi i64 [ 0, %entry ], [ %j.next, %Latch ]
+ call void (i1, ...) @llvm.experimental.guard(i1 false, i32 0) [ "deopt"() ]
+ %j.next = add i64 %j2, 1
+ br i1 false, label %Latch, label %exit
+
+Latch: ; preds = %Header
+ %speculate_trip_count = icmp ult i64 %j2, 0
+ br i1 %speculate_trip_count, label %Header, label %common.ret, !prof !0
+
+common.ret: ; preds = %exit, %Latch
+ ret void
+
+exit: ; preds = %Header
+ br label %common.ret
+}
+
+attributes #0 = { nocallback nofree nosync willreturn }
+
+!0 = !{!"branch_weights", i32 0, i32 0}
More information about the llvm-commits
mailing list