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 dso_local void @f0(ptr %a0) local_unnamed_addr #0 {
11 %v0 = getelementptr inbounds i16, ptr %a0, i32 undef
12 %v1 = load <64 x i16>, ptr undef, align 2
13 %v2 = shufflevector <64 x i16> %v1, <64 x i16> undef, <8 x i32> <i32 2, i32 10, i32 18, i32 26, i32 34, i32 42, i32 50, i32 58>
14 %v3 = shufflevector <64 x i16> %v1, <64 x i16> undef, <8 x i32> <i32 6, i32 14, i32 22, i32 30, i32 38, i32 46, i32 54, i32 62>
15 %v4 = sext <8 x i16> %v2 to <8 x i32>
16 %v5 = mul nsw <8 x i32> %v4, <i32 60548, i32 60548, i32 60548, i32 60548, i32 60548, i32 60548, i32 60548, i32 60548>
17 %v6 = sext <8 x i16> %v3 to <8 x i32>
18 %v7 = mul nsw <8 x i32> %v6, <i32 25080, i32 25080, i32 25080, i32 25080, i32 25080, i32 25080, i32 25080, i32 25080>
19 %v8 = add nsw <8 x i32> %v5, <i32 32768, i32 32768, i32 32768, i32 32768, i32 32768, i32 32768, i32 32768, i32 32768>
20 %v9 = add <8 x i32> %v8, %v7
21 %v10 = ashr <8 x i32> %v9, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
22 %v11 = add nsw <8 x i32> %v10, zeroinitializer
23 %v12 = shl <8 x i32> %v11, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
24 %v13 = ashr exact <8 x i32> %v12, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16>
25 %v14 = add nsw <8 x i32> zeroinitializer, %v13
26 %v15 = trunc <8 x i32> %v14 to <8 x i16>
27 %v16 = extractelement <8 x i16> %v15, i32 0
28 store i16 %v16, ptr %v0, align 2
32 attributes #0 = { "target-features"="+v66,+hvxv66,+hvx,+hvx-length64b" }