Guest User

outputlog

a guest
May 11th, 2018
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.07 KB | None | 0 0
  1. <class 'tvm.tensor.Tensor'>
  2. [15:11:58] C:\TVM\clone\tvm\src\runtime\opencl\opencl_device_api.cc:194: Multiple OpenCL platforms matched, use the first one ...
  3. [15:11:58] C:\TVM\clone\tvm\src\runtime\opencl\opencl_device_api.cc:197: Initialize OpenCL platform 'Intel(R) OpenCL '
  4. [15:11:58] C:\TVM\clone\tvm\src\runtime\opencl\opencl_device_api.cc:222: opencl(0)='Intel(R) HD Graphics 4600 ' cl_device_id=000002BE87E000E0
  5. ------tvm gen code------
  6. ; ModuleID = 'myadd'
  7. source_filename = "myadd"
  8. target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
  9. target triple = "x86_64-pc-windows-msvc"
  10.  
  11. %0 = type { double }
  12. %1 = type { i8*, %2, i32, %3, i64*, i64*, i64 }
  13. %2 = type { i32, i32 }
  14. %3 = type { i8, i8, i16 }
  15.  
  16. @__tvm_module_ctx = linkonce dllexport local_unnamed_addr global i8* null, align 8
  17. @__TVMFuncCall = linkonce dllexport local_unnamed_addr global i32 (i8*, %0*, i32*, i32, %0*, i32*)* null, align 8
  18. @__TVMBackendGetFuncFromEnv = linkonce dllexport local_unnamed_addr global i32 (i8*, i8*, i8**)* null, align 8
  19. @__TVMAPISetLastError = linkonce dllexport local_unnamed_addr global void (i8*)* null, align 8
  20. @.str = private constant [58 x i8] c"Assert fail: (num_args == 3), myadd: num_args should be 3\00", align 1
  21. @.str.1 = private constant [87 x i8] c"Assert fail: (1 == int32(arg0.strides[0])), arg0.strides: expected to be compact array\00", align 1
  22. @.str.2 = private constant [87 x i8] c"Assert fail: (1 == int32(arg1.strides[0])), arg1.strides: expected to be compact array\00", align 1
  23. @.str.3 = private constant [87 x i8] c"Assert fail: (1 == int32(arg2.strides[0])), arg2.strides: expected to be compact array\00", align 1
  24. @.str.4 = private constant [110 x i8] c"Assert fail: (((arg0.code == 3) || (arg0.code == 7)) || (arg0.code == 4)), myadd: Expect arg[0] to be pointer\00", align 1
  25. @.str.5 = private constant [110 x i8] c"Assert fail: (((arg1.code == 3) || (arg1.code == 7)) || (arg1.code == 4)), myadd: Expect arg[1] to be pointer\00", align 1
  26. @.str.6 = private constant [110 x i8] c"Assert fail: (((arg2.code == 3) || (arg2.code == 7)) || (arg2.code == 4)), myadd: Expect arg[2] to be pointer\00", align 1
  27. @.str.7 = private constant [55 x i8] c"Assert fail: (dev_type == 4), device_type need to be 4\00", align 1
  28. @.str.8 = private constant [81 x i8] c"Assert fail: (1 == tvm_struct_get(arg0, 0, 4)), arg0.ndim is expected to equal 1\00", align 1
  29. @.str.9 = private constant [186 x i8] c"Assert fail: (((tvm_struct_get(arg0, 0, 5) == (uint8)2) && (tvm_struct_get(arg0, 0, 6) == (uint8)32)) && (tvm_struct_get(arg0, 0, 7) == (uint16)1)), arg0.dtype is expected to be float32\00", align 1
  30. @.str.10 = private constant [112 x i8] c"Assert fail: (tvm_struct_get(arg0, 0, 8) == (uint64)0), Argument arg0.byte_offset has an unsatisfied constraint\00", align 1
  31. @.str.11 = private constant [81 x i8] c"Assert fail: (1 == tvm_struct_get(arg1, 0, 4)), arg1.ndim is expected to equal 1\00", align 1
  32. @.str.12 = private constant [186 x i8] c"Assert fail: (((tvm_struct_get(arg1, 0, 5) == (uint8)2) && (tvm_struct_get(arg1, 0, 6) == (uint8)32)) && (tvm_struct_get(arg1, 0, 7) == (uint16)1)), arg1.dtype is expected to be float32\00", align 1
  33. @.str.13 = private constant [95 x i8] c"Assert fail: (n == int32(arg1.shape[0])), Argument arg1.shape[0] has an unsatisfied constraint\00", align 1
  34. @.str.14 = private constant [112 x i8] c"Assert fail: (tvm_struct_get(arg1, 0, 8) == (uint64)0), Argument arg1.byte_offset has an unsatisfied constraint\00", align 1
  35. @.str.15 = private constant [105 x i8] c"Assert fail: (4 == tvm_struct_get(arg1, 0, 10)), Argument arg1.device_type has an unsatisfied constraint\00", align 1
  36. @.str.16 = private constant [107 x i8] c"Assert fail: (dev_id == tvm_struct_get(arg1, 0, 9)), Argument arg1.device_id has an unsatisfied constraint\00", align 1
  37. @.str.17 = private constant [81 x i8] c"Assert fail: (1 == tvm_struct_get(arg2, 0, 4)), arg2.ndim is expected to equal 1\00", align 1
  38. @.str.18 = private constant [186 x i8] c"Assert fail: (((tvm_struct_get(arg2, 0, 5) == (uint8)2) && (tvm_struct_get(arg2, 0, 6) == (uint8)32)) && (tvm_struct_get(arg2, 0, 7) == (uint16)1)), arg2.dtype is expected to be float32\00", align 1
  39. @.str.19 = private constant [95 x i8] c"Assert fail: (n == int32(arg2.shape[0])), Argument arg2.shape[0] has an unsatisfied constraint\00", align 1
  40. @.str.20 = private constant [112 x i8] c"Assert fail: (tvm_struct_get(arg2, 0, 8) == (uint64)0), Argument arg2.byte_offset has an unsatisfied constraint\00", align 1
  41. @.str.21 = private constant [105 x i8] c"Assert fail: (4 == tvm_struct_get(arg2, 0, 10)), Argument arg2.device_type has an unsatisfied constraint\00", align 1
  42. @.str.22 = private constant [107 x i8] c"Assert fail: (dev_id == tvm_struct_get(arg2, 0, 9)), Argument arg2.device_id has an unsatisfied constraint\00", align 1
  43. @.tvm_func.__tvm_set_device = linkonce local_unnamed_addr global i8* null, align 8
  44. @.str.23 = private constant [17 x i8] c"__tvm_set_device\00", align 1
  45. @.tvm_func.myadd__kernel0 = linkonce local_unnamed_addr global i8* null, align 8
  46. @.str.24 = private constant [15 x i8] c"myadd__kernel0\00", align 1
  47. @__tvm_main__ = weak local_unnamed_addr constant [6 x i8] c"myadd\00", align 1
  48.  
  49. define dllexport i32 @myadd(i8* noalias nocapture readonly, i8* noalias nocapture readonly, i32) local_unnamed_addr {
  50. entry:
  51. %3 = alloca [7 x i32], align 4
  52. %4 = alloca [7 x %0], align 8
  53. %.sub55 = getelementptr inbounds [7 x %0], [7 x %0]* %4, i64 0, i64 0
  54. %.sub = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
  55. %5 = icmp eq i32 %2, 3
  56. br i1 %5, label %assert_end, label %assert_fail, !prof !1
  57.  
  58. assert_fail: ; preds = %entry
  59. %6 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  60. tail call void %6(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
  61. ret i32 -1
  62.  
  63. assert_end: ; preds = %entry
  64. %7 = bitcast i8* %0 to %1**
  65. %8 = load %1*, %1** %7, align 8
  66. %9 = bitcast i8* %1 to i32*
  67. %10 = load i32, i32* %9, align 4, !tbaa !5
  68. %11 = getelementptr inbounds i8, i8* %0, i64 8
  69. %12 = bitcast i8* %11 to %1**
  70. %13 = load %1*, %1** %12, align 8
  71. %14 = getelementptr inbounds i8, i8* %1, i64 4
  72. %15 = bitcast i8* %14 to i32*
  73. %16 = load i32, i32* %15, align 4, !tbaa !19
  74. %17 = getelementptr inbounds i8, i8* %0, i64 16
  75. %18 = bitcast i8* %17 to %1**
  76. %19 = load %1*, %1** %18, align 8
  77. %20 = getelementptr inbounds i8, i8* %1, i64 8
  78. %21 = bitcast i8* %20 to i32*
  79. %22 = load i32, i32* %21, align 4, !tbaa !21
  80. %23 = getelementptr inbounds %1, %1* %8, i64 0, i32 0
  81. %24 = load i8*, i8** %23, align 8
  82. %25 = getelementptr inbounds %1, %1* %8, i64 0, i32 4
  83. %26 = load i64*, i64** %25, align 8
  84. %27 = load i64, i64* %26, align 8, !tbaa !24
  85. %28 = trunc i64 %27 to i32
  86. %29 = getelementptr inbounds %1, %1* %8, i64 0, i32 5
  87. %30 = load i64*, i64** %29, align 8
  88. %31 = icmp eq i64* %30, null
  89. br i1 %31, label %if_end, label %if_then, !prof !38
  90.  
  91. if_then: ; preds = %assert_end
  92. %32 = load i64, i64* %30, align 8, !tbaa !39
  93. %33 = trunc i64 %32 to i32
  94. %34 = icmp eq i32 %33, 1
  95. br i1 %34, label %if_end, label %assert_fail1, !prof !1
  96.  
  97. if_end: ; preds = %assert_end, %if_then
  98. %35 = getelementptr inbounds %1, %1* %8, i64 0, i32 1, i32 0
  99. %36 = load i32, i32* %35, align 4
  100. %37 = getelementptr inbounds %1, %1* %8, i64 0, i32 1, i32 1
  101. %38 = load i32, i32* %37, align 4
  102. %39 = getelementptr inbounds %1, %1* %13, i64 0, i32 0
  103. %40 = load i8*, i8** %39, align 8
  104. %41 = getelementptr inbounds %1, %1* %13, i64 0, i32 4
  105. %42 = load i64*, i64** %41, align 8
  106. %43 = getelementptr inbounds %1, %1* %13, i64 0, i32 5
  107. %44 = load i64*, i64** %43, align 8
  108. %45 = icmp eq i64* %44, null
  109. br i1 %45, label %if_end4, label %if_then3, !prof !38
  110.  
  111. assert_fail1: ; preds = %if_then
  112. %46 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  113. tail call void %46(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.1, i64 0, i64 0))
  114. ret i32 -1
  115.  
  116. if_then3: ; preds = %if_end
  117. %47 = load i64, i64* %44, align 8, !tbaa !53
  118. %48 = trunc i64 %47 to i32
  119. %49 = icmp eq i32 %48, 1
  120. br i1 %49, label %if_end4, label %assert_fail5, !prof !1
  121.  
  122. if_end4: ; preds = %if_end, %if_then3
  123. %50 = getelementptr inbounds %1, %1* %19, i64 0, i32 0
  124. %51 = load i8*, i8** %50, align 8
  125. %52 = getelementptr inbounds %1, %1* %19, i64 0, i32 4
  126. %53 = load i64*, i64** %52, align 8
  127. %54 = getelementptr inbounds %1, %1* %19, i64 0, i32 5
  128. %55 = load i64*, i64** %54, align 8
  129. %56 = icmp eq i64* %55, null
  130. br i1 %56, label %if_end8, label %if_then7, !prof !38
  131.  
  132. assert_fail5: ; preds = %if_then3
  133. %57 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  134. tail call void %57(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.2, i64 0, i64 0))
  135. ret i32 -1
  136.  
  137. if_then7: ; preds = %if_end4
  138. %58 = load i64, i64* %55, align 8, !tbaa !67
  139. %59 = trunc i64 %58 to i32
  140. %60 = icmp eq i32 %59, 1
  141. br i1 %60, label %if_end8, label %assert_fail9, !prof !1
  142.  
  143. if_end8: ; preds = %if_end4, %if_then7
  144. switch i32 %10, label %assert_fail11 [
  145. i32 7, label %assert_end12
  146. i32 4, label %assert_end12
  147. i32 3, label %assert_end12
  148. ]
  149.  
  150. assert_fail9: ; preds = %if_then7
  151. %61 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  152. tail call void %61(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.3, i64 0, i64 0))
  153. ret i32 -1
  154.  
  155. assert_fail11: ; preds = %if_end8
  156. %62 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  157. tail call void %62(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.4, i64 0, i64 0))
  158. ret i32 -1
  159.  
  160. assert_end12: ; preds = %if_end8, %if_end8, %if_end8
  161. switch i32 %16, label %assert_fail13 [
  162. i32 7, label %assert_end14
  163. i32 4, label %assert_end14
  164. i32 3, label %assert_end14
  165. ]
  166.  
  167. assert_fail13: ; preds = %assert_end12
  168. %63 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  169. tail call void %63(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.5, i64 0, i64 0))
  170. ret i32 -1
  171.  
  172. assert_end14: ; preds = %assert_end12, %assert_end12, %assert_end12
  173. switch i32 %22, label %assert_fail15 [
  174. i32 7, label %assert_end16
  175. i32 4, label %assert_end16
  176. i32 3, label %assert_end16
  177. ]
  178.  
  179. assert_fail15: ; preds = %assert_end14
  180. %64 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  181. tail call void %64(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.6, i64 0, i64 0))
  182. ret i32 -1
  183.  
  184. assert_end16: ; preds = %assert_end14, %assert_end14, %assert_end14
  185. %65 = icmp eq i32 %36, 4
  186. br i1 %65, label %assert_end18, label %assert_fail17, !prof !1
  187.  
  188. assert_fail17: ; preds = %assert_end16
  189. %66 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  190. tail call void %66(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0))
  191. ret i32 -1
  192.  
  193. assert_end18: ; preds = %assert_end16
  194. %67 = getelementptr inbounds %1, %1* %8, i64 0, i32 2
  195. %68 = load i32, i32* %67, align 4
  196. %69 = icmp eq i32 %68, 1
  197. br i1 %69, label %assert_end20, label %assert_fail19, !prof !1
  198.  
  199. assert_fail19: ; preds = %assert_end18
  200. %70 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  201. tail call void %70(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.8, i64 0, i64 0))
  202. ret i32 -1
  203.  
  204. assert_end20: ; preds = %assert_end18
  205. %71 = getelementptr inbounds %1, %1* %8, i64 0, i32 3, i32 2
  206. %72 = load i16, i16* %71, align 2
  207. %73 = icmp eq i16 %72, 1
  208. %74 = getelementptr inbounds %1, %1* %8, i64 0, i32 3, i32 1
  209. %75 = load i8, i8* %74, align 1
  210. %76 = icmp eq i8 %75, 32
  211. %77 = getelementptr inbounds %1, %1* %8, i64 0, i32 3, i32 0
  212. %78 = load i8, i8* %77, align 1
  213. %79 = icmp eq i8 %78, 2
  214. %80 = and i1 %76, %79
  215. %81 = and i1 %73, %80
  216. br i1 %81, label %assert_end22, label %assert_fail21, !prof !1
  217.  
  218. assert_fail21: ; preds = %assert_end20
  219. %82 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  220. tail call void %82(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str.9, i64 0, i64 0))
  221. ret i32 -1
  222.  
  223. assert_end22: ; preds = %assert_end20
  224. %83 = getelementptr inbounds %1, %1* %8, i64 0, i32 6
  225. %84 = load i64, i64* %83, align 8
  226. %85 = icmp eq i64 %84, 0
  227. br i1 %85, label %assert_end24, label %assert_fail23, !prof !1
  228.  
  229. assert_fail23: ; preds = %assert_end22
  230. %86 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  231. tail call void %86(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.10, i64 0, i64 0))
  232. ret i32 -1
  233.  
  234. assert_end24: ; preds = %assert_end22
  235. %87 = getelementptr inbounds %1, %1* %13, i64 0, i32 2
  236. %88 = load i32, i32* %87, align 4
  237. %89 = icmp eq i32 %88, 1
  238. br i1 %89, label %assert_end26, label %assert_fail25, !prof !1
  239.  
  240. assert_fail25: ; preds = %assert_end24
  241. %90 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  242. tail call void %90(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.11, i64 0, i64 0))
  243. ret i32 -1
  244.  
  245. assert_end26: ; preds = %assert_end24
  246. %91 = getelementptr inbounds %1, %1* %13, i64 0, i32 3, i32 2
  247. %92 = load i16, i16* %91, align 2
  248. %93 = icmp eq i16 %92, 1
  249. %94 = getelementptr inbounds %1, %1* %13, i64 0, i32 3, i32 1
  250. %95 = load i8, i8* %94, align 1
  251. %96 = icmp eq i8 %95, 32
  252. %97 = getelementptr inbounds %1, %1* %13, i64 0, i32 3, i32 0
  253. %98 = load i8, i8* %97, align 1
  254. %99 = icmp eq i8 %98, 2
  255. %100 = and i1 %96, %99
  256. %101 = and i1 %93, %100
  257. br i1 %101, label %assert_end28, label %assert_fail27, !prof !1
  258.  
  259. assert_fail27: ; preds = %assert_end26
  260. %102 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  261. tail call void %102(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str.12, i64 0, i64 0))
  262. ret i32 -1
  263.  
  264. assert_end28: ; preds = %assert_end26
  265. %103 = load i64, i64* %42, align 8, !tbaa !81
  266. %104 = trunc i64 %103 to i32
  267. %105 = icmp eq i32 %28, %104
  268. br i1 %105, label %assert_end30, label %assert_fail29, !prof !1
  269.  
  270. assert_fail29: ; preds = %assert_end28
  271. %106 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  272. tail call void %106(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.13, i64 0, i64 0))
  273. ret i32 -1
  274.  
  275. assert_end30: ; preds = %assert_end28
  276. %107 = getelementptr inbounds %1, %1* %13, i64 0, i32 6
  277. %108 = load i64, i64* %107, align 8
  278. %109 = icmp eq i64 %108, 0
  279. br i1 %109, label %assert_end32, label %assert_fail31, !prof !1
  280.  
  281. assert_fail31: ; preds = %assert_end30
  282. %110 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  283. tail call void %110(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.14, i64 0, i64 0))
  284. ret i32 -1
  285.  
  286. assert_end32: ; preds = %assert_end30
  287. %111 = getelementptr inbounds %1, %1* %13, i64 0, i32 1, i32 0
  288. %112 = load i32, i32* %111, align 4
  289. %113 = icmp eq i32 %112, 4
  290. br i1 %113, label %assert_end34, label %assert_fail33, !prof !1
  291.  
  292. assert_fail33: ; preds = %assert_end32
  293. %114 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  294. tail call void %114(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.15, i64 0, i64 0))
  295. ret i32 -1
  296.  
  297. assert_end34: ; preds = %assert_end32
  298. %115 = getelementptr inbounds %1, %1* %13, i64 0, i32 1, i32 1
  299. %116 = load i32, i32* %115, align 4
  300. %117 = icmp eq i32 %38, %116
  301. br i1 %117, label %assert_end36, label %assert_fail35, !prof !1
  302.  
  303. assert_fail35: ; preds = %assert_end34
  304. %118 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  305. tail call void %118(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.16, i64 0, i64 0))
  306. ret i32 -1
  307.  
  308. assert_end36: ; preds = %assert_end34
  309. %119 = getelementptr inbounds %1, %1* %19, i64 0, i32 2
  310. %120 = load i32, i32* %119, align 4
  311. %121 = icmp eq i32 %120, 1
  312. br i1 %121, label %assert_end38, label %assert_fail37, !prof !1
  313.  
  314. assert_fail37: ; preds = %assert_end36
  315. %122 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  316. tail call void %122(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.17, i64 0, i64 0))
  317. ret i32 -1
  318.  
  319. assert_end38: ; preds = %assert_end36
  320. %123 = getelementptr inbounds %1, %1* %19, i64 0, i32 3, i32 2
  321. %124 = load i16, i16* %123, align 2
  322. %125 = icmp eq i16 %124, 1
  323. %126 = getelementptr inbounds %1, %1* %19, i64 0, i32 3, i32 1
  324. %127 = load i8, i8* %126, align 1
  325. %128 = icmp eq i8 %127, 32
  326. %129 = getelementptr inbounds %1, %1* %19, i64 0, i32 3, i32 0
  327. %130 = load i8, i8* %129, align 1
  328. %131 = icmp eq i8 %130, 2
  329. %132 = and i1 %128, %131
  330. %133 = and i1 %125, %132
  331. br i1 %133, label %assert_end40, label %assert_fail39, !prof !1
  332.  
  333. assert_fail39: ; preds = %assert_end38
  334. %134 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  335. tail call void %134(i8* getelementptr inbounds ([186 x i8], [186 x i8]* @.str.18, i64 0, i64 0))
  336. ret i32 -1
  337.  
  338. assert_end40: ; preds = %assert_end38
  339. %135 = load i64, i64* %53, align 8, !tbaa !95
  340. %136 = trunc i64 %135 to i32
  341. %137 = icmp eq i32 %28, %136
  342. br i1 %137, label %assert_end42, label %assert_fail41, !prof !1
  343.  
  344. assert_fail41: ; preds = %assert_end40
  345. %138 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  346. tail call void %138(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.19, i64 0, i64 0))
  347. ret i32 -1
  348.  
  349. assert_end42: ; preds = %assert_end40
  350. %139 = getelementptr inbounds %1, %1* %19, i64 0, i32 6
  351. %140 = load i64, i64* %139, align 8
  352. %141 = icmp eq i64 %140, 0
  353. br i1 %141, label %assert_end44, label %assert_fail43, !prof !1
  354.  
  355. assert_fail43: ; preds = %assert_end42
  356. %142 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  357. tail call void %142(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.20, i64 0, i64 0))
  358. ret i32 -1
  359.  
  360. assert_end44: ; preds = %assert_end42
  361. %143 = getelementptr inbounds %1, %1* %19, i64 0, i32 1, i32 0
  362. %144 = load i32, i32* %143, align 4
  363. %145 = icmp eq i32 %144, 4
  364. br i1 %145, label %assert_end46, label %assert_fail45, !prof !1
  365.  
  366. assert_fail45: ; preds = %assert_end44
  367. %146 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  368. tail call void %146(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.21, i64 0, i64 0))
  369. ret i32 -1
  370.  
  371. assert_end46: ; preds = %assert_end44
  372. %147 = getelementptr inbounds %1, %1* %19, i64 0, i32 1, i32 1
  373. %148 = load i32, i32* %147, align 4
  374. %149 = icmp eq i32 %38, %148
  375. br i1 %149, label %if_then49, label %assert_fail47, !prof !1
  376.  
  377. assert_fail47: ; preds = %assert_end46
  378. %150 = load void (i8*)*, void (i8*)** @__TVMAPISetLastError, align 8, !tbaa !2
  379. tail call void %150(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.22, i64 0, i64 0))
  380. ret i32 -1
  381.  
  382. if_then49: ; preds = %assert_end46
  383. %151 = bitcast [7 x %0]* %4 to i64*
  384. store i64 4, i64* %151, align 8
  385. store i32 0, i32* %.sub, align 4, !tbaa !109
  386. %152 = sext i32 %38 to i64
  387. %153 = getelementptr inbounds [7 x %0], [7 x %0]* %4, i64 0, i64 1
  388. %154 = bitcast %0* %153 to i64*
  389. store i64 %152, i64* %154, align 8
  390. %155 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
  391. store i32 0, i32* %155, align 4, !tbaa !123
  392. %156 = load i8*, i8** @.tvm_func.__tvm_set_device, align 8
  393. %157 = icmp eq i8* %156, null
  394. br i1 %157, label %handle_init, label %handle_init_end, !prof !38
  395.  
  396. handle_init: ; preds = %if_then49
  397. %158 = alloca i8*, align 8
  398. %159 = load i8*, i8** @__tvm_module_ctx, align 8, !tbaa !2
  399. %160 = load i32 (i8*, i8*, i8**)*, i32 (i8*, i8*, i8**)** @__TVMBackendGetFuncFromEnv, align 8, !tbaa !2
  400. %161 = call i32 %160(i8* %159, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i8** nonnull %158)
  401. %162 = icmp eq i32 %161, 0
  402. br i1 %162, label %call_end, label %call_fail, !prof !1
  403.  
  404. handle_init_end: ; preds = %if_then49, %call_end
  405. %163 = phi i8* [ %156, %if_then49 ], [ %169, %call_end ]
  406. %164 = getelementptr inbounds [7 x %0], [7 x %0]* %4, i64 0, i64 2
  407. %165 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 2
  408. %166 = load i32 (i8*, %0*, i32*, i32, %0*, i32*)*, i32 (i8*, %0*, i32*, i32, %0*, i32*)** @__TVMFuncCall, align 8, !tbaa !2
  409. %167 = call i32 %166(i8* %163, %0* nonnull %.sub55, i32* nonnull %.sub, i32 2, %0* %164, i32* %165)
  410. %168 = icmp eq i32 %167, 0
  411. br i1 %168, label %call_end52, label %call_fail, !prof !1
  412.  
  413. call_fail: ; preds = %call_end52, %handle_init_end, %handle_init
  414. %merge = phi i32 [ %161, %handle_init ], [ %167, %handle_init_end ], [ %170, %call_end52 ]
  415. ret i32 %merge
  416.  
  417. call_end: ; preds = %handle_init
  418. %169 = load i8*, i8** %158, align 8
  419. br label %handle_init_end
  420.  
  421. call_end52: ; preds = %handle_init_end
  422. %170 = call fastcc i32 @myadd_compute_(%0* nonnull %.sub55, i8* %51, i32* nonnull %.sub, i8* %24, i8* %40, i32 %28)
  423. br label %call_fail
  424. }
  425.  
  426. ; Function Attrs: noinline
  427. define private fastcc i32 @myadd_compute_(%0* noalias, i8* noalias, i32* noalias, i8* noalias, i8* noalias, i32) unnamed_addr #0 {
  428. entry:
  429. %6 = bitcast %0* %0 to i8**
  430. store i8* %1, i8** %6, align 8
  431. store i32 3, i32* %2, align 4, !tbaa !109
  432. %7 = getelementptr inbounds %0, %0* %0, i64 1
  433. %8 = bitcast %0* %7 to i8**
  434. store i8* %3, i8** %8, align 8
  435. %9 = getelementptr inbounds i32, i32* %2, i64 1
  436. store i32 3, i32* %9, align 4, !tbaa !123
  437. %10 = getelementptr inbounds %0, %0* %0, i64 2
  438. %11 = bitcast %0* %10 to i8**
  439. store i8* %4, i8** %11, align 8
  440. %12 = getelementptr inbounds i32, i32* %2, i64 2
  441. store i32 3, i32* %12, align 4, !tbaa !125
  442. %13 = sext i32 %5 to i64
  443. %14 = getelementptr inbounds %0, %0* %0, i64 3
  444. %15 = bitcast %0* %14 to i64*
  445. store i64 %13, i64* %15, align 8
  446. %16 = getelementptr inbounds i32, i32* %2, i64 3
  447. store i32 0, i32* %16, align 4, !tbaa !128
  448. %17 = add nsw i32 %5, 63
  449. %18 = ashr i32 %17, 6
  450. %19 = sext i32 %18 to i64
  451. %20 = getelementptr inbounds %0, %0* %0, i64 4
  452. %21 = bitcast %0* %20 to i64*
  453. store i64 %19, i64* %21, align 8
  454. %22 = getelementptr inbounds i32, i32* %2, i64 4
  455. store i32 0, i32* %22, align 4, !tbaa !130
  456. %23 = getelementptr inbounds %0, %0* %0, i64 5
  457. %24 = bitcast %0* %23 to i64*
  458. store i64 64, i64* %24, align 8
  459. %25 = getelementptr inbounds i32, i32* %2, i64 5
  460. store i32 0, i32* %25, align 4, !tbaa !134
  461. %26 = load i8*, i8** @.tvm_func.myadd__kernel0, align 8
  462. %27 = icmp eq i8* %26, null
  463. br i1 %27, label %handle_init, label %handle_init_end, !prof !38
  464.  
  465. handle_init: ; preds = %entry
  466. %28 = alloca i8*, align 8
  467. %29 = load i8*, i8** @__tvm_module_ctx, align 8, !tbaa !2
  468. %30 = load i32 (i8*, i8*, i8**)*, i32 (i8*, i8*, i8**)** @__TVMBackendGetFuncFromEnv, align 8, !tbaa !2
  469. %31 = call i32 %30(i8* %29, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.24, i64 0, i64 0), i8** nonnull %28)
  470. %32 = icmp eq i32 %31, 0
  471. br i1 %32, label %call_end, label %call_fail, !prof !1
  472.  
  473. handle_init_end: ; preds = %entry, %call_end
  474. %33 = phi i8* [ %26, %entry ], [ %38, %call_end ]
  475. %34 = getelementptr inbounds %0, %0* %0, i64 6
  476. %35 = getelementptr inbounds i32, i32* %2, i64 6
  477. %36 = load i32 (i8*, %0*, i32*, i32, %0*, i32*)*, i32 (i8*, %0*, i32*, i32, %0*, i32*)** @__TVMFuncCall, align 8, !tbaa !2
  478. %37 = call i32 %36(i8* %33, %0* nonnull %0, i32* nonnull %2, i32 6, %0* %34, i32* %35)
  479. br label %call_fail
  480.  
  481. call_fail: ; preds = %handle_init_end, %handle_init
  482. %merge = phi i32 [ %31, %handle_init ], [ %37, %handle_init_end ]
  483. ret i32 %merge
  484.  
  485. call_end: ; preds = %handle_init
  486. %38 = load i8*, i8** %28, align 8
  487. br label %handle_init_end
  488. }
  489.  
  490. attributes #0 = { noinline }
  491.  
  492. !llvm.module.flags = !{!0}
  493.  
  494. !0 = !{i32 2, !"tvm_target", !"llvm"}
  495. !1 = !{!"branch_weights", i32 1048576, i32 1}
  496. !2 = !{!3, !3, i64 0}
  497. !3 = !{!"ctx_ptr", !4, i64 0}
  498. !4 = !{!"tvm-tbaa"}
  499. !5 = !{!6, !6, i64 0}
  500. !6 = !{!"000002BE8884BE20.w1.b0", !7, i64 0}
  501. !7 = !{!"000002BE8884BE20.w2.b0", !8, i64 0}
  502. !8 = !{!"000002BE8884BE20.w4.b0", !9, i64 0}
  503. !9 = !{!"000002BE8884BE20.w8.b0", !10, i64 0}
  504. !10 = !{!"000002BE8884BE20.w16.b0", !11, i64 0}
  505. !11 = !{!"000002BE8884BE20.w32.b0", !12, i64 0}
  506. !12 = !{!"000002BE8884BE20.w64.b0", !13, i64 0}
  507. !13 = !{!"000002BE8884BE20.w128.b0", !14, i64 0}
  508. !14 = !{!"000002BE8884BE20.w256.b0", !15, i64 0}
  509. !15 = !{!"000002BE8884BE20.w512.b0", !16, i64 0}
  510. !16 = !{!"000002BE8884BE20.w1024.b0", !17, i64 0}
  511. !17 = !{!"int32", !18, i64 0}
  512. !18 = !{!"000002BE8884BE20", !4, i64 0}
  513. !19 = !{!20, !20, i64 0}
  514. !20 = !{!"000002BE8884BE20.w1.b1", !7, i64 0}
  515. !21 = !{!22, !22, i64 0}
  516. !22 = !{!"000002BE8884BE20.w1.b2", !23, i64 0}
  517. !23 = !{!"000002BE8884BE20.w2.b2", !8, i64 0}
  518. !24 = !{!25, !25, i64 0}
  519. !25 = !{!"000002BE8884B4C0.w1.b0", !26, i64 0}
  520. !26 = !{!"000002BE8884B4C0.w2.b0", !27, i64 0}
  521. !27 = !{!"000002BE8884B4C0.w4.b0", !28, i64 0}
  522. !28 = !{!"000002BE8884B4C0.w8.b0", !29, i64 0}
  523. !29 = !{!"000002BE8884B4C0.w16.b0", !30, i64 0}
  524. !30 = !{!"000002BE8884B4C0.w32.b0", !31, i64 0}
  525. !31 = !{!"000002BE8884B4C0.w64.b0", !32, i64 0}
  526. !32 = !{!"000002BE8884B4C0.w128.b0", !33, i64 0}
  527. !33 = !{!"000002BE8884B4C0.w256.b0", !34, i64 0}
  528. !34 = !{!"000002BE8884B4C0.w512.b0", !35, i64 0}
  529. !35 = !{!"000002BE8884B4C0.w1024.b0", !36, i64 0}
  530. !36 = !{!"int64", !37, i64 0}
  531. !37 = !{!"000002BE8884B4C0", !4, i64 0}
  532. !38 = !{!"branch_weights", i32 1, i32 1048576}
  533. !39 = !{!40, !40, i64 0}
  534. !40 = !{!"000002BE8884ACF0.w1.b0", !41, i64 0}
  535. !41 = !{!"000002BE8884ACF0.w2.b0", !42, i64 0}
  536. !42 = !{!"000002BE8884ACF0.w4.b0", !43, i64 0}
  537. !43 = !{!"000002BE8884ACF0.w8.b0", !44, i64 0}
  538. !44 = !{!"000002BE8884ACF0.w16.b0", !45, i64 0}
  539. !45 = !{!"000002BE8884ACF0.w32.b0", !46, i64 0}
  540. !46 = !{!"000002BE8884ACF0.w64.b0", !47, i64 0}
  541. !47 = !{!"000002BE8884ACF0.w128.b0", !48, i64 0}
  542. !48 = !{!"000002BE8884ACF0.w256.b0", !49, i64 0}
  543. !49 = !{!"000002BE8884ACF0.w512.b0", !50, i64 0}
  544. !50 = !{!"000002BE8884ACF0.w1024.b0", !51, i64 0}
  545. !51 = !{!"int64", !52, i64 0}
  546. !52 = !{!"000002BE8884ACF0", !4, i64 0}
  547. !53 = !{!54, !54, i64 0}
  548. !54 = !{!"000002BE8884B6A0.w1.b0", !55, i64 0}
  549. !55 = !{!"000002BE8884B6A0.w2.b0", !56, i64 0}
  550. !56 = !{!"000002BE8884B6A0.w4.b0", !57, i64 0}
  551. !57 = !{!"000002BE8884B6A0.w8.b0", !58, i64 0}
  552. !58 = !{!"000002BE8884B6A0.w16.b0", !59, i64 0}
  553. !59 = !{!"000002BE8884B6A0.w32.b0", !60, i64 0}
  554. !60 = !{!"000002BE8884B6A0.w64.b0", !61, i64 0}
  555. !61 = !{!"000002BE8884B6A0.w128.b0", !62, i64 0}
  556. !62 = !{!"000002BE8884B6A0.w256.b0", !63, i64 0}
  557. !63 = !{!"000002BE8884B6A0.w512.b0", !64, i64 0}
  558. !64 = !{!"000002BE8884B6A0.w1024.b0", !65, i64 0}
  559. !65 = !{!"int64", !66, i64 0}
  560. !66 = !{!"000002BE8884B6A0", !4, i64 0}
  561. !67 = !{!68, !68, i64 0}
  562. !68 = !{!"000002BE88857180.w1.b0", !69, i64 0}
  563. !69 = !{!"000002BE88857180.w2.b0", !70, i64 0}
  564. !70 = !{!"000002BE88857180.w4.b0", !71, i64 0}
  565. !71 = !{!"000002BE88857180.w8.b0", !72, i64 0}
  566. !72 = !{!"000002BE88857180.w16.b0", !73, i64 0}
  567. !73 = !{!"000002BE88857180.w32.b0", !74, i64 0}
  568. !74 = !{!"000002BE88857180.w64.b0", !75, i64 0}
  569. !75 = !{!"000002BE88857180.w128.b0", !76, i64 0}
  570. !76 = !{!"000002BE88857180.w256.b0", !77, i64 0}
  571. !77 = !{!"000002BE88857180.w512.b0", !78, i64 0}
  572. !78 = !{!"000002BE88857180.w1024.b0", !79, i64 0}
  573. !79 = !{!"int64", !80, i64 0}
  574. !80 = !{!"000002BE88857180", !4, i64 0}
  575. !81 = !{!82, !82, i64 0}
  576. !82 = !{!"000002BE8884B5B0.w1.b0", !83, i64 0}
  577. !83 = !{!"000002BE8884B5B0.w2.b0", !84, i64 0}
  578. !84 = !{!"000002BE8884B5B0.w4.b0", !85, i64 0}
  579. !85 = !{!"000002BE8884B5B0.w8.b0", !86, i64 0}
  580. !86 = !{!"000002BE8884B5B0.w16.b0", !87, i64 0}
  581. !87 = !{!"000002BE8884B5B0.w32.b0", !88, i64 0}
  582. !88 = !{!"000002BE8884B5B0.w64.b0", !89, i64 0}
  583. !89 = !{!"000002BE8884B5B0.w128.b0", !90, i64 0}
  584. !90 = !{!"000002BE8884B5B0.w256.b0", !91, i64 0}
  585. !91 = !{!"000002BE8884B5B0.w512.b0", !92, i64 0}
  586. !92 = !{!"000002BE8884B5B0.w1024.b0", !93, i64 0}
  587. !93 = !{!"int64", !94, i64 0}
  588. !94 = !{!"000002BE8884B5B0", !4, i64 0}
  589. !95 = !{!96, !96, i64 0}
  590. !96 = !{!"000002BE88857040.w1.b0", !97, i64 0}
  591. !97 = !{!"000002BE88857040.w2.b0", !98, i64 0}
  592. !98 = !{!"000002BE88857040.w4.b0", !99, i64 0}
  593. !99 = !{!"000002BE88857040.w8.b0", !100, i64 0}
  594. !100 = !{!"000002BE88857040.w16.b0", !101, i64 0}
  595. !101 = !{!"000002BE88857040.w32.b0", !102, i64 0}
  596. !102 = !{!"000002BE88857040.w64.b0", !103, i64 0}
  597. !103 = !{!"000002BE88857040.w128.b0", !104, i64 0}
  598. !104 = !{!"000002BE88857040.w256.b0", !105, i64 0}
  599. !105 = !{!"000002BE88857040.w512.b0", !106, i64 0}
  600. !106 = !{!"000002BE88857040.w1024.b0", !107, i64 0}
  601. !107 = !{!"int64", !108, i64 0}
  602. !108 = !{!"000002BE88857040", !4, i64 0}
  603. !109 = !{!110, !110, i64 0}
  604. !110 = !{!"000002BE8885AA70.w1.b0", !111, i64 0}
  605. !111 = !{!"000002BE8885AA70.w2.b0", !112, i64 0}
  606. !112 = !{!"000002BE8885AA70.w4.b0", !113, i64 0}
  607. !113 = !{!"000002BE8885AA70.w8.b0", !114, i64 0}
  608. !114 = !{!"000002BE8885AA70.w16.b0", !115, i64 0}
  609. !115 = !{!"000002BE8885AA70.w32.b0", !116, i64 0}
  610. !116 = !{!"000002BE8885AA70.w64.b0", !117, i64 0}
  611. !117 = !{!"000002BE8885AA70.w128.b0", !118, i64 0}
  612. !118 = !{!"000002BE8885AA70.w256.b0", !119, i64 0}
  613. !119 = !{!"000002BE8885AA70.w512.b0", !120, i64 0}
  614. !120 = !{!"000002BE8885AA70.w1024.b0", !121, i64 0}
  615. !121 = !{!"int32", !122, i64 0}
  616. !122 = !{!"000002BE8885AA70", !4, i64 0}
  617. !123 = !{!124, !124, i64 0}
  618. !124 = !{!"000002BE8885AA70.w1.b1", !111, i64 0}
  619. !125 = !{!126, !126, i64 0}
  620. !126 = !{!"000002BE8885AA70.w1.b2", !127, i64 0}
  621. !127 = !{!"000002BE8885AA70.w2.b2", !112, i64 0}
  622. !128 = !{!129, !129, i64 0}
  623. !129 = !{!"000002BE8885AA70.w1.b3", !127, i64 0}
  624. !130 = !{!131, !131, i64 0}
  625. !131 = !{!"000002BE8885AA70.w1.b4", !132, i64 0}
  626. !132 = !{!"000002BE8885AA70.w2.b4", !133, i64 0}
  627. !133 = !{!"000002BE8885AA70.w4.b4", !113, i64 0}
  628. !134 = !{!135, !135, i64 0}
  629. !135 = !{!"000002BE8885AA70.w1.b5", !132, i64 0}
  630.  
  631. ------opencl code------
  632. __kernel void myadd__kernel0(__global float* restrict C, __global float* restrict A, __global float* restrict B, int n) {
  633. if (((int)get_group_id(0)) < (n / 64)) {
  634. C[((((int)get_group_id(0)) * 64) + ((int)get_local_id(0)))] = (A[((((int)get_group_id(0)) * 64) + ((int)get_local_id(0)))] + B[((((int)get_group_id(0)) * 64) + ((int)get_local_id(0)))]);
  635. } else {
  636. if ((((int)get_group_id(0)) * 64) < (n - ((int)get_local_id(0)))) {
  637. C[((((int)get_group_id(0)) * 64) + ((int)get_local_id(0)))] = (A[((((int)get_group_id(0)) * 64) + ((int)get_local_id(0)))] + B[((((int)get_group_id(0)) * 64) + ((int)get_local_id(0)))]);
  638. }
  639. }
  640. }
Add Comment
Please, Sign In to add comment