blob: 0facdc335554d3a37a3f6b347fcb211e003e3813 [file] [log] [blame]
Krzysztof Parzyszekb1b03722016-08-18 14:12:34 +00001; RUN: llc -march=hexagon < %s | FileCheck %s
2
3; This testcase is known to generate an opportunity for creating vcombine
4; in HexagonCopyToCombine.
5
6; CHECK: vcombine
7
8target triple = "hexagon-unknown--elf"
9
10declare <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32>) #0
11declare <32 x i32> @llvm.hexagon.V6.vabsdiffuh.128B(<32 x i32>, <32 x i32>) #0
12declare <32 x i32> @llvm.hexagon.V6.vlalignbi.128B(<32 x i32>, <32 x i32>, i32) #0
13declare <32 x i32> @llvm.hexagon.V6.vsathub.128B(<32 x i32>, <32 x i32>) #0
14declare <64 x i32> @llvm.hexagon.V6.vaddh.dv.128B(<64 x i32>, <64 x i32>) #0
15declare <64 x i32> @llvm.hexagon.V6.vadduhsat.dv.128B(<64 x i32>, <64 x i32>) #0
16declare <64 x i32> @llvm.hexagon.V6.vaddubh.128B(<32 x i32>, <32 x i32>) #0
17declare <64 x i32> @llvm.hexagon.V6.vmpyub.128B(<32 x i32>, i32) #0
18
19define void @foo() local_unnamed_addr #1 {
20entry:
21 %0 = load <32 x i32>, <32 x i32>* undef, align 128
22 %1 = load <32 x i32>, <32 x i32>* null, align 128
23 br i1 undef, label %b2, label %b1
24
25b1: ; preds = %entry
26 %2 = tail call <32 x i32> @llvm.hexagon.V6.vlalignbi.128B(<32 x i32> %0, <32 x i32> %1, i32 1)
27 %3 = tail call <64 x i32> @llvm.hexagon.V6.vmpyub.128B(<32 x i32> %2, i32 33686018) #1
28 %4 = tail call <64 x i32> @llvm.hexagon.V6.vadduhsat.dv.128B(<64 x i32> undef, <64 x i32> %3) #1
29 %5 = tail call <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32> %4)
30 %6 = tail call <32 x i32> @llvm.hexagon.V6.vabsdiffuh.128B(<32 x i32> %5, <32 x i32> undef) #1
31 %7 = tail call <64 x i32> @llvm.hexagon.V6.vaddubh.128B(<32 x i32> %6, <32 x i32> undef)
32 %8 = tail call <64 x i32> @llvm.hexagon.V6.vaddh.dv.128B(<64 x i32> undef, <64 x i32> %7) #1
33 %9 = tail call <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32> %8) #1
34 %10 = tail call <32 x i32> @llvm.hexagon.V6.vsathub.128B(<32 x i32> %9, <32 x i32> undef) #1
35 store <32 x i32> %10, <32 x i32>* undef, align 128
36 br label %b2
37
38b2: ; preds = %b1, %entry
39 %c2.host31.sroa.3.2.unr.ph = phi <32 x i32> [ zeroinitializer, %b1 ], [ %0, %entry ]
40 %c2.host31.sroa.0.2.unr.ph = phi <32 x i32> [ %0, %b1 ], [ %1, %entry ]
41 %11 = tail call <32 x i32> @llvm.hexagon.V6.vlalignbi.128B(<32 x i32> %c2.host31.sroa.3.2.unr.ph, <32 x i32> %c2.host31.sroa.0.2.unr.ph, i32 1)
42 %12 = tail call <64 x i32> @llvm.hexagon.V6.vmpyub.128B(<32 x i32> %11, i32 33686018) #1
43 %13 = tail call <64 x i32> @llvm.hexagon.V6.vadduhsat.dv.128B(<64 x i32> undef, <64 x i32> %12) #1
44 %14 = tail call <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32> %13)
45 %15 = tail call <32 x i32> @llvm.hexagon.V6.vabsdiffuh.128B(<32 x i32> %14, <32 x i32> undef) #1
46 %16 = tail call <64 x i32> @llvm.hexagon.V6.vaddubh.128B(<32 x i32> %15, <32 x i32> undef)
47 %17 = tail call <64 x i32> @llvm.hexagon.V6.vaddh.dv.128B(<64 x i32> undef, <64 x i32> %16) #1
48 %18 = tail call <32 x i32> @llvm.hexagon.V6.hi.128B(<64 x i32> %17) #1
49 %19 = tail call <32 x i32> @llvm.hexagon.V6.vsathub.128B(<32 x i32> %18, <32 x i32> undef) #1
50 store <32 x i32> %19, <32 x i32>* undef, align 128
51 ret void
52}
53
54attributes #0 = { nounwind readnone }
Sumanth Gundapanenie1983bc2017-10-18 18:07:07 +000055attributes #1 = { nounwind "target-cpu"="hexagonv60" "target-features"="+hvx,+hvx-length128b" }
Krzysztof Parzyszekb1b03722016-08-18 14:12:34 +000056