1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 ; Check that this doesn't crash.
6 target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
7 target triple = "hexagon"
9 define void @f0(ptr %a0, ptr %a1, ptr %a2) unnamed_addr #0 {
11 %v0 = load i8, ptr %a0, align 1
12 %v1 = load i32, ptr %a1, align 4
13 %v2 = load i32, ptr %a2, align 4
14 %v3 = zext i8 %v0 to i32
15 %v4 = getelementptr inbounds i8, ptr null, i32 %v1
16 %v5 = add nsw i32 %v2, 2
17 %v8 = insertelement <16 x i32> poison, i32 %v3, i64 0
18 %v9 = shufflevector <16 x i32> %v8, <16 x i32> poison, <16 x i32> zeroinitializer
21 b1: ; preds = %b3, %b2
22 %v10 = phi ptr [ %v4, %b0 ], [ %v19, %b1 ]
23 %v11 = add nsw <16 x i32> zeroinitializer, <i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128>
24 %v12 = mul nsw <16 x i32> %v11, %v9
25 %v13 = add nsw <16 x i32> %v12, <i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4, i32 4>
26 %v14 = ashr <16 x i32> %v13, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
27 %v15 = tail call <16 x i32> @llvm.smin.v16i32(<16 x i32> %v14, <16 x i32> <i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127, i32 127>)
28 %v16 = add nsw <16 x i32> %v15, <i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128, i32 128>
29 %v17 = select <16 x i1> zeroinitializer, <16 x i32> zeroinitializer, <16 x i32> %v16
30 %v18 = trunc <16 x i32> %v17 to <16 x i8>
31 %v19 = getelementptr inbounds i8, ptr %v10, i32 1
32 store <16 x i8> %v18, ptr %v19, align 1
33 br label %b1, !llvm.loop !0
36 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
37 declare <16 x i32> @llvm.smin.v16i32(<16 x i32>, <16 x i32>) #1
39 attributes #0 = { "target-features"="+hvx-length64b,+hvxv66,+v66,-long-calls,-small-data" }
40 attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
42 !0 = distinct !{!0, !1}
43 !1 = !{!"llvm.loop.mustprogress"}