Guest User

Untitled

a guest
Oct 21st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.85 KB | None | 0 0
  1. gcolvin@Dell:~/ether/perf-tests/test/unittests/performance$ make -f tests.mk ETHVM-JIT=./ethvm add256.ran
  2. echo ethvm-jit; time -p ./ethvm --vm jit test add256.bin; touch add256.ran
  3. ethvm-jit
  4. ; ModuleID = '7665577a0bc6fbdb1b11cddad76dad92559f0915def3ec7cbb39ad92ae658c11F'
  5. source_filename = "7665577a0bc6fbdb1b11cddad76dad92559f0915def3ec7cbb39ad92ae658c11F"
  6.  
  7. %Runtime = type { %RuntimeData*, %Env*, %Array }
  8. %RuntimeData = type { i64, i64, i8*, i64, i256, i8*, i64, i256, i256, i64 }
  9. %Env = type opaque
  10. %Array = type { i256*, i64, i64 }
  11. %evm.txctx = type { i256, [20 x i8], [20 x i8], i64, i64, i64, i256 }
  12.  
  13. define i32 @"7665577a0bc6fbdb1b11cddad76dad92559f0915def3ec7cbb39ad92ae658c11F"(%Runtime* %rt) {
  14. Entry:
  15. %txctx.loaded = alloca i1
  16. store i1 false, i1* %txctx.loaded
  17. %0 = getelementptr inbounds %Runtime, %Runtime* %rt, i32 0, i32 0
  18. %dataPtr = load %RuntimeData*, %RuntimeData** %0
  19. %mem = getelementptr inbounds %Runtime, %Runtime* %rt, i32 0, i32 2
  20. %stack.base = call i256* @malloc(i64 32768)
  21. %stack.size = alloca i64
  22. store i64 0, i64* %stack.size
  23. %data = load %RuntimeData, %RuntimeData* %dataPtr
  24. %msg.gas = extractvalue %RuntimeData %data, 0
  25. %gas.ptr = alloca i64
  26. store i64 %msg.gas, i64* %gas.ptr
  27. %returndata.ptr = alloca i8*
  28. store i8* null, i8** %returndata.ptr
  29. %returndatasize.ptr = alloca i64
  30. store i64 0, i64* %returndatasize.ptr
  31. store %Array zeroinitializer, %Array* %mem
  32. %jmpBuf.words = alloca i8*, i64 3
  33. %fp = call i8* @llvm.frameaddress(i32 0)
  34. store i8* %fp, i8** %jmpBuf.words
  35. %sp = call i8* @llvm.stacksave()
  36. %jmpBuf.sp = getelementptr inbounds i8*, i8** %jmpBuf.words, i64 2
  37. store i8* %sp, i8** %jmpBuf.sp
  38. %jmpBuf = bitcast i8** %jmpBuf.words to i8*
  39. %1 = call i32 @llvm.eh.sjlj.setjmp(i8* %jmpBuf)
  40. %2 = icmp eq i32 %1, 0
  41. br i1 %2, label %.0, label %Exit, !prof !0
  42.  
  43. .0: ; preds = %Entry
  44. %sp.0 = call i256* @stack.prepare(i256* %stack.base, i64* %stack.size, i64 0, i64 2, i64 2, i8* %jmpBuf)
  45. call void @gas.check(i64* %gas.ptr, i64 6, i8* %jmpBuf)
  46. %3 = getelementptr i256, i256* %sp.0, i64 0
  47. store i256 0, i256* %3, align 16
  48. %4 = getelementptr i256, i256* %sp.0, i64 1
  49. store i256 0, i256* %4, align 16
  50. br label %.4
  51.  
  52. .4: ; preds = %.16, %.0
  53. %sp.4 = call i256* @stack.prepare(i256* %stack.base, i64* %stack.size, i64 -1, i64 2, i64 0, i8* %jmpBuf)
  54. call void @gas.check(i64* %gas.ptr, i64 26, i8* %jmpBuf)
  55. %5 = getelementptr i256, i256* %sp.4, i64 -1
  56. %6 = load i256, i256* %5, align 16
  57. %7 = icmp ult i256 %6, 1048576
  58. %8 = zext i1 %7 to i256
  59. %iszero = icmp eq i256 %8, 0
  60. %9 = zext i1 %iszero to i256
  61. %jump.check = icmp ne i256 %9, 0
  62. %10 = getelementptr i256, i256* %sp.4, i64 -1
  63. store i256 %6, i256* %10, align 16
  64. br i1 %jump.check, label %.400, label %.16, !destIdx !1
  65.  
  66. .16: ; preds = %.4
  67. %sp.16 = call i256* @stack.prepare(i256* %stack.base, i64* %stack.size, i64 -2, i64 4, i64 0, i8* %jmpBuf)
  68. call void @gas.check(i64* %gas.ptr, i64 821, i8* %jmpBuf)
  69. %11 = getelementptr i256, i256* %sp.16, i64 -2
  70. store i256 -43650193032093146282442478976287625120531174123200328216868016097665534397671, i256* %11, align 16
  71. %sp.389 = call i256* @stack.prepare(i256* %stack.base, i64* %stack.size, i64 -1, i64 2, i64 0, i8* %jmpBuf)
  72. call void @gas.check(i64* %gas.ptr, i64 26, i8* %jmpBuf)
  73. %12 = getelementptr i256, i256* %sp.389, i64 -1
  74. %13 = load i256, i256* %12, align 16
  75. %14 = add i256 %13, 1
  76. %15 = getelementptr i256, i256* %sp.389, i64 -1
  77. store i256 %14, i256* %15, align 16
  78. br label %.4, !destIdx !2
  79.  
  80. .400: ; preds = %.4
  81. %sp.400 = call i256* @stack.prepare(i256* %stack.base, i64* %stack.size, i64 -2, i64 2, i64 0, i8* %jmpBuf)
  82. call void @gas.check(i64* %gas.ptr, i64 28, i8* %jmpBuf)
  83. %16 = getelementptr i256, i256* %sp.400, i64 -2
  84. %17 = load i256, i256* %16, align 16
  85. %18 = icmp eq i256 %17, -43650193032093146282442478976287625120531174123200328216868016097665534397671
  86. %19 = zext i1 %18 to i256
  87. %jump.check1 = icmp ne i256 %19, 0
  88. %20 = getelementptr i256, i256* %sp.400, i64 -2
  89. store i256 %17, i256* %20, align 16
  90. %21 = getelementptr i256, i256* %sp.400, i64 -1
  91. store i256 %17, i256* %21, align 16
  92. br i1 %jump.check1, label %.451, label %.442, !destIdx !3
  93.  
  94. .442: ; preds = %.400
  95. %sp.442 = call i256* @stack.prepare(i256* %stack.base, i64* %stack.size, i64 0, i64 2, i64 2, i8* %jmpBuf)
  96. call void @gas.check(i64* %gas.ptr, i64 6, i8* %jmpBuf)
  97. %22 = getelementptr i256, i256* %sp.442, i64 0
  98. store i256 0, i256* %22, align 16
  99. %23 = getelementptr i256, i256* %sp.442, i64 1
  100. store i256 0, i256* %23, align 16
  101. br label %Exit
  102.  
  103. .451: ; preds = %.400
  104. %sp.451 = call i256* @stack.prepare(i256* %stack.base, i64* %stack.size, i64 0, i64 0, i64 0, i8* %jmpBuf)
  105. call void @gas.check(i64* %gas.ptr, i64 1, i8* %jmpBuf)
  106. br label %Exit
  107.  
  108. Exit: ; preds = %Entry, %.451, %.442
  109. %ret = phi i32 [ -1, %.442 ], [ 0, %.451 ], [ -1, %Entry ]
  110. call void @free(i256* %stack.base)
  111. %msg.gas.ptr = getelementptr inbounds %RuntimeData, %RuntimeData* %dataPtr, i32 0, i32 0
  112. %gas = load i64, i64* %gas.ptr
  113. store i64 %gas, i64* %msg.gas.ptr
  114. ret i32 %ret
  115. }
  116.  
  117. declare void @evm.get_tx_context(%evm.txctx*, %Env*)
  118.  
  119. define private fastcc void @loadTxCtx(i1* %flag, %evm.txctx* %txctx, %Env* %env) {
  120. Check:
  121. %0 = load i1, i1* %flag
  122. br i1 %0, label %Exit, label %Load
  123.  
  124. Load: ; preds = %Check
  125. store i1 true, i1* %flag
  126. call void @evm.get_tx_context(%evm.txctx* %txctx, %Env* %env)
  127. br label %Exit
  128.  
  129. Exit: ; preds = %Load, %Check
  130. ret void
  131. }
  132.  
  133. ; Function Attrs: nounwind
  134. declare noalias i256* @malloc(i64) #0
  135.  
  136. ; Function Attrs: nounwind
  137. declare void @free(i256* nocapture) #0
  138.  
  139. ; Function Attrs: nounwind
  140. define private void @gas.check(i64* nocapture %gasPtr, i64 %cost, i8* %jmpBuf) #0 {
  141. Check:
  142. %gas = load i64, i64* %gasPtr
  143. %gasUpdated = sub nsw i64 %gas, %cost
  144. %gasOk = icmp sge i64 %gasUpdated, 0
  145. br i1 %gasOk, label %Update, label %OutOfGas, !prof !0
  146.  
  147. Update: ; preds = %Check
  148. store i64 %gasUpdated, i64* %gasPtr
  149. ret void
  150.  
  151. OutOfGas: ; preds = %Check
  152. call void @llvm.eh.sjlj.longjmp(i8* %jmpBuf)
  153. unreachable
  154. }
  155.  
  156. ; Function Attrs: noreturn nounwind
  157. declare void @llvm.eh.sjlj.longjmp(i8*) #1
  158.  
  159. ; Function Attrs: nounwind readnone
  160. declare i8* @llvm.frameaddress(i32) #2
  161.  
  162. ; Function Attrs: nounwind
  163. declare i8* @llvm.stacksave() #0
  164.  
  165. ; Function Attrs: nounwind
  166. declare i32 @llvm.eh.sjlj.setjmp(i8*) #0
  167.  
  168. ; Function Attrs: nounwind
  169. define private i256* @stack.prepare(i256* readnone %base, i64* noalias nocapture %size.ptr, i64 %min, i64 %max, i64 %diff, i8* %jmpBuf) #0 {
  170. Check:
  171. %size = load i64, i64* %size.ptr, align 4
  172. %size.min = add nsw i64 %size, %min
  173. %size.max = add nuw nsw i64 %size, %max
  174. %ok.min = icmp sge i64 %size.min, 0
  175. %ok.max = icmp ule i64 %size.max, 1024
  176. %ok = and i1 %ok.min, %ok.max
  177. br i1 %ok, label %Update, label %OutOfStack, !prof !0
  178.  
  179. Update: ; preds = %Check
  180. %size.next = add nsw i64 %size, %diff
  181. store i64 %size.next, i64* %size.ptr, align 4
  182. %sp = getelementptr i256, i256* %base, i64 %size
  183. ret i256* %sp
  184.  
  185. OutOfStack: ; preds = %Check
  186. call void @llvm.eh.sjlj.longjmp(i8* %jmpBuf)
  187. unreachable
  188. }
  189.  
  190. attributes #0 = { nounwind }
  191. attributes #1 = { noreturn nounwind }
  192. attributes #2 = { nounwind readnone }
  193.  
  194. !0 = !{!"branch_weights", i32 1, i32 0}
  195. !1 = !{i256 400}
  196. !2 = !{i256 4}
  197. !3 = !{i256 451}
  198. output: ''
  199. exception: false
  200. gas used: 915406909
  201. gas/sec: 1.388e+10
  202. exec time: 0.065939
  203. real 0.89
  204. user 0.87
  205. sys 0.01
  206. gcolvin@Dell:~/ether/perf-tests/test/unittests/performance$
Add Comment
Please, Sign In to add comment