# Ticket #3259: main.simpl

File main.simpl, 10.0 KB (added by blamario, 7 years ago) |
---|

Line | |
---|---|

1 | [1 of 1] Compiling Main ( primes-test.hs, primes-test.o ) |

2 | |

3 | ==================== Tidy Core ==================== |

4 | Main.lvl :: GHC.Integer.Internals.Integer |

5 | GblId |

6 | [NoCafRefs |

7 | Str: DmdType] |

8 | Main.lvl = GHC.Integer.Internals.S# 1 |

9 | |

10 | lvl1_r1rV :: GHC.Integer.Internals.Integer |

11 | GblId |

12 | [NoCafRefs |

13 | Str: DmdType] |

14 | lvl1_r1rV = GHC.Integer.Internals.S# 0 |

15 | |

16 | lvl2_r1rX :: GHC.Integer.Internals.Integer |

17 | GblId |

18 | [NoCafRefs |

19 | Str: DmdType] |

20 | lvl2_r1rX = GHC.Integer.Internals.S# 2 |

21 | |

22 | Rec { |

23 | Main.factors1 :: GHC.Integer.Internals.Integer |

24 | -> [GHC.Integer.Internals.Integer] |

25 | GblId |

26 | [Arity 1 |

27 | Str: DmdType S] |

28 | Main.factors1 = |

29 | \ (n_alz :: GHC.Integer.Internals.Integer) -> |

30 | let { |

31 | lim_s1rf [ALWAYS Just S] :: GHC.Integer.Internals.Integer |

32 | LclId |

33 | [Str: DmdType] |

34 | lim_s1rf = GHC.Integer.minusInteger n_alz Main.lvl } in |

35 | letrec { |

36 | go_s1rh :: GHC.Integer.Internals.Integer |

37 | -> [GHC.Integer.Internals.Integer] |

38 | LclId |

39 | [Arity 1 |

40 | Str: DmdType S] |

41 | go_s1rh = |

42 | \ (x_a1qw :: GHC.Integer.Internals.Integer) -> |

43 | case GHC.Integer.gtInteger x_a1qw lim_s1rf of _ { |

44 | GHC.Bool.False -> |

45 | case GHC.Real.$wdivMod n_alz x_a1qw of _ { (# _, ww2_aTr #) -> |

46 | case ww2_aTr of _ { |

47 | GHC.Integer.Internals.S# i_dSX -> |

48 | case i_dSX of _ { |

49 | __DEFAULT -> go_s1rh (GHC.Integer.plusInteger x_a1qw Main.lvl); |

50 | 0 -> |

51 | GHC.Types.: |

52 | @ GHC.Integer.Internals.Integer |

53 | x_a1qw |

54 | (go_s1rh (GHC.Integer.plusInteger x_a1qw Main.lvl)) |

55 | }; |

56 | GHC.Integer.Internals.J# s_dT9 d_dTa -> |

57 | case GHC.Prim.cmpIntegerInt# s_dT9 d_dTa 0 of _ { |

58 | __DEFAULT -> go_s1rh (GHC.Integer.plusInteger x_a1qw Main.lvl); |

59 | 0 -> |

60 | GHC.Types.: |

61 | @ GHC.Integer.Internals.Integer |

62 | x_a1qw |

63 | (go_s1rh (GHC.Integer.plusInteger x_a1qw Main.lvl)) |

64 | } |

65 | } |

66 | }; |

67 | GHC.Bool.True -> GHC.Types.[] @ GHC.Integer.Internals.Integer |

68 | }; } in |

69 | case go_s1rh lvl2_r1rX of _ { |

70 | [] -> |

71 | GHC.Types.: |

72 | @ GHC.Integer.Internals.Integer |

73 | n_alz |

74 | (GHC.Types.[] @ GHC.Integer.Internals.Integer); |

75 | : a1_aLo _ -> |

76 | GHC.Types.: |

77 | @ GHC.Integer.Internals.Integer |

78 | a1_aLo |

79 | (Main.factors1 (GHC.Real.$s$dmdiv n_alz a1_aLo)) |

80 | } |

81 | end Rec } |

82 | |

