1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu \
3 ; RUN: -mcpu=pwr9 < %s | FileCheck %s
4 define dso_local i64 @test1(i8* nocapture readonly %p, i32 signext %count) local_unnamed_addr #0 {
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: li 5, -13
10 ; CHECK-NEXT: li 8, 15
11 ; CHECK-NEXT: lxvx 0, 3, 5
12 ; CHECK-NEXT: li 5, 19
13 ; CHECK-NEXT: ldx 6, 3, 6
14 ; CHECK-NEXT: ldx 7, 3, 7
15 ; CHECK-NEXT: lxvx 1, 3, 5
17 ; CHECK-NEXT: ldx 5, 3, 5
18 ; CHECK-NEXT: ldx 3, 3, 8
19 ; CHECK-NEXT: mfvsrld 9, 0
20 ; CHECK-NEXT: mffprd 8, 0
21 ; CHECK-NEXT: mfvsrld 10, 1
22 ; CHECK-NEXT: mffprd 11, 1
23 ; CHECK-NEXT: mulld 8, 9, 8
24 ; CHECK-NEXT: mulld 5, 8, 5
25 ; CHECK-NEXT: mulld 5, 5, 10
26 ; CHECK-NEXT: mulld 5, 5, 11
27 ; CHECK-NEXT: mulld 5, 5, 6
28 ; CHECK-NEXT: mulld 5, 5, 7
29 ; CHECK-NEXT: maddld 3, 5, 3, 4
32 %add.ptr = getelementptr inbounds i8, i8* %p, i64 -13
33 %0 = bitcast i8* %add.ptr to <2 x i64>*
34 %1 = load <2 x i64>, <2 x i64>* %0, align 16
35 %add.ptr1 = getelementptr inbounds i8, i8* %p, i64 19
36 %2 = bitcast i8* %add.ptr1 to <2 x i64>*
37 %3 = load <2 x i64>, <2 x i64>* %2, align 16
38 %add.ptr3 = getelementptr inbounds i8, i8* %p, i64 3
39 %4 = bitcast i8* %add.ptr3 to i64*
40 %5 = load i64, i64* %4, align 8
41 %add.ptr5 = getelementptr inbounds i8, i8* %p, i64 7
42 %6 = bitcast i8* %add.ptr5 to i64*
43 %7 = load i64, i64* %6, align 8
44 %add.ptr7 = getelementptr inbounds i8, i8* %p, i64 11
45 %8 = bitcast i8* %add.ptr7 to i64*
46 %9 = load i64, i64* %8, align 8
47 %add.ptr9 = getelementptr inbounds i8, i8* %p, i64 15
48 %10 = bitcast i8* %add.ptr9 to i64*
49 %11 = load i64, i64* %10, align 8
50 %vecext = extractelement <2 x i64> %1, i32 1
51 %vecext13 = extractelement <2 x i64> %1, i32 0
52 %vecext15 = extractelement <2 x i64> %3, i32 0
53 %vecext17 = extractelement <2 x i64> %3, i32 1
54 %mul = mul i64 %vecext13, %vecext
55 %mul10 = mul i64 %mul, %5
56 %mul11 = mul i64 %mul10, %vecext15
57 %mul12 = mul i64 %mul11, %vecext17
58 %mul14 = mul i64 %mul12, %7
59 %mul16 = mul i64 %mul14, %9
60 %mul18 = mul i64 %mul16, %11
61 %conv = sext i32 %count to i64
62 %add19 = add i64 %mul18, %conv
66 define dso_local i64 @test2(i8* nocapture readonly %p, i32 signext %count) local_unnamed_addr #0 {
68 ; CHECK: # %bb.0: # %entry
70 ; CHECK-NEXT: ori 6, 5, 40009
71 ; CHECK-NEXT: ori 7, 5, 40001
72 ; CHECK-NEXT: ori 5, 5, 40005
73 ; CHECK-NEXT: ldx 6, 3, 6
74 ; CHECK-NEXT: ldx 7, 3, 7
75 ; CHECK-NEXT: ldx 3, 3, 5
76 ; CHECK-NEXT: mulld 5, 7, 6
77 ; CHECK-NEXT: maddld 3, 5, 3, 4
80 %add.ptr = getelementptr inbounds i8, i8* %p, i64 40009
81 %0 = bitcast i8* %add.ptr to i64*
82 %1 = load i64, i64* %0, align 8
83 %add.ptr2 = getelementptr inbounds i8, i8* %p, i64 40001
84 %2 = bitcast i8* %add.ptr2 to i64*
85 %3 = load i64, i64* %2, align 8
86 %add.ptr4 = getelementptr inbounds i8, i8* %p, i64 40005
87 %4 = bitcast i8* %add.ptr4 to i64*
88 %5 = load i64, i64* %4, align 8
90 %mul5 = mul i64 %mul, %5
91 %conv = sext i32 %count to i64
92 %add6 = add i64 %mul5, %conv
96 define dso_local i64 @test3(i8* nocapture readonly %p, i32 signext %count) local_unnamed_addr {
98 ; CHECK: # %bb.0: # %entry
99 ; CHECK-NEXT: lis 5, 1
100 ; CHECK-NEXT: ori 6, 5, 14497
101 ; CHECK-NEXT: ori 7, 5, 14465
102 ; CHECK-NEXT: ori 5, 5, 14481
103 ; CHECK-NEXT: ldx 6, 3, 6
104 ; CHECK-NEXT: ldx 7, 3, 7
105 ; CHECK-NEXT: ldx 3, 3, 5
106 ; CHECK-NEXT: mulld 5, 7, 6
107 ; CHECK-NEXT: maddld 3, 5, 3, 4
110 %add.ptr = getelementptr inbounds i8, i8* %p, i64 80033
111 %0 = bitcast i8* %add.ptr to i64*
112 %1 = load i64, i64* %0, align 8
113 %add.ptr2 = getelementptr inbounds i8, i8* %p, i64 80001
114 %2 = bitcast i8* %add.ptr2 to i64*
115 %3 = load i64, i64* %2, align 8
116 %add.ptr4 = getelementptr inbounds i8, i8* %p, i64 80017
117 %4 = bitcast i8* %add.ptr4 to i64*
118 %5 = load i64, i64* %4, align 8
119 %mul = mul i64 %3, %1
120 %mul5 = mul i64 %mul, %5
121 %conv = sext i32 %count to i64
122 %add6 = add i64 %mul5, %conv