1 ; RUN: llc -mtriple=hexagon-unknown-elf < %s | FileCheck %s 2 3 ; CHECK-LABEL: ldf 4 ; CHECK: memw(r{{[0-9]+}}++#4) 5 ; CHECK: memw(r{{[0-9]+}}++#4) 6 define float @ldf(float* nocapture readonly %x, float* nocapture readonly %y) local_unnamed_addr #0 { 7 entry: 8 br label %for.body 9 10 for.body: 11 %arrayidx.phi = phi float* [ %x, %entry ], [ %arrayidx.inc, %for.body ] 12 %arrayidx1.phi = phi float* [ %y, %entry ], [ %arrayidx1.inc, %for.body ] 13 %i.09 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 14 %acc.08 = phi float [ 0.000000e+00, %entry ], [ %add, %for.body ] 15 %0 = load float, float* %arrayidx.phi, align 4 16 %1 = load float, float* %arrayidx1.phi, align 4 17 %mul = fmul contract float %0, %1 18 %add = fadd contract float %acc.08, %mul 19 %inc = add nuw nsw i32 %i.09, 1 20 %exitcond = icmp eq i32 %inc, 1024 21 %arrayidx.inc = getelementptr float, float* %arrayidx.phi, i32 1 22 %arrayidx1.inc = getelementptr float, float* %arrayidx1.phi, i32 1 23 br i1 %exitcond, label %for.end, label %for.body 24 25 for.end: 26 ret float %add 27 } 28 29 ; CHECK-LABEL: ldd 30 ; CHECK: memd(r{{[0-9]+}}++#8) 31 ; CHECK: memd(r{{[0-9]+}}++#8) 32 define double @ldd(double* nocapture readonly %x, double* nocapture readonly %y) local_unnamed_addr #0 { 33 entry: 34 br label %for.body 35 36 for.body: 37 %arrayidx.phi = phi double* [ %x, %entry ], [ %arrayidx.inc, %for.body ] 38 %arrayidx1.phi = phi double* [ %y, %entry ], [ %arrayidx1.inc, %for.body ] 39 %i.09 = phi i32 [ 0, %entry ], [ %inc, %for.body ] 40 %acc.08 = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ] 41 %0 = load double, double* %arrayidx.phi, align 8 42 %1 = load double, double* %arrayidx1.phi, align 8 43 %mul = fmul contract double %0, %1 44 %add = fadd contract double %acc.08, %mul 45 %inc = add nuw nsw i32 %i.09, 1 46 %exitcond = icmp eq i32 %inc, 1024 47 %arrayidx.inc = getelementptr double, double* %arrayidx.phi, i32 1 48 %arrayidx1.inc = getelementptr double, double* %arrayidx1.phi, i32 1 49 br i1 %exitcond, label %for.end, label %for.body 50 51 for.end: 52 ret double %add 53 } 54 55 ; CHECK-LABEL: stf 56 ; CHECK: memw(r{{[0-9]+}}++#4) 57 define double* @stf(float* returned %p) local_unnamed_addr #0 { 58 entry: 59 br label %for.body 60 61 for.body: 62 %arrayidx.phi = phi float* [ %arrayidx.inc, %for.body ], [ %p, %entry ] 63 %call = tail call float @foof() #2 64 store float %call, float* %arrayidx.phi, align 8 65 %arrayidx.inc = getelementptr float, float* %arrayidx.phi, i32 1 66 br label %for.body 67 } 68 69 declare float @foof() local_unnamed_addr #1 70 71 ; CHECK-LABEL: std 72 ; CHECK: memd(r{{[0-9]+}}++#8) 73 define double* @std(double* returned %p) local_unnamed_addr #0 { 74 entry: 75 br label %for.body 76 77 for.body: 78 %arrayidx.phi = phi double* [ %arrayidx.inc, %for.body ], [ %p, %entry ] 79 %call = tail call double @food() #2 80 store double %call, double* %arrayidx.phi, align 8 81 %arrayidx.inc = getelementptr double, double* %arrayidx.phi, i32 1 82 br label %for.body 83 } 84 85 declare double @food() local_unnamed_addr #1 86 87