Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ModuleID = 'hand-daxpy.c'
- source_filename = "hand-daxpy.c"
- target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
- target triple = "x86_64-unknown-linux-gnu"
- @main.m = private unnamed_addr constant [3 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00], align 16
- @main.n = private unnamed_addr constant [3 x double] [double 4.000000e+00, double 5.000000e+00, double 6.000000e+00], align 16
- @.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
- ; Function Attrs: norecurse nounwind uwtable
- define dso_local i32 @daxpy_(i32 %nn, double %ssa, double* nocapture readonly %sx, i32 %iincx, double* nocapture %sy, i32 %iincy) local_unnamed_addr #0 {
- entry:
- %cmp = icmp sgt i32 %nn, 0
- %cmp1 = fcmp une double %ssa, 0.000000e+00
- %or.cond = and i1 %cmp, %cmp1
- br i1 %or.cond, label %if.then, label %if.end69
- if.then: ; preds = %entry
- %cmp2 = icmp eq i32 %iincx, 1
- %cmp4 = icmp eq i32 %iincy, 1
- %or.cond70 = and i1 %cmp2, %cmp4
- br i1 %or.cond70, label %if.then5, label %if.else
- if.then5: ; preds = %if.then
- %sub = add nsw i32 %nn, -3
- %conv = sext i32 %sub to i64
- %cmp6123 = icmp sgt i32 %nn, 3
- br i1 %cmp6123, label %for.body.preheader, label %for.cond28.preheader
- for.body.preheader: ; preds = %if.then5
- %0 = icmp sgt i64 %conv, 4
- %smax = select i1 %0, i64 %conv, i64 4
- br label %for.body
- for.cond28.preheader.loopexit: ; preds = %for.body
- %1 = add nuw nsw i64 %smax, 3
- %2 = and i64 %1, 9223372036854775804
- br label %for.cond28.preheader
- for.cond28.preheader: ; preds = %for.cond28.preheader.loopexit, %if.then5
- %i.0.lcssa = phi i64 [ 0, %if.then5 ], [ %2, %for.cond28.preheader.loopexit ]
- %conv29 = sext i32 %nn to i64
- %cmp30121 = icmp slt i64 %i.0.lcssa, %conv29
- br i1 %cmp30121, label %for.body32, label %if.end69
- for.body: ; preds = %for.body.preheader, %for.body
- %i.0124 = phi i64 [ %add27, %for.body ], [ 0, %for.body.preheader ]
- %arrayidx = getelementptr inbounds double, double* %sx, i64 %i.0124
- %3 = load double, double* %arrayidx, align 8, !tbaa !2
- %mul = fmul double %3, %ssa
- %arrayidx8 = getelementptr inbounds double, double* %sy, i64 %i.0124
- %4 = load double, double* %arrayidx8, align 8, !tbaa !2
- %add = fadd double %4, %mul
- store double %add, double* %arrayidx8, align 8, !tbaa !2
- %add9 = or i64 %i.0124, 1
- %arrayidx10 = getelementptr inbounds double, double* %sx, i64 %add9
- %5 = load double, double* %arrayidx10, align 8, !tbaa !2
- %mul11 = fmul double %5, %ssa
- %arrayidx13 = getelementptr inbounds double, double* %sy, i64 %add9
- %6 = load double, double* %arrayidx13, align 8, !tbaa !2
- %add14 = fadd double %6, %mul11
- store double %add14, double* %arrayidx13, align 8, !tbaa !2
- %add15 = or i64 %i.0124, 2
- %arrayidx16 = getelementptr inbounds double, double* %sx, i64 %add15
- %7 = load double, double* %arrayidx16, align 8, !tbaa !2
- %mul17 = fmul double %7, %ssa
- %arrayidx19 = getelementptr inbounds double, double* %sy, i64 %add15
- %8 = load double, double* %arrayidx19, align 8, !tbaa !2
- %add20 = fadd double %8, %mul17
- store double %add20, double* %arrayidx19, align 8, !tbaa !2
- %add21 = or i64 %i.0124, 3
- %arrayidx22 = getelementptr inbounds double, double* %sx, i64 %add21
- %9 = load double, double* %arrayidx22, align 8, !tbaa !2
- %mul23 = fmul double %9, %ssa
- %arrayidx25 = getelementptr inbounds double, double* %sy, i64 %add21
- %10 = load double, double* %arrayidx25, align 8, !tbaa !2
- %add26 = fadd double %10, %mul23
- store double %add26, double* %arrayidx25, align 8, !tbaa !2
- %add27 = add nuw nsw i64 %i.0124, 4
- %cmp6 = icmp slt i64 %add27, %conv
- br i1 %cmp6, label %for.body, label %for.cond28.preheader.loopexit
- for.body32: ; preds = %for.cond28.preheader, %for.body32
- %i.1122 = phi i64 [ %inc, %for.body32 ], [ %i.0.lcssa, %for.cond28.preheader ]
- %arrayidx33 = getelementptr inbounds double, double* %sx, i64 %i.1122
- %11 = load double, double* %arrayidx33, align 8, !tbaa !2
- %mul34 = fmul double %11, %ssa
- %arrayidx35 = getelementptr inbounds double, double* %sy, i64 %i.1122
- %12 = load double, double* %arrayidx35, align 8, !tbaa !2
- %add36 = fadd double %12, %mul34
- store double %add36, double* %arrayidx35, align 8, !tbaa !2
- %inc = add nuw nsw i64 %i.1122, 1
- %exitcond = icmp eq i64 %inc, %conv29
- br i1 %exitcond, label %if.end69, label %for.body32
- if.else: ; preds = %if.then
- %cmp39 = icmp sgt i32 %iincx, -1
- br i1 %cmp39, label %cond.end, label %cond.false
- cond.false: ; preds = %if.else
- %sub41 = sub nsw i32 1, %nn
- %mul42 = mul nsw i32 %sub41, %iincx
- %phitmp = sext i32 %mul42 to i64
- br label %cond.end
- cond.end: ; preds = %if.else, %cond.false
- %cond = phi i64 [ %phitmp, %cond.false ], [ 0, %if.else ]
- %cmp44 = icmp sgt i32 %iincy, -1
- br i1 %cmp44, label %for.body57.lr.ph, label %cond.false47
- cond.false47: ; preds = %cond.end
- %sub48 = sub nsw i32 1, %nn
- %mul49 = mul nsw i32 %sub48, %iincy
- %phitmp119 = sext i32 %mul49 to i64
- br label %for.body57.lr.ph
- for.body57.lr.ph: ; preds = %cond.false47, %cond.end
- %cond51 = phi i64 [ %phitmp119, %cond.false47 ], [ 0, %cond.end ]
- %conv54 = sext i32 %nn to i64
- %conv62 = sext i32 %iincx to i64
- %conv64 = sext i32 %iincy to i64
- br label %for.body57
- for.body57: ; preds = %for.body57, %for.body57.lr.ph
- %iy.0128 = phi i64 [ %cond51, %for.body57.lr.ph ], [ %add65, %for.body57 ]
- %ix.0127 = phi i64 [ %cond, %for.body57.lr.ph ], [ %add63, %for.body57 ]
- %i.2126 = phi i64 [ 0, %for.body57.lr.ph ], [ %inc67, %for.body57 ]
- %arrayidx58 = getelementptr inbounds double, double* %sx, i64 %ix.0127
- %13 = load double, double* %arrayidx58, align 8, !tbaa !2
- %mul59 = fmul double %13, %ssa
- %arrayidx60 = getelementptr inbounds double, double* %sy, i64 %iy.0128
- %14 = load double, double* %arrayidx60, align 8, !tbaa !2
- %add61 = fadd double %14, %mul59
- store double %add61, double* %arrayidx60, align 8, !tbaa !2
- %add63 = add nsw i64 %ix.0127, %conv62
- %add65 = add nsw i64 %iy.0128, %conv64
- %inc67 = add nuw nsw i64 %i.2126, 1
- %exitcond130 = icmp eq i64 %inc67, %conv54
- br i1 %exitcond130, label %if.end69, label %for.body57
- if.end69: ; preds = %for.body57, %for.body32, %for.cond28.preheader, %entry
- ret i32 0
- }
- ; Function Attrs: argmemonly nounwind
- declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
- ; Function Attrs: argmemonly nounwind
- declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
- ; Function Attrs: nounwind uwtable
- define dso_local i32 @main() local_unnamed_addr #2 {
- entry:
- %m = alloca [3 x double], align 16
- %n = alloca [3 x double], align 16
- %0 = bitcast [3 x double]* %m to i8*
- call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %0) #4
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 16 %0, i8* align 16 bitcast ([3 x double]* @main.m to i8*), i64 24, i1 false)
- %1 = bitcast [3 x double]* %n to i8*
- call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %1) #4
- call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 16 %1, i8* align 16 bitcast ([3 x double]* @main.n to i8*), i64 24, i1 false)
- %arraydecay = getelementptr inbounds [3 x double], [3 x double]* %m, i64 0, i64 0
- %arraydecay1 = getelementptr inbounds [3 x double], [3 x double]* %n, i64 0, i64 0
- %call = call i32 @daxpy_(i32 3, double 1.000000e+00, double* nonnull %arraydecay, i32 1, double* nonnull %arraydecay1, i32 1)
- br label %for.body
- for.cond.cleanup: ; preds = %for.body
- call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %1) #4
- call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %0) #4
- ret i32 0
- for.body: ; preds = %for.body, %entry
- %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
- %arrayidx = getelementptr inbounds [3 x double], [3 x double]* %n, i64 0, i64 %indvars.iv
- %2 = load double, double* %arrayidx, align 8, !tbaa !2
- %call2 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
- %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
- %exitcond = icmp eq i64 %indvars.iv.next, 3
- br i1 %exitcond, label %for.cond.cleanup, label %for.body
- }
- ; Function Attrs: argmemonly nounwind
- declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #1
- ; Function Attrs: nounwind
- declare dso_local i32 @printf(i8* nocapture readonly, ...) local_unnamed_addr #3
- attributes #0 = { norecurse nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
- attributes #1 = { argmemonly nounwind }
- attributes #2 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
- attributes #3 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
- attributes #4 = { nounwind }
- !llvm.module.flags = !{!0}
- !llvm.ident = !{!1}
- !0 = !{i32 1, !"wchar_size", i32 4}
- !1 = !{!"clang version 7.1.0 "}
- !2 = !{!3, !3, i64 0}
- !3 = !{!"double", !4, i64 0}
- !4 = !{!"omnipotent char", !5, i64 0}
- !5 = !{!"Simple C/C++ TBAA"}
Advertisement
Add Comment
Please, Sign In to add comment