83 | Main.factors [NEVER Nothing] :: forall a_am5. |

84 | (GHC.Real.Integral a_am5) => |

85 | a_am5 -> [a_am5] |

86 | GblId |

87 | [Arity 1 |

88 | NoCafRefs |

89 | Str: DmdType L] |

90 | Main.factors = |

91 | \ (@ a_am5) ($dIntegral_arK :: GHC.Real.Integral a_am5) -> |

92 | let { |

93 | lit_s1rn [ALWAYS Just L] :: a_am5 |

94 | LclId |

95 | [Str: DmdType] |

96 | lit_s1rn = |

97 | case $dIntegral_arK |

98 | of _ { GHC.Real.D:Integral tpl1_B2 _ _ _ _ _ _ _ _ -> |

99 | case tpl1_B2 of _ { GHC.Real.D:Real tpl11_XW _ _ -> |

100 | case tpl11_XW of _ { GHC.Num.D:Num _ _ _ _ _ _ _ _ tpl23_X1j -> |

101 | tpl23_X1j Main.lvl |

102 | } |

103 | } |

104 | } } in |

105 | let { |

106 | lit1_s1rl [ALWAYS Just L] :: a_am5 |

107 | LclId |

108 | [Str: DmdType] |

109 | lit1_s1rl = |

110 | case $dIntegral_arK |

111 | of _ { GHC.Real.D:Integral tpl1_B2 _ _ _ _ _ _ _ _ -> |

112 | case tpl1_B2 of _ { GHC.Real.D:Real tpl11_XW _ _ -> |

113 | case tpl11_XW of _ { GHC.Num.D:Num _ _ _ _ _ _ _ _ tpl23_X1j -> |

114 | tpl23_X1j lvl2_r1rX |

115 | } |

116 | } |

117 | } } in |

118 | let { |

119 | lit2_s1rj [ALWAYS Just L] :: a_am5 |

120 | LclId |

121 | [Str: DmdType] |

122 | lit2_s1rj = |

123 | case $dIntegral_arK |

124 | of _ { GHC.Real.D:Integral tpl1_B2 _ _ _ _ _ _ _ _ -> |

125 | case tpl1_B2 of _ { GHC.Real.D:Real tpl11_XW _ _ -> |

126 | case tpl11_XW of _ { GHC.Num.D:Num _ _ _ _ _ _ _ _ tpl23_X1j -> |

127 | tpl23_X1j lvl1_r1rV |

128 | } |

129 | } |

130 | } } in |

131 | \ (n_alz :: a_am5) -> |

132 | case $dIntegral_arK |

133 | of _ |

