Guest User

Untitled

a guest
Dec 11th, 2019
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.25 KB | None | 0 0
  1. /****************************************************************
  2. $ clang-7 -O2 -S -emit-llvm test.c
  3.  
  4. int expr_0_0(int64_t *addrs, int64_t *local_bitmaps,
  5. int64_t execution_context_ptr, int64_t nrecords) {
  6. int *outVec = (int *) addrs[5];
  7. int *c0Vec = (int *) addrs[1];
  8. int *c1Vec = (int *) addrs[3];
  9. for (int loop_var = 0; loop_var < nrecords; ++loop_var) {
  10. int c0 = c0Vec[loop_var];
  11. int c1 = c1Vec[loop_var];
  12. int out = c0 + c1;
  13. outVec[loop_var] = out;
  14. }
  15. }
  16. ****************************************************************/
  17.  
  18. ; ModuleID = 'test.c'
  19. source_filename = "test.c"
  20. target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  21. target triple = "x86_64-pc-linux-gnu"
  22.  
  23. ; Function Attrs: norecurse nounwind uwtable
  24. define dso_local i32 @expr_0_0(i64* nocapture readonly, i64* nocapture readnone, i64, i64) local_unnamed_addr #0 {
  25. %5 = getelementptr inbounds i64, i64* %0, i64 5
  26. %6 = bitcast i64* %5 to i32**
  27. %7 = load i32*, i32** %6, align 8, !tbaa !2
  28. %8 = getelementptr inbounds i64, i64* %0, i64 1
  29. %9 = bitcast i64* %8 to i32**
  30. %10 = load i32*, i32** %9, align 8, !tbaa !2
  31. %11 = getelementptr inbounds i64, i64* %0, i64 3
  32. %12 = bitcast i64* %11 to i32**
  33. %13 = load i32*, i32** %12, align 8, !tbaa !2
  34. %14 = icmp sgt i64 %3, 0
  35. br i1 %14, label %15, label %125
  36.  
  37. ; <label>:15: ; preds = %4
  38. %16 = icmp ult i64 %3, 8
  39. br i1 %16, label %17, label %38
  40.  
  41. ; <label>:17: ; preds = %123, %38, %15
  42. %18 = phi i64 [ 0, %38 ], [ 0, %15 ], [ %50, %123 ]
  43. %19 = xor i64 %18, -1
  44. %20 = add i64 %19, %3
  45. %21 = and i64 %3, 3
  46. %22 = icmp eq i64 %21, 0
  47. br i1 %22, label %35, label %23
  48.  
  49. ; <label>:23: ; preds = %17, %23
  50. %24 = phi i64 [ %32, %23 ], [ %18, %17 ]
  51. %25 = phi i64 [ %33, %23 ], [ %21, %17 ]
  52. %26 = getelementptr inbounds i32, i32* %10, i64 %24
  53. %27 = load i32, i32* %26, align 4, !tbaa !6
  54. %28 = getelementptr inbounds i32, i32* %13, i64 %24
  55. %29 = load i32, i32* %28, align 4, !tbaa !6
  56. %30 = add nsw i32 %29, %27
  57. %31 = getelementptr inbounds i32, i32* %7, i64 %24
  58. store i32 %30, i32* %31, align 4, !tbaa !6
  59. %32 = add nuw nsw i64 %24, 1
  60. %33 = add i64 %25, -1
  61. %34 = icmp eq i64 %33, 0
  62. br i1 %34, label %35, label %23, !llvm.loop !8
  63.  
  64. ; <label>:35: ; preds = %23, %17
  65. %36 = phi i64 [ %18, %17 ], [ %32, %23 ]
  66. %37 = icmp ult i64 %20, 3
  67. br i1 %37, label %125, label %126
  68.  
  69. ; <label>:38: ; preds = %15
  70. %39 = getelementptr i32, i32* %7, i64 %3
  71. %40 = getelementptr i32, i32* %10, i64 %3
  72. %41 = getelementptr i32, i32* %13, i64 %3
  73. %42 = icmp ult i32* %7, %40
  74. %43 = icmp ult i32* %10, %39
  75. %44 = and i1 %42, %43
  76. %45 = icmp ult i32* %7, %41
  77. %46 = icmp ult i32* %13, %39
  78. %47 = and i1 %45, %46
  79. %48 = or i1 %44, %47
  80. br i1 %48, label %17, label %49
  81.  
  82. ; <label>:49: ; preds = %38
  83. %50 = and i64 %3, -8
  84. %51 = add i64 %50, -8
  85. %52 = lshr exact i64 %51, 3
  86. %53 = add nuw nsw i64 %52, 1
  87. %54 = and i64 %53, 1
  88. %55 = icmp eq i64 %51, 0
  89. br i1 %55, label %101, label %56
  90.  
  91. ; <label>:56: ; preds = %49
  92. %57 = sub nsw i64 %53, %54
  93. br label %58
  94.  
  95. ; <label>:58: ; preds = %58, %56
  96. %59 = phi i64 [ 0, %56 ], [ %98, %58 ]
  97. %60 = phi i64 [ %57, %56 ], [ %99, %58 ]
  98. %61 = getelementptr inbounds i32, i32* %10, i64 %59
  99. %62 = bitcast i32* %61 to <4 x i32>*
  100. %63 = load <4 x i32>, <4 x i32>* %62, align 4, !tbaa !6, !alias.scope !10
  101. %64 = getelementptr inbounds i32, i32* %61, i64 4
  102. %65 = bitcast i32* %64 to <4 x i32>*
  103. %66 = load <4 x i32>, <4 x i32>* %65, align 4, !tbaa !6, !alias.scope !10
  104. %67 = getelementptr inbounds i32, i32* %13, i64 %59
  105. %68 = bitcast i32* %67 to <4 x i32>*
  106. %69 = load <4 x i32>, <4 x i32>* %68, align 4, !tbaa !6, !alias.scope !13
  107. %70 = getelementptr inbounds i32, i32* %67, i64 4
  108. %71 = bitcast i32* %70 to <4 x i32>*
  109. %72 = load <4 x i32>, <4 x i32>* %71, align 4, !tbaa !6, !alias.scope !13
  110. %73 = add nsw <4 x i32> %69, %63
  111. %74 = add nsw <4 x i32> %72, %66
  112. %75 = getelementptr inbounds i32, i32* %7, i64 %59
  113. %76 = bitcast i32* %75 to <4 x i32>*
  114. store <4 x i32> %73, <4 x i32>* %76, align 4, !tbaa !6, !alias.scope !15, !noalias !17
  115. %77 = getelementptr inbounds i32, i32* %75, i64 4
  116. %78 = bitcast i32* %77 to <4 x i32>*
  117. store <4 x i32> %74, <4 x i32>* %78, align 4, !tbaa !6, !alias.scope !15, !noalias !17
  118. %79 = or i64 %59, 8
  119. %80 = getelementptr inbounds i32, i32* %10, i64 %79
  120. %81 = bitcast i32* %80 to <4 x i32>*
  121. %82 = load <4 x i32>, <4 x i32>* %81, align 4, !tbaa !6, !alias.scope !10
  122. %83 = getelementptr inbounds i32, i32* %80, i64 4
  123. %84 = bitcast i32* %83 to <4 x i32>*
  124. %85 = load <4 x i32>, <4 x i32>* %84, align 4, !tbaa !6, !alias.scope !10
  125. %86 = getelementptr inbounds i32, i32* %13, i64 %79
  126. %87 = bitcast i32* %86 to <4 x i32>*
  127. %88 = load <4 x i32>, <4 x i32>* %87, align 4, !tbaa !6, !alias.scope !13
  128. %89 = getelementptr inbounds i32, i32* %86, i64 4
  129. %90 = bitcast i32* %89 to <4 x i32>*
  130. %91 = load <4 x i32>, <4 x i32>* %90, align 4, !tbaa !6, !alias.scope !13
  131. %92 = add nsw <4 x i32> %88, %82
  132. %93 = add nsw <4 x i32> %91, %85
  133. %94 = getelementptr inbounds i32, i32* %7, i64 %79
  134. %95 = bitcast i32* %94 to <4 x i32>*
  135. store <4 x i32> %92, <4 x i32>* %95, align 4, !tbaa !6, !alias.scope !15, !noalias !17
  136. %96 = getelementptr inbounds i32, i32* %94, i64 4
  137. %97 = bitcast i32* %96 to <4 x i32>*
  138. store <4 x i32> %93, <4 x i32>* %97, align 4, !tbaa !6, !alias.scope !15, !noalias !17
  139. %98 = add i64 %59, 16
  140. %99 = add i64 %60, -2
  141. %100 = icmp eq i64 %99, 0
  142. br i1 %100, label %101, label %58, !llvm.loop !18
  143.  
  144. ; <label>:101: ; preds = %58, %49
  145. %102 = phi i64 [ 0, %49 ], [ %98, %58 ]
  146. %103 = icmp eq i64 %54, 0
  147. br i1 %103, label %123, label %104
  148.  
  149. ; <label>:104: ; preds = %101
  150. %105 = getelementptr inbounds i32, i32* %10, i64 %102
  151. %106 = bitcast i32* %105 to <4 x i32>*
  152. %107 = load <4 x i32>, <4 x i32>* %106, align 4, !tbaa !6, !alias.scope !10
  153. %108 = getelementptr inbounds i32, i32* %105, i64 4
  154. %109 = bitcast i32* %108 to <4 x i32>*
  155. %110 = load <4 x i32>, <4 x i32>* %109, align 4, !tbaa !6, !alias.scope !10
  156. %111 = getelementptr inbounds i32, i32* %13, i64 %102
  157. %112 = bitcast i32* %111 to <4 x i32>*
  158. %113 = load <4 x i32>, <4 x i32>* %112, align 4, !tbaa !6, !alias.scope !13
  159. %114 = getelementptr inbounds i32, i32* %111, i64 4
  160. %115 = bitcast i32* %114 to <4 x i32>*
  161. %116 = load <4 x i32>, <4 x i32>* %115, align 4, !tbaa !6, !alias.scope !13
  162. %117 = add nsw <4 x i32> %113, %107
  163. %118 = add nsw <4 x i32> %116, %110
  164. %119 = getelementptr inbounds i32, i32* %7, i64 %102
  165. %120 = bitcast i32* %119 to <4 x i32>*
  166. store <4 x i32> %117, <4 x i32>* %120, align 4, !tbaa !6, !alias.scope !15, !noalias !17
  167. %121 = getelementptr inbounds i32, i32* %119, i64 4
  168. %122 = bitcast i32* %121 to <4 x i32>*
  169. store <4 x i32> %118, <4 x i32>* %122, align 4, !tbaa !6, !alias.scope !15, !noalias !17
  170. br label %123
  171.  
  172. ; <label>:123: ; preds = %101, %104
  173. %124 = icmp eq i64 %50, %3
  174. br i1 %124, label %125, label %17
  175.  
  176. ; <label>:125: ; preds = %35, %126, %123, %4
  177. ret i32 0
  178.  
  179. ; <label>:126: ; preds = %35, %126
  180. %127 = phi i64 [ %155, %126 ], [ %36, %35 ]
  181. %128 = getelementptr inbounds i32, i32* %10, i64 %127
  182. %129 = load i32, i32* %128, align 4, !tbaa !6
  183. %130 = getelementptr inbounds i32, i32* %13, i64 %127
  184. %131 = load i32, i32* %130, align 4, !tbaa !6
  185. %132 = add nsw i32 %131, %129
  186. %133 = getelementptr inbounds i32, i32* %7, i64 %127
  187. store i32 %132, i32* %133, align 4, !tbaa !6
  188. %134 = add nuw nsw i64 %127, 1
  189. %135 = getelementptr inbounds i32, i32* %10, i64 %134
  190. %136 = load i32, i32* %135, align 4, !tbaa !6
  191. %137 = getelementptr inbounds i32, i32* %13, i64 %134
  192. %138 = load i32, i32* %137, align 4, !tbaa !6
  193. %139 = add nsw i32 %138, %136
  194. %140 = getelementptr inbounds i32, i32* %7, i64 %134
  195. store i32 %139, i32* %140, align 4, !tbaa !6
  196. %141 = add nsw i64 %127, 2
  197. %142 = getelementptr inbounds i32, i32* %10, i64 %141
  198. %143 = load i32, i32* %142, align 4, !tbaa !6
  199. %144 = getelementptr inbounds i32, i32* %13, i64 %141
  200. %145 = load i32, i32* %144, align 4, !tbaa !6
  201. %146 = add nsw i32 %145, %143
  202. %147 = getelementptr inbounds i32, i32* %7, i64 %141
  203. store i32 %146, i32* %147, align 4, !tbaa !6
  204. %148 = add nsw i64 %127, 3
  205. %149 = getelementptr inbounds i32, i32* %10, i64 %148
  206. %150 = load i32, i32* %149, align 4, !tbaa !6
  207. %151 = getelementptr inbounds i32, i32* %13, i64 %148
  208. %152 = load i32, i32* %151, align 4, !tbaa !6
  209. %153 = add nsw i32 %152, %150
  210. %154 = getelementptr inbounds i32, i32* %7, i64 %148
  211. store i32 %153, i32* %154, align 4, !tbaa !6
  212. %155 = add nsw i64 %127, 4
  213. %156 = icmp eq i64 %155, %3
  214. br i1 %156, label %125, label %126, !llvm.loop !20
  215. }
  216.  
  217. 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" }
  218.  
  219. !llvm.module.flags = !{!0}
  220. !llvm.ident = !{!1}
  221.  
  222. !0 = !{i32 1, !"wchar_size", i32 4}
  223. !1 = !{!"clang version 7.0.0-3~ubuntu0.18.04.1 (tags/RELEASE_700/final)"}
  224. !2 = !{!3, !3, i64 0}
  225. !3 = !{!"long", !4, i64 0}
  226. !4 = !{!"omnipotent char", !5, i64 0}
  227. !5 = !{!"Simple C/C++ TBAA"}
  228. !6 = !{!7, !7, i64 0}
  229. !7 = !{!"int", !4, i64 0}
  230. !8 = distinct !{!8, !9}
  231. !9 = !{!"llvm.loop.unroll.disable"}
  232. !10 = !{!11}
  233. !11 = distinct !{!11, !12}
  234. !12 = distinct !{!12, !"LVerDomain"}
  235. !13 = !{!14}
  236. !14 = distinct !{!14, !12}
  237. !15 = !{!16}
  238. !16 = distinct !{!16, !12}
  239. !17 = !{!11, !14}
  240. !18 = distinct !{!18, !19}
  241. !19 = !{!"llvm.loop.isvectorized", i32 1}
  242. !20 = distinct !{!20, !19}
Advertisement
Add Comment
Please, Sign In to add comment