[llvm] dd927f4 - [Test] Add test exposing crash in SimpleLoopUnswitch
Dmitry Makogon via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 2 06:02:18 PDT 2022
Author: Dmitry Makogon
Date: 2022-11-02T20:01:44+07:00
New Revision: dd927f47e78bfdd89b62d5ef1ccd4b0a9b05386f
URL: https://github.com/llvm/llvm-project/commit/dd927f47e78bfdd89b62d5ef1ccd4b0a9b05386f
DIFF: https://github.com/llvm/llvm-project/commit/dd927f47e78bfdd89b62d5ef1ccd4b0a9b05386f.diff
LOG: [Test] Add test exposing crash in SimpleLoopUnswitch
The test crashes with an assert in unswitchNontrivialInvariants.
Added:
llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-skip-selects-in-guards.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-skip-selects-in-guards.ll b/llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-skip-selects-in-guards.ll
new file mode 100644
index 000000000000..7f8862e160a0
--- /dev/null
+++ b/llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch-skip-selects-in-guards.ll
@@ -0,0 +1,36 @@
+; RUN: opt -passes='loop(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
+; RUN: opt -passes='loop-mssa(simple-loop-unswitch<nontrivial>),verify<loops>' -S < %s | FileCheck %s
+; RUN: opt -simple-loop-unswitch -enable-nontrivial-unswitch -verify-memoryssa -S < %s | FileCheck %s
+
+declare ptr @pluto()
+declare void @llvm.experimental.guard(i1, ...)
+declare void @widget()
+
+; REQUIRES: asserts
+; XFAIL: *
+
+define void @foo(ptr addrspace(1) %arg, i64 %arg1) personality ptr @pluto {
+bb:
+ %tmp = icmp slt i32 poison, 570
+ %tmp2 = select i1 %tmp, i1 true, i1 false
+ br label %bb3
+
+bb3: ; preds = %bb6, %bb
+ call void (i1, ...) @llvm.experimental.guard(i1 %tmp2, i32 7) [ "deopt"() ]
+ invoke void @widget()
+ to label %bb4 unwind label %bb7
+
+bb4: ; preds = %bb3
+ invoke void @widget()
+ to label %bb6 unwind label %bb7
+
+bb6: ; preds = %bb4
+ invoke void @widget()
+ to label %bb3 unwind label %bb7
+
+bb7: ; preds = %bb6, %bb4, %bb3
+ %tmp8 = landingpad { ptr, i32 }
+ cleanup
+ ret void
+}
+
More information about the llvm-commits
mailing list