134 | { GHC.Real.D:Integral tpl1_B2 tpl2_B3 _ _ tpl5_B6 tpl6_B7 _ _ _ -> |

135 | case tpl2_B3 of _ { GHC.Enum.D:Enum _ _ _ _ _ _ tpl17_X1q _ -> |

136 | case GHC.List.filter |

137 | @ a_am5 |

138 | (\ (k_alG :: a_am5) -> |

139 | case tpl1_B2 of _ { GHC.Real.D:Real _ tpl21_X1a _ -> |

140 | case tpl21_X1a of _ { GHC.Classes.D:Ord tpl24_X3H _ _ _ _ _ _ _ -> |

141 | case tpl24_X3H of _ { GHC.Classes.D:Eq tpl33_X1u _ -> |

142 | tpl33_X1u (tpl6_B7 n_alz k_alG) lit2_s1rj |

143 | } |

144 | } |

145 | }) |

146 | (tpl17_X1q |

147 | lit1_s1rl |

148 | (case tpl1_B2 of _ { GHC.Real.D:Real tpl20_XW _ _ -> |

149 | case tpl20_XW of _ { GHC.Num.D:Num _ _ _ _ tpl28_X1M _ _ _ _ -> |

150 | tpl28_X1M n_alz lit_s1rn |

151 | } |

152 | })) |

153 | of _ { |

154 | [] -> GHC.Types.: @ a_am5 n_alz (GHC.Types.[] @ a_am5); |

155 | : a1_aLo _ -> |

156 | GHC.Types.: |

157 | @ a_am5 |

158 | a1_aLo |

159 | (letrec { |

160 | factors2_s1rp :: a_am5 -> [a_am5] |

161 | LclId |

162 | [Arity 1 |

163 | Str: DmdType L] |

164 | factors2_s1rp = |

165 | \ (n1_Xmx :: a_am5) -> |

166 | case GHC.List.filter |

167 | @ a_am5 |

168 | (\ (k_alG :: a_am5) -> |

169 | case tpl1_B2 of _ { GHC.Real.D:Real _ tpl21_X1a _ -> |

170 | case tpl21_X1a of _ { GHC.Classes.D:Ord tpl24_X3H _ _ _ _ _ _ _ -> |

171 | case tpl24_X3H of _ { GHC.Classes.D:Eq tpl33_X1u _ -> |

172 | tpl33_X1u (tpl6_B7 n1_Xmx k_alG) lit2_s1rj |

173 | } |

174 | } |

175 | }) |

176 | (tpl17_X1q |

177 | lit1_s1rl |

178 | (case tpl1_B2 of _ { GHC.Real.D:Real tpl20_XW _ _ -> |

179 | case tpl20_XW of _ { GHC.Num.D:Num _ _ _ _ tpl28_X1M _ _ _ _ -> |

180 | tpl28_X1M n1_Xmx lit_s1rn |

181 | } |

182 | })) |

183 | of _ { |

184 | [] -> GHC.Types.: @ a_am5 n1_Xmx (GHC.Types.[] @ a_am5); |

185 | : a11_XMC _ -> |

186 | GHC.Types.: |

187 | @ a_am5 a11_XMC (factors2_s1rp (tpl5_B6 n1_Xmx a11_XMC)) |

188 | }; } in |

189 | factors2_s1rp (tpl5_B6 n_alz a1_aLo)) |

190 | } |

191 | } |

192 | } |

193 | |

194 | Main.parallelize :: forall a_asn a1_ass. |

195 | a_asn -> a1_ass -> (a_asn, a1_ass) |

196 | GblId |

197 | [Arity 2 |

198 | NoCafRefs |

199 | Str: DmdType LL] |

200 | Main.parallelize = |

201 | \ (@ a_asn) (@ a1_ass) (a_ahN :: a_asn) (b_ahP :: a1_ass) -> |

202 | case GHC.Prim.par# @ a_asn a_ahN of _ { __DEFAULT -> |

203 | case b_ahP of x1_aUS { __DEFAULT -> (a_ahN, x1_aUS) } |

204 | } |

205 | |

206 | Main.factors2 :: GHC.Integer.Internals.Integer |

207 | -> [GHC.Integer.Internals.Integer] |

208 | GblId |

209 | [Str: DmdType] |

210 | Main.factors2 = |

211 | Main.factors @ GHC.Integer.Internals.Integer GHC.Real.$f8 |

212 | |

213 | Main.test :: GHC.Integer.Internals.Integer |

214 | -> GHC.Integer.Internals.Integer |

215 | -> GHC.Integer.Internals.Integer |

216 | GblId |

217 | [Arity 2 |

218 | Str: DmdType LL] |

219 | Main.test = |

220 | \ (n1_ahR :: GHC.Integer.Internals.Integer) |

221 | (n2_ahT :: GHC.Integer.Internals.Integer) -> |

222 | let { |

223 | a_s1rs [ALWAYS Just L] :: GHC.Integer.Internals.Integer |

224 | LclId |

225 | [Str: DmdType] |

226 | a_s1rs = |

227 | Data.List.prod1 |

228 | (Main.factors2 |

229 | (Data.List.prod1 |

230 | (GHC.Num.up_list Main.lvl Main.lvl n1_ahR) Data.List.lvl1)) |

231 | Data.List.lvl1 } in |

232 | case GHC.Prim.par# @ GHC.Integer.Internals.Integer a_s1rs |

