xref: /llvm-project/llvm/test/CodeGen/VE/Vector/ticket-64420.ll (revision 2e2395651e4327eec820424f9d647b856745aeb4)
1; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
2; RUN: llc < %s -mtriple=ve -mattr=-vpu | FileCheck --check-prefix=SCALAR %s
3
4; Check vector and scalar code generation for vector load instruction.
5; For the case of vector, generates vst with 4 vector length.  For the
6; case of scalar, generates 2 stores of 8 bytes length.
7
8; This is taken from a ticket below.
9;   https://github.com/llvm/llvm-project/issues/64420
10
11; CHECK-LABEL: func:
12; CHECK:       # %bb.1:
13; CHECK-NEXT:    lea %s1, 256
14; CHECK-NEXT:    lvl %s1
15; CHECK-NEXT:    vbrd %v0, 0
16; CHECK-NEXT:    or %s1, 4, (0)1
17; CHECK-NEXT:    lvl %s1
18; CHECK-NEXT:    vstl %v0, 4, %s0
19; CHECK-NEXT:    b.l.t (, %s10)
20
21; SCALAR-LABEL: func:
22; SCALAR:       # %bb.1:
23; SCALAR-NEXT:    st %s1, 8(, %s0)
24; SCALAR-NEXT:    st %s1, (, %s0)
25; SCALAR-NEXT:    b.l.t (, %s10)
26
27; ModuleID = 'bugpoint-reduced-simplified.bc'
28source_filename = "test.c"
29target datalayout = "e-m:e-i64:64-n32:64-S128-v64:64:64-v128:64:64-v256:64:64-v512:64:64-v1024:64:64-v2048:64:64-v4096:64:64-v8192:64:64-v16384:64:64"
30target triple = "ve-unknown-linux-gnu"
31
32define dso_local void @func(ptr %_0) unnamed_addr #0 {
33start:
34  br i1 poison, label %bb7, label %panic3
35
36bb7:                                              ; preds = %start
37  store <4 x i32> zeroinitializer, ptr %_0, align 4
38  ret void
39
40panic3:                                           ; preds = %start
41  unreachable
42}
43
44attributes #0 = { "target-features"="+vpu" }
45