simple.cpp.expectation 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. ===== AST after parser =====
  2. f(cond1, cond2):
  3. TreeList
  4. IfBranch
  5. UnresolvedReference cond1
  6. TreeList
  7. BinaryOperation Declaration
  8. UnresolvedReference a
  9. MathematicalConstant 1
  10. IfBranch
  11. UnresolvedReference cond2
  12. TreeList
  13. BinaryOperation Declaration
  14. UnresolvedReference b
  15. UnresolvedReference a
  16. ElseIfBranch Else
  17. TreeList
  18. BinaryOperation Declaration
  19. UnresolvedReference b
  20. MathematicalConstant 3
  21. ElseIfBranch Else
  22. TreeList
  23. BinaryOperation Declaration
  24. UnresolvedReference b
  25. MathematicalConstant 4
  26. ReturnNode
  27. UnresolvedReference b
  28. ===== AST after function-call-canonicalization =====
  29. f(cond1, cond2):
  30. TreeList
  31. IfBranch
  32. UnresolvedReference cond1
  33. TreeList
  34. BinaryOperation Declaration
  35. UnresolvedReference a
  36. MathematicalConstant 1
  37. IfBranch
  38. UnresolvedReference cond2
  39. TreeList
  40. BinaryOperation Declaration
  41. UnresolvedReference b
  42. UnresolvedReference a
  43. ElseIfBranch Else
  44. TreeList
  45. BinaryOperation Declaration
  46. UnresolvedReference b
  47. MathematicalConstant 3
  48. ElseIfBranch Else
  49. TreeList
  50. BinaryOperation Declaration
  51. UnresolvedReference b
  52. MathematicalConstant 4
  53. ReturnNode
  54. UnresolvedReference b
  55. ===== AST after if-branch-merging =====
  56. f(cond1, cond2):
  57. TreeList
  58. IfElseIfChain
  59. UnresolvedReference cond1
  60. TreeList
  61. BinaryOperation Declaration
  62. UnresolvedReference a
  63. MathematicalConstant 1
  64. IfElseIfChain
  65. UnresolvedReference cond2
  66. TreeList
  67. BinaryOperation Declaration
  68. UnresolvedReference b
  69. UnresolvedReference a
  70. TreeList
  71. BinaryOperation Declaration
  72. UnresolvedReference b
  73. MathematicalConstant 3
  74. TreeList
  75. BinaryOperation Declaration
  76. UnresolvedReference b
  77. MathematicalConstant 4
  78. ReturnNode
  79. UnresolvedReference b
  80. ===== AST after reference-resolving =====
  81. f(cond1, cond2):
  82. TreeList
  83. IfElseIfChain
  84. Var cond1
  85. TreeList
  86. BinaryOperation Assignment
  87. Var a
  88. MathematicalConstant 1
  89. IfElseIfChain
  90. Var cond2
  91. TreeList
  92. BinaryOperation Assignment
  93. Var b
  94. Var a
  95. TreeList
  96. BinaryOperation Assignment
  97. Var b
  98. MathematicalConstant 3
  99. TreeList
  100. BinaryOperation Assignment
  101. Var b
  102. MathematicalConstant 4
  103. ReturnNode
  104. Var b
  105. ===== AST after cfg-building =====
  106. f(cond1, cond2):
  107. TreeList
  108. IfElseIfChain
  109. Var cond1
  110. TreeList
  111. BinaryOperation Assignment
  112. Var a
  113. MathematicalConstant 1
  114. IfElseIfChain
  115. Var cond2
  116. TreeList
  117. BinaryOperation Assignment
  118. Var b
  119. Var a
  120. TreeList
  121. BinaryOperation Assignment
  122. Var b
  123. MathematicalConstant 3
  124. TreeList
  125. BinaryOperation Assignment
  126. Var b
  127. MathematicalConstant 4
  128. ReturnNode
  129. Var b
  130. ===== CFG after cfg-building =====
  131. f(cond1, cond2):
  132. 0:
  133. ControlFlowBranch true=3 false=7
  134. Var cond1
  135. 1:
  136. ControlFlowFunctionReturn
  137. Var $return
  138. 2:
  139. BinaryOperation Assignment
  140. Var $return
  141. Var b
  142. ControlFlowJump jump=1
  143. 3:
  144. BinaryOperation Assignment
  145. Var a
  146. MathematicalConstant 1
  147. ControlFlowBranch true=5 false=6
  148. Var cond2
  149. 4:
  150. ControlFlowJump jump=2
  151. 5:
  152. BinaryOperation Assignment
  153. Var b
  154. Var a
  155. ControlFlowJump jump=4
  156. 6:
  157. BinaryOperation Assignment
  158. Var b
  159. MathematicalConstant 3
  160. ControlFlowJump jump=4
  161. 7:
  162. BinaryOperation Assignment
  163. Var b
  164. MathematicalConstant 4
  165. ControlFlowJump jump=2
  166. 8:
  167. BinaryOperation Assignment
  168. Var $return
  169. Error ""
  170. ControlFlowJump jump=1
  171. ===== AST after cfg-simplification =====
  172. f(cond1, cond2):
  173. TreeList
  174. IfElseIfChain
  175. Var cond1
  176. TreeList
  177. BinaryOperation Assignment
  178. Var a
  179. MathematicalConstant 1
  180. IfElseIfChain
  181. Var cond2
  182. TreeList
  183. BinaryOperation Assignment
  184. Var b
  185. Var a
  186. TreeList
  187. BinaryOperation Assignment
  188. Var b
  189. MathematicalConstant 3
  190. TreeList
  191. BinaryOperation Assignment
  192. Var b
  193. MathematicalConstant 4
  194. ReturnNode
  195. Var b
  196. ===== CFG after cfg-simplification =====
  197. f(cond1, cond2):
  198. 0:
  199. ControlFlowBranch true=3 false=6
  200. Var cond1
  201. 1:
  202. ControlFlowFunctionReturn
  203. Var $return
  204. 2:
  205. BinaryOperation Assignment
  206. Var $return
  207. Var b
  208. ControlFlowJump jump=1
  209. 3:
  210. BinaryOperation Assignment
  211. Var a
  212. MathematicalConstant 1
  213. ControlFlowBranch true=4 false=5
  214. Var cond2
  215. 4:
  216. BinaryOperation Assignment
  217. Var b
  218. Var a
  219. ControlFlowJump jump=2
  220. 5:
  221. BinaryOperation Assignment
  222. Var b
  223. MathematicalConstant 3
  224. ControlFlowJump jump=2
  225. 6:
  226. BinaryOperation Assignment
  227. Var b
  228. MathematicalConstant 4
  229. ControlFlowJump jump=2
  230. ===== AST after ssa-building =====
  231. f(cond1, cond2):
  232. TreeList
  233. IfElseIfChain
  234. Var cond1@0
  235. TreeList
  236. BinaryOperation Assignment
  237. Var a@1
  238. MathematicalConstant 1
  239. IfElseIfChain
  240. Var cond2@0
  241. TreeList
  242. BinaryOperation Assignment
  243. Var b@1
  244. Var a@1
  245. TreeList
  246. BinaryOperation Assignment
  247. Var b@3
  248. MathematicalConstant 3
  249. TreeList
  250. BinaryOperation Assignment
  251. Var b@4
  252. MathematicalConstant 4
  253. ReturnNode
  254. Var b@2
  255. ===== CFG after ssa-building =====
  256. f(cond1, cond2):
  257. 0:
  258. ControlFlowBranch true=1 false=6
  259. Var cond1@0
  260. 1:
  261. BinaryOperation Assignment
  262. Var a@1
  263. MathematicalConstant 1
  264. ControlFlowBranch true=2 false=5
  265. Var cond2@0
  266. 2:
  267. BinaryOperation Assignment
  268. Var b@1
  269. Var a@1
  270. ControlFlowJump jump=3
  271. 3:
  272. a@2 = phi(2: a@1, 5: a@1, 6: a@0)
  273. b@2 = phi(2: b@1, 5: b@3, 6: b@4)
  274. BinaryOperation Assignment
  275. Var $return@1
  276. Var b@2
  277. ControlFlowJump jump=4
  278. 4:
  279. ControlFlowFunctionReturn
  280. Var $return@1
  281. 5:
  282. BinaryOperation Assignment
  283. Var b@3
  284. MathematicalConstant 3
  285. ControlFlowJump jump=3
  286. 6:
  287. BinaryOperation Assignment
  288. Var b@4
  289. MathematicalConstant 4
  290. ControlFlowJump jump=3
  291. ===== AST after dce =====
  292. f(cond1, cond2):
  293. TreeList
  294. IfElseIfChain
  295. Var cond1@0
  296. TreeList
  297. BinaryOperation Assignment
  298. Var a@1
  299. MathematicalConstant 1
  300. IfElseIfChain
  301. Var cond2@0
  302. TreeList
  303. BinaryOperation Assignment
  304. Var b@1
  305. Var a@1
  306. TreeList
  307. BinaryOperation Assignment
  308. Var b@3
  309. MathematicalConstant 3
  310. TreeList
  311. BinaryOperation Assignment
  312. Var b@4
  313. MathematicalConstant 4
  314. ReturnNode
  315. Var b@2
  316. ===== CFG after dce =====
  317. f(cond1, cond2):
  318. 0:
  319. ControlFlowBranch true=1 false=6
  320. Var cond1@0
  321. 1:
  322. BinaryOperation Assignment
  323. Var a@1
  324. MathematicalConstant 1
  325. ControlFlowBranch true=2 false=5
  326. Var cond2@0
  327. 2:
  328. BinaryOperation Assignment
  329. Var b@1
  330. Var a@1
  331. ControlFlowJump jump=3
  332. 3:
  333. b@2 = phi(2: b@1, 5: b@3, 6: b@4)
  334. BinaryOperation Assignment
  335. Var $return@1
  336. Var b@2
  337. ControlFlowJump jump=4
  338. 4:
  339. ControlFlowFunctionReturn
  340. Var $return@1
  341. 5:
  342. BinaryOperation Assignment
  343. Var b@3
  344. MathematicalConstant 3
  345. ControlFlowJump jump=3
  346. 6:
  347. BinaryOperation Assignment
  348. Var b@4
  349. MathematicalConstant 4
  350. ControlFlowJump jump=3