bit-checks.ll 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. ; This test makes sure that these instructions are properly eliminated.
  2. ;
  3. ; RUN: opt < %s -instcombine -S | \
  4. ; RUN: not grep "tobool"
  5. ; END.
  6. define i32 @main(i32 %argc, i8** %argv) nounwind ssp {
  7. entry:
  8. %and = and i32 %argc, 1 ; <i32> [#uses=1]
  9. %tobool = icmp ne i32 %and, 0 ; <i1> [#uses=1]
  10. %and2 = and i32 %argc, 2 ; <i32> [#uses=1]
  11. %tobool3 = icmp ne i32 %and2, 0 ; <i1> [#uses=1]
  12. %or.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  13. %retval.0 = select i1 %or.cond, i32 2, i32 1 ; <i32> [#uses=1]
  14. ret i32 %retval.0
  15. }
  16. define i32 @main2(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  17. entry:
  18. %and = and i32 %argc, 1 ; <i32> [#uses=1]
  19. %tobool = icmp eq i32 %and, 0 ; <i1> [#uses=1]
  20. %and2 = and i32 %argc, 2 ; <i32> [#uses=1]
  21. %tobool3 = icmp eq i32 %and2, 0 ; <i1> [#uses=1]
  22. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  23. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  24. ret i32 %storemerge
  25. }
  26. ; tests to check combining (icmp eq (A & B), C) & (icmp eq (A & D), E)
  27. ; tests to check if (icmp eq (A & B), 0) is treated like (icmp eq (A & B), B)
  28. ; if B is a single bit constant
  29. ; (icmp eq (A & B), 0) & (icmp eq (A & D), 0) -> (icmp eq (A & (B|D)), 0)
  30. define i32 @main3(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  31. entry:
  32. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  33. %tobool = icmp eq i32 %and, 0 ; <i1> [#uses=1]
  34. %and2 = and i32 %argc, 48 ; <i32> [#uses=1]
  35. %tobool3 = icmp eq i32 %and2, 0 ; <i1> [#uses=1]
  36. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  37. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  38. ret i32 %storemerge
  39. }
  40. define i32 @main3b(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  41. entry:
  42. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  43. %tobool = icmp eq i32 %and, 0 ; <i1> [#uses=1]
  44. %and2 = and i32 %argc, 16 ; <i32> [#uses=1]
  45. %tobool3 = icmp ne i32 %and2, 16 ; <i1> [#uses=1]
  46. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  47. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  48. ret i32 %storemerge
  49. }
  50. define i32 @main3e_like(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  51. nounwind readnone ssp {
  52. entry:
  53. %and = and i32 %argc, %argc2 ; <i32> [#uses=1]
  54. %tobool = icmp eq i32 %and, 0 ; <i1> [#uses=1]
  55. %and2 = and i32 %argc, %argc3 ; <i32> [#uses=1]
  56. %tobool3 = icmp eq i32 %and2, 0 ; <i1> [#uses=1]
  57. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  58. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  59. ret i32 %storemerge
  60. }
  61. ; (icmp ne (A & B), 0) | (icmp ne (A & D), 0) -> (icmp ne (A & (B|D)), 0)
  62. define i32 @main3c(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  63. entry:
  64. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  65. %tobool = icmp ne i32 %and, 0 ; <i1> [#uses=1]
  66. %and2 = and i32 %argc, 48 ; <i32> [#uses=1]
  67. %tobool3 = icmp ne i32 %and2, 0 ; <i1> [#uses=1]
  68. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  69. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  70. ret i32 %storemerge
  71. }
  72. define i32 @main3d(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  73. entry:
  74. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  75. %tobool = icmp ne i32 %and, 0 ; <i1> [#uses=1]
  76. %and2 = and i32 %argc, 16 ; <i32> [#uses=1]
  77. %tobool3 = icmp eq i32 %and2, 16 ; <i1> [#uses=1]
  78. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  79. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  80. ret i32 %storemerge
  81. }
  82. define i32 @main3f_like(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  83. nounwind readnone ssp {
  84. entry:
  85. %and = and i32 %argc, %argc2 ; <i32> [#uses=1]
  86. %tobool = icmp ne i32 %and, 0 ; <i1> [#uses=1]
  87. %and2 = and i32 %argc, %argc3 ; <i32> [#uses=1]
  88. %tobool3 = icmp ne i32 %and2, 0 ; <i1> [#uses=1]
  89. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  90. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  91. ret i32 %storemerge
  92. }
  93. ; (icmp eq (A & B), B) & (icmp eq (A & D), D) -> (icmp eq (A & (B|D)), (B|D))
  94. define i32 @main4(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  95. entry:
  96. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  97. %tobool = icmp eq i32 %and, 7 ; <i1> [#uses=1]
  98. %and2 = and i32 %argc, 48 ; <i32> [#uses=1]
  99. %tobool3 = icmp eq i32 %and2, 48 ; <i1> [#uses=1]
  100. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  101. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  102. ret i32 %storemerge
  103. }
  104. define i32 @main4b(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  105. entry:
  106. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  107. %tobool = icmp eq i32 %and, 7 ; <i1> [#uses=1]
  108. %and2 = and i32 %argc, 16 ; <i32> [#uses=1]
  109. %tobool3 = icmp ne i32 %and2, 0 ; <i1> [#uses=1]
  110. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  111. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  112. ret i32 %storemerge
  113. }
  114. define i32 @main4e_like(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  115. nounwind readnone ssp {
  116. entry:
  117. %and = and i32 %argc, %argc2 ; <i32> [#uses=1]
  118. %tobool = icmp eq i32 %and, %argc2 ; <i1> [#uses=1]
  119. %and2 = and i32 %argc, %argc3 ; <i32> [#uses=1]
  120. %tobool3 = icmp eq i32 %and2, %argc3 ; <i1> [#uses=1]
  121. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  122. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  123. ret i32 %storemerge
  124. }
  125. ; (icmp ne (A & B), B) | (icmp ne (A & D), D) -> (icmp ne (A & (B|D)), (B|D))
  126. define i32 @main4c(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  127. entry:
  128. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  129. %tobool = icmp ne i32 %and, 7 ; <i1> [#uses=1]
  130. %and2 = and i32 %argc, 48 ; <i32> [#uses=1]
  131. %tobool3 = icmp ne i32 %and2, 48 ; <i1> [#uses=1]
  132. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  133. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  134. ret i32 %storemerge
  135. }
  136. define i32 @main4d(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  137. entry:
  138. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  139. %tobool = icmp ne i32 %and, 7 ; <i1> [#uses=1]
  140. %and2 = and i32 %argc, 16 ; <i32> [#uses=1]
  141. %tobool3 = icmp eq i32 %and2, 0 ; <i1> [#uses=1]
  142. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  143. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  144. ret i32 %storemerge
  145. }
  146. define i32 @main4f_like(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  147. nounwind readnone ssp {
  148. entry:
  149. %and = and i32 %argc, %argc2 ; <i32> [#uses=1]
  150. %tobool = icmp ne i32 %and, %argc2 ; <i1> [#uses=1]
  151. %and2 = and i32 %argc, %argc3 ; <i32> [#uses=1]
  152. %tobool3 = icmp ne i32 %and2, %argc3 ; <i1> [#uses=1]
  153. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  154. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  155. ret i32 %storemerge
  156. }
  157. ; (icmp eq (A & B), A) & (icmp eq (A & D), A) -> (icmp eq (A & (B&D)), A)
  158. define i32 @main5_like(i32 %argc, i32 %argc2, i8** nocapture %argv)
  159. nounwind readnone ssp {
  160. entry:
  161. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  162. %tobool = icmp eq i32 %and, 7 ; <i1> [#uses=1]
  163. %and2 = and i32 %argc2, 7 ; <i32> [#uses=1]
  164. %tobool3 = icmp eq i32 %and2, 7 ; <i1> [#uses=1]
  165. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  166. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  167. ret i32 %storemerge
  168. }
  169. define i32 @main5e_like(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  170. nounwind readnone ssp {
  171. entry:
  172. %and = and i32 %argc, %argc2 ; <i32> [#uses=1]
  173. %tobool = icmp eq i32 %and, %argc ; <i1> [#uses=1]
  174. %and2 = and i32 %argc, %argc3 ; <i32> [#uses=1]
  175. %tobool3 = icmp eq i32 %and2, %argc ; <i1> [#uses=1]
  176. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  177. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  178. ret i32 %storemerge
  179. }
  180. ; (icmp ne (A & B), A) | (icmp ne (A & D), A) -> (icmp ne (A & (B&D)), A)
  181. define i32 @main5c_like(i32 %argc, i32 %argc2, i8** nocapture %argv)
  182. nounwind readnone ssp {
  183. entry:
  184. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  185. %tobool = icmp ne i32 %and, 7 ; <i1> [#uses=1]
  186. %and2 = and i32 %argc2, 7 ; <i32> [#uses=1]
  187. %tobool3 = icmp ne i32 %and2, 7 ; <i1> [#uses=1]
  188. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  189. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  190. ret i32 %storemerge
  191. }
  192. define i32 @main5f_like(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  193. nounwind readnone ssp {
  194. entry:
  195. %and = and i32 %argc, %argc2 ; <i32> [#uses=1]
  196. %tobool = icmp ne i32 %and, %argc ; <i1> [#uses=1]
  197. %and2 = and i32 %argc, %argc3 ; <i32> [#uses=1]
  198. %tobool3 = icmp ne i32 %and2, %argc ; <i1> [#uses=1]
  199. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  200. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  201. ret i32 %storemerge
  202. }
  203. ; (icmp eq (A & B), C) & (icmp eq (A & D), E) -> (icmp eq (A & (B|D)), (C|E))
  204. ; if B, C, D, E are constant, and it's possible
  205. define i32 @main6(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  206. entry:
  207. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  208. %tobool = icmp eq i32 %and, 3 ; <i1> [#uses=1]
  209. %and2 = and i32 %argc, 48 ; <i32> [#uses=1]
  210. %tobool3 = icmp eq i32 %and2, 16 ; <i1> [#uses=1]
  211. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  212. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  213. ret i32 %storemerge
  214. }
  215. define i32 @main6b(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  216. entry:
  217. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  218. %tobool = icmp eq i32 %and, 3 ; <i1> [#uses=1]
  219. %and2 = and i32 %argc, 16 ; <i32> [#uses=1]
  220. %tobool3 = icmp ne i32 %and2, 0 ; <i1> [#uses=1]
  221. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  222. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  223. ret i32 %storemerge
  224. }
  225. ; (icmp ne (A & B), C) | (icmp ne (A & D), E) -> (icmp ne (A & (B|D)), (C|E))
  226. ; if B, C, D, E are constant, and it's possible
  227. define i32 @main6c(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  228. entry:
  229. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  230. %tobool = icmp ne i32 %and, 3 ; <i1> [#uses=1]
  231. %and2 = and i32 %argc, 48 ; <i32> [#uses=1]
  232. %tobool3 = icmp ne i32 %and2, 16 ; <i1> [#uses=1]
  233. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  234. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  235. ret i32 %storemerge
  236. }
  237. define i32 @main6d(i32 %argc, i8** nocapture %argv) nounwind readnone ssp {
  238. entry:
  239. %and = and i32 %argc, 7 ; <i32> [#uses=1]
  240. %tobool = icmp ne i32 %and, 3 ; <i1> [#uses=1]
  241. %and2 = and i32 %argc, 16 ; <i32> [#uses=1]
  242. %tobool3 = icmp eq i32 %and2, 0 ; <i1> [#uses=1]
  243. %or.cond = or i1 %tobool, %tobool3 ; <i1> [#uses=1]
  244. %storemerge = select i1 %or.cond, i32 0, i32 1 ; <i32> [#uses=1]
  245. ret i32 %storemerge
  246. }
  247. ; test parameter permutations
  248. ; (B & A) == B & (D & A) == D
  249. define i32 @main7a(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  250. nounwind readnone ssp {
  251. entry:
  252. %and1 = and i32 %argc2, %argc ; <i32> [#uses=1]
  253. %tobool = icmp eq i32 %and1, %argc2 ; <i1> [#uses=1]
  254. %and2 = and i32 %argc3, %argc ; <i32> [#uses=1]
  255. %tobool3 = icmp eq i32 %and2, %argc3 ; <i1> [#uses=1]
  256. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  257. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  258. ret i32 %storemerge
  259. }
  260. ; B == (A & B) & D == (A & D)
  261. define i32 @main7b(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  262. nounwind readnone ssp {
  263. entry:
  264. %and1 = and i32 %argc, %argc2 ; <i32> [#uses=1]
  265. %tobool = icmp eq i32 %argc2, %and1 ; <i1> [#uses=1]
  266. %and2 = and i32 %argc, %argc3 ; <i32> [#uses=1]
  267. %tobool3 = icmp eq i32 %argc3, %and2 ; <i1> [#uses=1]
  268. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  269. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  270. ret i32 %storemerge
  271. }
  272. ; B == (B & A) & D == (D & A)
  273. define i32 @main7c(i32 %argc, i32 %argc2, i32 %argc3, i8** nocapture %argv)
  274. nounwind readnone ssp {
  275. entry:
  276. %and1 = and i32 %argc2, %argc ; <i32> [#uses=1]
  277. %tobool = icmp eq i32 %argc2, %and1 ; <i1> [#uses=1]
  278. %and2 = and i32 %argc3, %argc ; <i32> [#uses=1]
  279. %tobool3 = icmp eq i32 %argc3, %and2 ; <i1> [#uses=1]
  280. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  281. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  282. ret i32 %storemerge
  283. }
  284. ; (A & (B & C)) == (B & C) & (A & (D & E)) == (D & E)
  285. define i32 @main7d(i32 %argc, i32 %argc2, i32 %argc3,
  286. i32 %argc4, i32 %argc5, i8** nocapture %argv)
  287. nounwind readnone ssp {
  288. entry:
  289. %bc = and i32 %argc2, %argc4 ; <i32> [#uses=1]
  290. %de = and i32 %argc3, %argc5 ; <i32> [#uses=1]
  291. %and1 = and i32 %argc, %bc ; <i32> [#uses=1]
  292. %tobool = icmp eq i32 %and1, %bc ; <i1> [#uses=1]
  293. %and2 = and i32 %argc, %de ; <i32> [#uses=1]
  294. %tobool3 = icmp eq i32 %and2, %de ; <i1> [#uses=1]
  295. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  296. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  297. ret i32 %storemerge
  298. }
  299. ; ((B & C) & A) == (B & C) & ((D & E) & A) == (D & E)
  300. define i32 @main7e(i32 %argc, i32 %argc2, i32 %argc3,
  301. i32 %argc4, i32 %argc5, i8** nocapture %argv)
  302. nounwind readnone ssp {
  303. entry:
  304. %bc = and i32 %argc2, %argc4 ; <i32> [#uses=1]
  305. %de = and i32 %argc3, %argc5 ; <i32> [#uses=1]
  306. %and1 = and i32 %bc, %argc ; <i32> [#uses=1]
  307. %tobool = icmp eq i32 %and1, %bc ; <i1> [#uses=1]
  308. %and2 = and i32 %de, %argc ; <i32> [#uses=1]
  309. %tobool3 = icmp eq i32 %and2, %de ; <i1> [#uses=1]
  310. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  311. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  312. ret i32 %storemerge
  313. }
  314. ; (B & C) == (A & (B & C)) & (D & E) == (A & (D & E))
  315. define i32 @main7f(i32 %argc, i32 %argc2, i32 %argc3,
  316. i32 %argc4, i32 %argc5, i8** nocapture %argv)
  317. nounwind readnone ssp {
  318. entry:
  319. %bc = and i32 %argc2, %argc4 ; <i32> [#uses=1]
  320. %de = and i32 %argc3, %argc5 ; <i32> [#uses=1]
  321. %and1 = and i32 %argc, %bc ; <i32> [#uses=1]
  322. %tobool = icmp eq i32 %bc, %and1 ; <i1> [#uses=1]
  323. %and2 = and i32 %argc, %de ; <i32> [#uses=1]
  324. %tobool3 = icmp eq i32 %de, %and2 ; <i1> [#uses=1]
  325. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  326. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  327. ret i32 %storemerge
  328. }
  329. ; (B & C) == ((B & C) & A) & (D & E) == ((D & E) & A)
  330. define i32 @main7g(i32 %argc, i32 %argc2, i32 %argc3,
  331. i32 %argc4, i32 %argc5, i8** nocapture %argv)
  332. nounwind readnone ssp {
  333. entry:
  334. %bc = and i32 %argc2, %argc4 ; <i32> [#uses=1]
  335. %de = and i32 %argc3, %argc5 ; <i32> [#uses=1]
  336. %and1 = and i32 %bc, %argc ; <i32> [#uses=1]
  337. %tobool = icmp eq i32 %bc, %and1 ; <i1> [#uses=1]
  338. %and2 = and i32 %de, %argc ; <i32> [#uses=1]
  339. %tobool3 = icmp eq i32 %de, %and2 ; <i1> [#uses=1]
  340. %and.cond = and i1 %tobool, %tobool3 ; <i1> [#uses=1]
  341. %storemerge = select i1 %and.cond, i32 0, i32 1 ; <i32> [#uses=1]
  342. ret i32 %storemerge
  343. }