233 | of _ { __DEFAULT -> |

234 | case Data.List.prod1 |

235 | (Main.factors2 |

236 | (Data.List.prod1 |

237 | (GHC.Num.up_list Main.lvl Main.lvl n2_ahT) Data.List.lvl1)) |

238 | Data.List.lvl1 |

239 | of x1_aUS { __DEFAULT -> |

240 | case GHC.Real.$wdivMod x1_aUS a_s1rs of _ { (# ww1_aUo, _ #) -> |

241 | ww1_aUo |

242 | } |

243 | } |

244 | } |

245 | |

246 | Main.lvl3 :: GHC.Integer.Internals.Integer |

247 | GblId |

248 | [NoCafRefs] |

249 | Main.lvl3 = GHC.Integer.Internals.S# 4000 |

250 | |

251 | Main.lvl4 :: GHC.Integer.Internals.Integer |

252 | GblId |

253 | [NoCafRefs] |

254 | Main.lvl4 = GHC.Integer.Internals.S# 4001 |

255 | |

256 | Main.lvl5 :: GHC.Integer.Internals.Integer |

257 | GblId |

258 | [] |

259 | Main.lvl5 = Main.test Main.lvl3 Main.lvl4 |

260 | |

261 | Main.lvl6 :: GHC.Base.String |

262 | GblId |

263 | [] |

264 | Main.lvl6 = |

265 | GHC.Num.$wshowsPrec 0 Main.lvl5 (GHC.Types.[] @ GHC.Types.Char) |

266 | |

267 | Main.a :: GHC.Prim.State# GHC.Prim.RealWorld |

268 | -> (# GHC.Prim.State# GHC.Prim.RealWorld, () #) |

269 | GblId |

270 | [Arity 1 |

271 | Str: DmdType L] |

272 | Main.a = |

273 | \ (eta_aUW :: GHC.Prim.State# GHC.Prim.RealWorld) -> |

274 | case GHC.IO.a23 GHC.Handle.stdout Main.lvl6 eta_aUW |

275 | of _ { (# new_s_a11z, _ #) -> |

276 | GHC.IO.$wa13 GHC.Handle.stdout '\n' new_s_a11z |

277 | } |

278 | |

279 | Main.main :: GHC.IOBase.IO () |

280 | GblId |

281 | [Arity 1 |

282 | Str: DmdType L] |

283 | Main.main = |

284 | Main.a |

285 | `cast` (sym (GHC.IOBase.NTCo:IO ()) |

286 | :: GHC.Prim.State# GHC.Prim.RealWorld |

287 | -> (# GHC.Prim.State# GHC.Prim.RealWorld, () #) |

288 | ~ |

289 | GHC.IOBase.IO ()) |

290 | |

291 | Main.a1 :: GHC.Prim.State# GHC.Prim.RealWorld |

292 | -> (# GHC.Prim.State# GHC.Prim.RealWorld, () #) |

293 | GblId |

294 | [Arity 1 |

295 | Str: DmdType L] |

296 | Main.a1 = |

297 | GHC.TopHandler.a9 |

298 | @ () |

299 | (Main.a |

300 | `cast` (sym (GHC.IOBase.NTCo:IO ()) |

301 | :: GHC.Prim.State# GHC.Prim.RealWorld |

302 | -> (# GHC.Prim.State# GHC.Prim.RealWorld, () #) |

303 | ~ |

304 | GHC.IOBase.IO ())) |

305 | |

306 | :Main.main :: GHC.IOBase.IO () |

307 | GblId |

308 | [Arity 1 |

309 | Str: DmdType L] |

310 | :Main.main = |

311 | Main.a1 |

312 | `cast` (sym (GHC.IOBase.NTCo:IO ()) |

313 | :: GHC.Prim.State# GHC.Prim.RealWorld |

314 | -> (# GHC.Prim.State# GHC.Prim.RealWorld, () #) |

315 | ~ |

316 | GHC.IOBase.IO ()) |

317 | |

318 | |

319 | |

320 | |

321 | ==================== Tidy Core Rules ==================== |

322 | "SPEC Main.factors [GHC.Integer.Internals.Integer]" NEVER |

323 | forall {$dIntegral_sQP :: GHC.Real.Integral |

324 | GHC.Integer.Internals.Integer} |

325 | Main.factors @ GHC.Integer.Internals.Integer $dIntegral_sQP |

326 | = Main.factors1 |

327 | |

328 | |

329 | Linking primes-test ... |