blob: 516419b7372fc2ad87a7e44a143cb569a981ba52 [file] [log] [blame]
Krzysztof Parzyszek5d41cc12018-03-12 17:47:46 +00001; RUN: llc -march=hexagon -mattr=+hvxv60,hvx-length64b < %s | FileCheck %s --check-prefix=CHECK-GATHER
2; RUN: not llc -march=hexagon -mattr=+hvxv60,hvx-length64b,-packets %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
3
4target triple = "hexagon"
5
6; CHECK-GATHER-LABEL: fred:
7; CHECK-GATHER: vgather
8; CHECK-ERROR: LLVM ERROR: Support for gather requires packets, which are disabled
9
10define void @fred(i8* %p, i32 %x, i32 %y) local_unnamed_addr #0 {
11entry:
12 %v = alloca <16 x i32>, align 64
13 %0 = bitcast <16 x i32>* %v to i8*
14 call void @llvm.lifetime.start(i64 64, i8* nonnull %0) #3
15 tail call void @llvm.hexagon.V6.vgathermw(i8* %p, i32 %x, i32 %y, <16 x i32> undef)
16 call void @foo(i8* nonnull %0) #0
17 call void @llvm.lifetime.end(i64 64, i8* nonnull %0) #3
18 ret void
19}
20
21declare void @llvm.lifetime.start(i64, i8* nocapture) #1
22declare void @llvm.hexagon.V6.vgathermw(i8*, i32, i32, <16 x i32>) #1
23declare void @foo(i8*) local_unnamed_addr #0
24declare void @llvm.lifetime.end(i64, i8* nocapture) #1
25
26attributes #0 = { nounwind "target-cpu"="hexagonv65" }
27attributes #1 = { argmemonly nounwind }