Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************************************************
- $ clang-7 -O2 -S -emit-llvm test.c
- int expr_0_0(int64_t *addrs, int64_t *local_bitmaps,
- int64_t execution_context_ptr, int64_t nrecords) {
- int *outVec = (int *) addrs[5];
- int *c0Vec = (int *) addrs[1];
- int *c1Vec = (int *) addrs[3];
- for (int loop_var = 0; loop_var < nrecords; ++loop_var) {
- int c0 = c0Vec[loop_var];
- int c1 = c1Vec[loop_var];
- int out = c0 + c1;
- outVec[loop_var] = out;
- }
- }
- ****************************************************************/
- ; ModuleID = 'test.c'
- source_filename = "test.c"
- target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
- target triple = "x86_64-pc-linux-gnu"
- ; Function Attrs: norecurse nounwind uwtable
- define dso_local i32 @expr_0_0(i64* nocapture readonly, i64* nocapture readnone, i64, i64) local_unnamed_addr #0 {
- %5 = getelementptr inbounds i64, i64* %0, i64 5
- %6 = bitcast i64* %5 to i32**
- %7 = load i32*, i32** %6, align 8, !tbaa !2
- %8 = getelementptr inbounds i64, i64* %0, i64 1
- %9 = bitcast i64* %8 to i32**
- %10 = load i32*, i32** %9, align 8, !tbaa !2
- %11 = getelementptr inbounds i64, i64* %0, i64 3
- %12 = bitcast i64* %11 to i32**
- %13 = load i32*, i32** %12, align 8, !tbaa !2
- %14 = icmp sgt i64 %3, 0
- br i1 %14, label %15, label %125
- ; <label>:15: ; preds = %4
- %16 = icmp ult i64 %3, 8
- br i1 %16, label %17, label %38
- ; <label>:17: ; preds = %123, %38, %15
- %18 = phi i64 [ 0, %38 ], [ 0, %15 ], [ %50, %123 ]
- %19 = xor i64 %18, -1
- %20 = add i64 %19, %3
- %21 = and i64 %3, 3
- %22 = icmp eq i64 %21, 0
- br i1 %22, label %35, label %23
- ; <label>:23: ; preds = %17, %23
- %24 = phi i64 [ %32, %23 ], [ %18, %17 ]
- %25 = phi i64 [ %33, %23 ], [ %21, %17 ]
- %26 = getelementptr inbounds i32, i32* %10, i64 %24
- %27 = load i32, i32* %26, align 4, !tbaa !6
- %28 = getelementptr inbounds i32, i32* %13, i64 %24
- %29 = load i32, i32* %28, align 4, !tbaa !6
- %30 = add nsw i32 %29, %27
- %31 = getelementptr inbounds i32, i32* %7, i64 %24
- store i32 %30, i32* %31, align 4, !tbaa !6
- %32 = add nuw nsw i64 %24, 1
- %33 = add i64 %25, -1
- %34 = icmp eq i64 %33, 0
- br i1 %34, label %35, label %23, !llvm.loop !8
- ; <label>:35: ; preds = %23, %17
- %36 = phi i64 [ %18, %17 ], [ %32, %23 ]
- %37 = icmp ult i64 %20, 3
- br i1 %37, label %125, label %126
- ; <label>:38: ; preds = %15
- %39 = getelementptr i32, i32* %7, i64 %3
- %40 = getelementptr i32, i32* %10, i64 %3
- %41 = getelementptr i32, i32* %13, i64 %3
- %42 = icmp ult i32* %7, %40
- %43 = icmp ult i32* %10, %39
- %44 = and i1 %42, %43
- %45 = icmp ult i32* %7, %41
- %46 = icmp ult i32* %13, %39
- %47 = and i1 %45, %46
- %48 = or i1 %44, %47
- br i1 %48, label %17, label %49
- ; <label>:49: ; preds = %38
- %50 = and i64 %3, -8
- %51 = add i64 %50, -8
- %52 = lshr exact i64 %51, 3
- %53 = add nuw nsw i64 %52, 1
- %54 = and i64 %53, 1
- %55 = icmp eq i64 %51, 0
- br i1 %55, label %101, label %56
- ; <label>:56: ; preds = %49
- %57 = sub nsw i64 %53, %54
- br label %58
- ; <label>:58: ; preds = %58, %56
- %59 = phi i64 [ 0, %56 ], [ %98, %58 ]
- %60 = phi i64 [ %57, %56 ], [ %99, %58 ]
- %61 = getelementptr inbounds i32, i32* %10, i64 %59
- %62 = bitcast i32* %61 to <4 x i32>*
- %63 = load <4 x i32>, <4 x i32>* %62, align 4, !tbaa !6, !alias.scope !10
- %64 = getelementptr inbounds i32, i32* %61, i64 4
- %65 = bitcast i32* %64 to <4 x i32>*
- %66 = load <4 x i32>, <4 x i32>* %65, align 4, !tbaa !6, !alias.scope !10
- %67 = getelementptr inbounds i32, i32* %13, i64 %59
- %68 = bitcast i32* %67 to <4 x i32>*
- %69 = load <4 x i32>, <4 x i32>* %68, align 4, !tbaa !6, !alias.scope !13
- %70 = getelementptr inbounds i32, i32* %67, i64 4
- %71 = bitcast i32* %70 to <4 x i32>*
- %72 = load <4 x i32>, <4 x i32>* %71, align 4, !tbaa !6, !alias.scope !13
- %73 = add nsw <4 x i32> %69, %63
- %74 = add nsw <4 x i32> %72, %66
- %75 = getelementptr inbounds i32, i32* %7, i64 %59
- %76 = bitcast i32* %75 to <4 x i32>*
- store <4 x i32> %73, <4 x i32>* %76, align 4, !tbaa !6, !alias.scope !15, !noalias !17
- %77 = getelementptr inbounds i32, i32* %75, i64 4
- %78 = bitcast i32* %77 to <4 x i32>*
- store <4 x i32> %74, <4 x i32>* %78, align 4, !tbaa !6, !alias.scope !15, !noalias !17
- %79 = or i64 %59, 8
- %80 = getelementptr inbounds i32, i32* %10, i64 %79
- %81 = bitcast i32* %80 to <4 x i32>*
- %82 = load <4 x i32>, <4 x i32>* %81, align 4, !tbaa !6, !alias.scope !10
- %83 = getelementptr inbounds i32, i32* %80, i64 4
- %84 = bitcast i32* %83 to <4 x i32>*
- %85 = load <4 x i32>, <4 x i32>* %84, align 4, !tbaa !6, !alias.scope !10
- %86 = getelementptr inbounds i32, i32* %13, i64 %79
- %87 = bitcast i32* %86 to <4 x i32>*
- %88 = load <4 x i32>, <4 x i32>* %87, align 4, !tbaa !6, !alias.scope !13
- %89 = getelementptr inbounds i32, i32* %86, i64 4
- %90 = bitcast i32* %89 to <4 x i32>*
- %91 = load <4 x i32>, <4 x i32>* %90, align 4, !tbaa !6, !alias.scope !13
- %92 = add nsw <4 x i32> %88, %82
- %93 = add nsw <4 x i32> %91, %85
- %94 = getelementptr inbounds i32, i32* %7, i64 %79
- %95 = bitcast i32* %94 to <4 x i32>*
- store <4 x i32> %92, <4 x i32>* %95, align 4, !tbaa !6, !alias.scope !15, !noalias !17
- %96 = getelementptr inbounds i32, i32* %94, i64 4
- %97 = bitcast i32* %96 to <4 x i32>*
- store <4 x i32> %93, <4 x i32>* %97, align 4, !tbaa !6, !alias.scope !15, !noalias !17
- %98 = add i64 %59, 16
- %99 = add i64 %60, -2
- %100 = icmp eq i64 %99, 0
- br i1 %100, label %101, label %58, !llvm.loop !18
- ; <label>:101: ; preds = %58, %49
- %102 = phi i64 [ 0, %49 ], [ %98, %58 ]
- %103 = icmp eq i64 %54, 0
- br i1 %103, label %123, label %104
- ; <label>:104: ; preds = %101
- %105 = getelementptr inbounds i32, i32* %10, i64 %102
- %106 = bitcast i32* %105 to <4 x i32>*
- %107 = load <4 x i32>, <4 x i32>* %106, align 4, !tbaa !6, !alias.scope !10
- %108 = getelementptr inbounds i32, i32* %105, i64 4
- %109 = bitcast i32* %108 to <4 x i32>*
- %110 = load <4 x i32>, <4 x i32>* %109, align 4, !tbaa !6, !alias.scope !10
- %111 = getelementptr inbounds i32, i32* %13, i64 %102
- %112 = bitcast i32* %111 to <4 x i32>*
- %113 = load <4 x i32>, <4 x i32>* %112, align 4, !tbaa !6, !alias.scope !13
- %114 = getelementptr inbounds i32, i32* %111, i64 4
- %115 = bitcast i32* %114 to <4 x i32>*
- %116 = load <4 x i32>, <4 x i32>* %115, align 4, !tbaa !6, !alias.scope !13
- %117 = add nsw <4 x i32> %113, %107
- %118 = add nsw <4 x i32> %116, %110
- %119 = getelementptr inbounds i32, i32* %7, i64 %102
- %120 = bitcast i32* %119 to <4 x i32>*
- store <4 x i32> %117, <4 x i32>* %120, align 4, !tbaa !6, !alias.scope !15, !noalias !17
- %121 = getelementptr inbounds i32, i32* %119, i64 4
- %122 = bitcast i32* %121 to <4 x i32>*
- store <4 x i32> %118, <4 x i32>* %122, align 4, !tbaa !6, !alias.scope !15, !noalias !17
- br label %123
- ; <label>:123: ; preds = %101, %104
- %124 = icmp eq i64 %50, %3
- br i1 %124, label %125, label %17
- ; <label>:125: ; preds = %35, %126, %123, %4
- ret i32 0
- ; <label>:126: ; preds = %35, %126
- %127 = phi i64 [ %155, %126 ], [ %36, %35 ]
- %128 = getelementptr inbounds i32, i32* %10, i64 %127
- %129 = load i32, i32* %128, align 4, !tbaa !6
- %130 = getelementptr inbounds i32, i32* %13, i64 %127
- %131 = load i32, i32* %130, align 4, !tbaa !6
- %132 = add nsw i32 %131, %129
- %133 = getelementptr inbounds i32, i32* %7, i64 %127
- store i32 %132, i32* %133, align 4, !tbaa !6
- %134 = add nuw nsw i64 %127, 1
- %135 = getelementptr inbounds i32, i32* %10, i64 %134
- %136 = load i32, i32* %135, align 4, !tbaa !6
- %137 = getelementptr inbounds i32, i32* %13, i64 %134
- %138 = load i32, i32* %137, align 4, !tbaa !6
- %139 = add nsw i32 %138, %136
- %140 = getelementptr inbounds i32, i32* %7, i64 %134
- store i32 %139, i32* %140, align 4, !tbaa !6
- %141 = add nsw i64 %127, 2
- %142 = getelementptr inbounds i32, i32* %10, i64 %141
- %143 = load i32, i32* %142, align 4, !tbaa !6
- %144 = getelementptr inbounds i32, i32* %13, i64 %141
- %145 = load i32, i32* %144, align 4, !tbaa !6
- %146 = add nsw i32 %145, %143
- %147 = getelementptr inbounds i32, i32* %7, i64 %141
- store i32 %146, i32* %147, align 4, !tbaa !6
- %148 = add nsw i64 %127, 3
- %149 = getelementptr inbounds i32, i32* %10, i64 %148
- %150 = load i32, i32* %149, align 4, !tbaa !6
- %151 = getelementptr inbounds i32, i32* %13, i64 %148
- %152 = load i32, i32* %151, align 4, !tbaa !6
- %153 = add nsw i32 %152, %150
- %154 = getelementptr inbounds i32, i32* %7, i64 %148
- store i32 %153, i32* %154, align 4, !tbaa !6
- %155 = add nsw i64 %127, 4
- %156 = icmp eq i64 %155, %3
- br i1 %156, label %125, label %126, !llvm.loop !20
- }
- 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" }
- !llvm.module.flags = !{!0}
- !llvm.ident = !{!1}
- !0 = !{i32 1, !"wchar_size", i32 4}
- !1 = !{!"clang version 7.0.0-3~ubuntu0.18.04.1 (tags/RELEASE_700/final)"}
- !2 = !{!3, !3, i64 0}
- !3 = !{!"long", !4, i64 0}
- !4 = !{!"omnipotent char", !5, i64 0}
- !5 = !{!"Simple C/C++ TBAA"}
- !6 = !{!7, !7, i64 0}
- !7 = !{!"int", !4, i64 0}
- !8 = distinct !{!8, !9}
- !9 = !{!"llvm.loop.unroll.disable"}
- !10 = !{!11}
- !11 = distinct !{!11, !12}
- !12 = distinct !{!12, !"LVerDomain"}
- !13 = !{!14}
- !14 = distinct !{!14, !12}
- !15 = !{!16}
- !16 = distinct !{!16, !12}
- !17 = !{!11, !14}
- !18 = distinct !{!18, !19}
- !19 = !{!"llvm.loop.isvectorized", i32 1}
- !20 = distinct !{!20, !19}
Advertisement
Add Comment
Please, Sign In to add comment