[llvm] b70807b - [Test] Add test exposing crash in SimplifyCFG when hoisting llvm.deoptimize
Dmitry Makogon via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 08:17:50 PST 2022
Author: Dmitry Makogon
Date: 2022-12-06T23:17:02+07:00
New Revision: b70807b34058e619eeb344fe5d01841750f481c8
URL: https://github.com/llvm/llvm-project/commit/b70807b34058e619eeb344fe5d01841750f481c8
DIFF: https://github.com/llvm/llvm-project/commit/b70807b34058e619eeb344fe5d01841750f481c8.diff
LOG: [Test] Add test exposing crash in SimplifyCFG when hoisting llvm.deoptimize
Added:
llvm/test/Transforms/SimplifyCFG/dont-hoist-deoptimize.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SimplifyCFG/dont-hoist-deoptimize.ll b/llvm/test/Transforms/SimplifyCFG/dont-hoist-deoptimize.ll
new file mode 100644
index 0000000000000..ee5979594c363
--- /dev/null
+++ b/llvm/test/Transforms/SimplifyCFG/dont-hoist-deoptimize.ll
@@ -0,0 +1,29 @@
+; RUN: opt -S --passes='simplifycfg<hoist-common-insts>' -simplifycfg-hoist-common-skip-limit=0 %s | FileCheck %s
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
+target triple = "x86_64-unknown-linux-gnu"
+
+declare void @llvm.experimental.deoptimize.isVoid(...) #0
+
+; REQUIRES: asserts
+; XFAIL: *
+
+define void @widget(i1 %arg) {
+bb:
+ br i1 %arg, label %bb1, label %bb4
+
+bb1: ; preds = %bb
+ %tmp = trunc i64 5 to i32
+ %tmp2 = trunc i64 0 to i32
+ %tmp3 = trunc i64 0 to i32
+ call void (...) @llvm.experimental.deoptimize.isVoid(i32 13) #0 [ "deopt"(i32 0, i32 1, i32 0, i32 502, i32 4, i32 35, i32 0, i32 0, ptr addrspace(1) null, i32 3, i32 -99, i32 0, ptr addrspace(1) null, i32 3, i32 -99, i32 0, ptr addrspace(1) null, i32 7, ptr null, i32 3, i32 0, i32 3, i32 0, i32 3, i32 %tmp3, i32 3, i32 0, i32 3, i32 0, i32 3, i32 %tmp, i32 3, i32 0, i32 3, i32 -99, i32 3, i32 0, i32 3, i32 14, i32 3, i32 0, i32 3, i32 -99, i32 3, i32 0, i32 3, i32 0, i32 3, i32 0, i32 3, i32 0, i32 0, ptr addrspace(1) null, i32 3, float 0.000000e+00, i32 4, double 0.000000e+00, i32 7, ptr null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 7, ptr null, i32 7, ptr null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 7, ptr null, i32 7, ptr null, i32 7, ptr null, i32 7, ptr null) ]
+ ret void
+
+bb4: ; preds = %bb
+ %tmp5 = trunc i64 5 to i32
+ %tmp6 = trunc i64 1 to i32
+ %tmp7 = trunc i64 0 to i32
+ call void (...) @llvm.experimental.deoptimize.isVoid(i32 13) #0 [ "deopt"(i32 0, i32 1, i32 0, i32 502, i32 4, i32 35, i32 0, i32 0, ptr addrspace(1) null, i32 3, i32 -99, i32 0, ptr addrspace(1) null, i32 3, i32 -99, i32 0, ptr addrspace(1) null, i32 7, ptr null, i32 3, i32 0, i32 3, i32 0, i32 3, i32 %tmp7, i32 3, i32 0, i32 3, i32 0, i32 3, i32 %tmp5, i32 3, i32 0, i32 3, i32 -99, i32 3, i32 0, i32 3, i32 14, i32 3, i32 0, i32 3, i32 -99, i32 3, i32 0, i32 3, i32 0, i32 3, i32 0, i32 3, i32 0, i32 0, ptr addrspace(1) null, i32 3, float 0.000000e+00, i32 4, double 0.000000e+00, i32 7, ptr null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 7, ptr null, i32 7, ptr null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 0, ptr addrspace(1) null, i32 7, ptr null, i32 7, ptr null, i32 7, ptr null, i32 7, ptr null) ]
+ ret void
+}
+
+attributes #0 = { nounwind }
More information about the llvm-commits
mailing list