Commit 81dd4e6
authored
[Util][NFC] OptimizeIntArithmetic: reduce calls to
This pass is causing long compilation times for llama3 405b (even when
cherry-picking llvm/llvm-project#115399). The
majority of the time is spent in this one pass. The compilation times
improve when calling `eraseState` only when ops are deleted. This is
similar to the upstream listeners in `UnsignedWhenEquivalent.cpp` and
`IntRangeOptimizations.cpp`. It appears this function loops over all
`LatticeAnchors` on each invocation to find the one to delete, causing
it to be slow. My (nonrigorous) experiment showed a decrease from 18 min
to 3 min compile time. My main concern here would be this affecting
correctness, as I don't know if this has unaccounted for side effects.
Signed-off-by: Ian Wood <[email protected]>eraseState (#19130)1 parent d497571 commit 81dd4e6
File tree
1 file changed
+5
-38
lines changed- compiler/src/iree/compiler/Dialect/Util/Transforms
1 file changed
+5
-38
lines changedLines changed: 5 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 292 | + | |
329 | 293 | | |
330 | 294 | | |
331 | 295 | | |
| |||
386 | 350 | | |
387 | 351 | | |
388 | 352 | | |
| 353 | + | |
389 | 354 | | |
390 | 355 | | |
391 | 356 | | |
392 | 357 | | |
393 | 358 | | |
| 359 | + | |
| 360 | + | |
394 | 361 | | |
395 | 362 | | |
396 | 363 | | |
| |||
0 commit comments