• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=hexagon < %s | FileCheck %s
2
3; During lowering, a BUILD_VECTOR of undef values was created. This was
4; not properly handled by buildHvxVectorReg, which tried to generate a
5; splat, but had no source value.
6;
7; Check that this compiles successfully.
8; CHECK: vsplat
9
10target 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"
11target triple = "hexagon"
12
13define void @fred() #0 {
14b0:
15  %v1 = load i8, i8* undef, align 1
16  %v2 = insertelement <32 x i8> undef, i8 %v1, i32 31
17  %v3 = zext <32 x i8> %v2 to <32 x i16>
18  %v4 = add nuw nsw <32 x i16> %v3, zeroinitializer
19  %v5 = add nuw nsw <32 x i16> %v4, zeroinitializer
20  %v6 = add nuw nsw <32 x i16> %v5, zeroinitializer
21  %v7 = add nuw nsw <32 x i16> %v6, zeroinitializer
22  %v8 = add nuw nsw <32 x i16> %v7, zeroinitializer
23  %v9 = add nuw nsw <32 x i16> %v8, zeroinitializer
24  %v10 = add <32 x i16> %v9, zeroinitializer
25  %v11 = add <32 x i16> %v10, zeroinitializer
26  %v12 = add <32 x i16> %v11, zeroinitializer
27  %v13 = add <32 x i16> %v12, zeroinitializer
28  %v14 = add <32 x i16> %v13, zeroinitializer
29  %v15 = add <32 x i16> %v14, zeroinitializer
30  %v16 = add <32 x i16> %v15, zeroinitializer
31  %v17 = add <32 x i16> %v16, zeroinitializer
32  %v18 = add <32 x i16> %v17, zeroinitializer
33  %v19 = lshr <32 x i16> %v18, <i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4, i16 4>
34  %v20 = trunc <32 x i16> %v19 to <32 x i8>
35  store <32 x i8> %v20, <32 x i8>* undef, align 1
36  unreachable
37}
38
39attributes #0 = { norecurse nounwind "target-cpu"="hexagonv60" "target-features"="+hvx-length64b,+hvxv60" }
40