brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 9f893af Raw
81 lines · plain
1; RUN: llc < %s -mtriple=bpf -mcpu=v1 -verify-machineinstrs | FileCheck %s2; RUN: llc < %s -mtriple=bpf -mcpu=v1 -mattr=+alu32 -verify-machineinstrs | FileCheck --check-prefix=CHECK-32 %s3;4; void cal1(unsigned short *a, unsigned long *b, unsigned int k)5; {6;   unsigned short e;7;8;   e = *a;9;   for (unsigned int i = 0; i < k; i++) {10;     b[i] = e;11;     e = ~e;12;   }13; }14;15; void cal2(unsigned short *a, unsigned int *b, unsigned int k)16; {17;   unsigned short e;18;19;   e = *a;20;   for (unsigned int i = 0; i < k; i++) {21;     b[i] = e;22;     e = ~e;23;   }24; }25 26; Function Attrs: nofree norecurse nounwind optsize27define dso_local void @cal1(ptr nocapture readonly %a, ptr nocapture %b, i32 %k) local_unnamed_addr #0 {28entry:29  %cmp8 = icmp eq i32 %k, 030  br i1 %cmp8, label %for.cond.cleanup, label %for.body.preheader31 32for.body.preheader:                               ; preds = %entry33  %0 = load i16, ptr %a, align 234  %wide.trip.count = zext i32 %k to i6435  br label %for.body36 37for.cond.cleanup:                                 ; preds = %for.body, %entry38  ret void39 40for.body:                                         ; preds = %for.body, %for.body.preheader41  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]42  %e.09 = phi i16 [ %0, %for.body.preheader ], [ %neg, %for.body ]43  %conv = zext i16 %e.09 to i6444  %arrayidx = getelementptr inbounds i64, ptr %b, i64 %indvars.iv45; CHECK: r{{[0-9]+}} &= 6553546; CHECK-32: r{{[0-9]+}} &= 6553547  store i64 %conv, ptr %arrayidx, align 848  %neg = xor i16 %e.09, -149  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 150  %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count51  br i1 %exitcond, label %for.cond.cleanup, label %for.body52}53 54; Function Attrs: nofree norecurse nounwind optsize55define dso_local void @cal2(ptr nocapture readonly %a, ptr nocapture %b, i32 %k) local_unnamed_addr #0 {56entry:57  %cmp8 = icmp eq i32 %k, 058  br i1 %cmp8, label %for.cond.cleanup, label %for.body.preheader59 60for.body.preheader:                               ; preds = %entry61  %0 = load i16, ptr %a, align 262  %wide.trip.count = zext i32 %k to i6463  br label %for.body64 65for.cond.cleanup:                                 ; preds = %for.body, %entry66  ret void67 68for.body:                                         ; preds = %for.body, %for.body.preheader69  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]70  %e.09 = phi i16 [ %0, %for.body.preheader ], [ %neg, %for.body ]71  %conv = zext i16 %e.09 to i3272  %arrayidx = getelementptr inbounds i32, ptr %b, i64 %indvars.iv73; CHECK: r{{[0-9]+}} &= 6553574; CHECK-32: w{{[0-9]+}} &= 6553575  store i32 %conv, ptr %arrayidx, align 476  %neg = xor i16 %e.09, -177  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 178  %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count79  br i1 %exitcond, label %for.cond.cleanup, label %for.body80}81