1 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown -verify-machineinstrs < %s | FileCheck %s
2 ; RUN: llc -mcpu=pwr8 -mtriple=powerpc64-unknown-unknown -verify-machineinstrs < %s | FileCheck %s
4 ; Function Attrs: norecurse nounwind readonly
5 define float @testSingleAccess(i32* nocapture readonly %arr) local_unnamed_addr #0 {
6 ; CHECK-LABEL: testSingleAccess:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: addi 3, 3, 8
9 ; CHECK-NEXT: lfiwax 0, 0, 3
10 ; CHECK-NEXT: xscvsxdsp 1, 0
13 %arrayidx = getelementptr inbounds i32, i32* %arr, i64 2
14 %0 = load i32, i32* %arrayidx, align 4
15 %conv = sitofp i32 %0 to float
19 ; Function Attrs: norecurse nounwind readonly
20 define float @testMultipleAccess(i32* nocapture readonly %arr) local_unnamed_addr #0 {
21 ; CHECK-LABEL: testMultipleAccess:
22 ; CHECK: # %bb.0: # %entry
23 ; CHECK-NEXT: lwz 4, 8(3)
24 ; CHECK-NEXT: lwz 3, 12(3)
25 ; CHECK-NEXT: add 3, 3, 4
26 ; CHECK-NEXT: mtfprwa 0, 3
27 ; CHECK-NEXT: xscvsxdsp 1, 0
30 %arrayidx = getelementptr inbounds i32, i32* %arr, i64 2
31 %0 = load i32, i32* %arrayidx, align 4
32 %arrayidx1 = getelementptr inbounds i32, i32* %arr, i64 3
33 %1 = load i32, i32* %arrayidx1, align 4
34 %add = add nsw i32 %1, %0
35 %conv = sitofp i32 %add to float