1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
4 ; Check that pmull2 instruction is used for vmull_high_p8 intrinsic
5 ; even if shufflevector instructions are located in different basic blocks,
6 ; which can happen when vmull_high_p8 is used inside a loop body.
9 define <8 x i16> @test_pmull2_sink(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c, i1 %t) {
10 ; CHECK-LABEL: test_pmull2_sink:
11 ; CHECK: // %bb.0: // %entry
12 ; CHECK-NEXT: tbz w0, #0, .LBB0_2
13 ; CHECK-NEXT: // %bb.1: // %if.then
14 ; CHECK-NEXT: pmull2 v0.8h, v0.16b, v1.16b
16 ; CHECK-NEXT: .LBB0_2: // %cleanup
17 ; CHECK-NEXT: mov v0.16b, v2.16b
20 %0 = shufflevector <16 x i8> %a, <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
21 br i1 %t, label %if.then, label %cleanup
24 %1 = shufflevector <16 x i8> %b, <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
25 %res = tail call <8 x i16> @llvm.aarch64.neon.pmull.v8i16(<8 x i8> %0, <8 x i8> %1)
29 %retval = phi <8 x i16> [ %res, %if.then ], [ %c, %entry ]
33 define <8 x i16> @test_pmull2_sink2(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c, i1 %t) {
34 ; CHECK-LABEL: test_pmull2_sink2:
35 ; CHECK: // %bb.0: // %entry
36 ; CHECK-NEXT: tbz w0, #0, .LBB1_2
37 ; CHECK-NEXT: // %bb.1: // %if.then
38 ; CHECK-NEXT: pmull2 v0.8h, v0.16b, v0.16b
40 ; CHECK-NEXT: .LBB1_2: // %cleanup
41 ; CHECK-NEXT: mov v0.16b, v2.16b
44 %0 = shufflevector <16 x i8> %a, <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
45 %1 = shufflevector <16 x i8> %a, <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
46 br i1 %t, label %if.then, label %cleanup
49 %res = tail call <8 x i16> @llvm.aarch64.neon.pmull.v8i16(<8 x i8> %0, <8 x i8> %1)
53 %retval = phi <8 x i16> [ %res, %if.then ], [ %c, %entry ]
57 define <8 x i16> @test_pmull2_sink3(<16 x i8> %a, <16 x i8> %b, <8 x i16> %c, i1 %t, i1 %t2) {
58 ; CHECK-LABEL: test_pmull2_sink3:
59 ; CHECK: // %bb.0: // %entry
60 ; CHECK-NEXT: tbz w0, #0, .LBB2_2
61 ; CHECK-NEXT: // %bb.1: // %if.then
62 ; CHECK-NEXT: tbz w1, #0, .LBB2_3
63 ; CHECK-NEXT: .LBB2_2: // %if.then.2
64 ; CHECK-NEXT: pmull2 v0.8h, v0.16b, v1.16b
66 ; CHECK-NEXT: .LBB2_3: // %cleanup
67 ; CHECK-NEXT: pmull2 v0.8h, v0.16b, v0.16b
70 %0 = shufflevector <16 x i8> %a, <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
71 br i1 %t, label %if.then, label %if.then.2
74 %res = tail call <8 x i16> @llvm.aarch64.neon.pmull.v8i16(<8 x i8> %0, <8 x i8> %0)
75 br i1 %t2, label %if.then.2, label %cleanup
78 %1 = shufflevector <16 x i8> %b, <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
79 %res2 = tail call <8 x i16> @llvm.aarch64.neon.pmull.v8i16(<8 x i8> %0, <8 x i8> %1)
83 %retval = phi <8 x i16> [ %res2, %if.then.2 ], [ %res, %if.then ]
87 declare <8 x i16> @llvm.aarch64.neon.pmull.v8i16(<8 x i8>, <8 x i8>)