Commit 5334c51
authored
[IR][InstCombine] Fix O(n^2) complexity in SliceUpIllegalIntegerPHI (#175468)
Add a hasInsertionPt() helper, which is equivalent to
getFirstInsertionPt() != end(), but performs the check in O(1) instead
of O(n). In particular, this avoids quadratic complexity inside
SliceUpIllegalIntegerPHI().
Fixes #175465.
Should fix rust-lang/rust#129713.1 parent 55ba30b commit 5334c51
File tree
3 files changed
+15
-6
lines changed- llvm
- include/llvm/IR
- lib/Transforms
- InstCombine
- Scalar
3 files changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
337 | 348 | | |
338 | 349 | | |
339 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
1133 | 1133 | | |
1134 | 1134 | | |
1135 | 1135 | | |
1136 | | - | |
| 1136 | + | |
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
| |||
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
1454 | | - | |
1455 | | - | |
| 1454 | + | |
1456 | 1455 | | |
1457 | 1456 | | |
1458 | 1457 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1381 | 1381 | | |
1382 | 1382 | | |
1383 | 1383 | | |
1384 | | - | |
1385 | | - | |
| 1384 | + | |
1386 | 1385 | | |
1387 | 1386 | | |
1388 | 1387 | | |
| |||
0 commit comments