Commit 521a593
committed
[DFAJumpThreading] Don't bail early after encountering unpredictable values
After llvm#96127 landed, mshockwave reported that the pass was no longer
threading SPEC2006/perlbench.
After 96127 we started bailing out in `getStateDefMap` and rejecting the
transformation because one of the unpredictable values was coming from
inside the loop. There was no fundamental change in that function except
that we started calling `Loop->contains(IncomingBB)` instead of
`LoopBBs.count(IncomingBB)`. After some analysis I came to the
conclusion that even before 96127 we would reject the transformation if
we provided large enough limits on the path traversal (large enough so
that LoopBBs contained blocks corresponding to that unpredictable value).
In this patch I changed `getStateDefMap` to not terminate early on
finding an unpredictable value, this is because `getPathsFromStateDefMap`,
later, actually has checks to ensure that the final list of paths only
have predictable values. As a result we can now partially thread functions
like `negative6` in the tests that have some predictable paths.
This patch does not really have any compile-time impact on the test suite
without `-dfa-early-exit-heuristic=false` (early exit is enabled by
default).
Change-Id: Ie1633b370ed4a0eda8dea52650b40f6f66ef49a31 parent b5b15c1 commit 521a593
File tree
3 files changed
+87
-24
lines changed- llvm
- lib/Transforms/Scalar
- test/Transforms/DFAJumpThreading
3 files changed
+87
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
| 757 | + | |
| 758 | + | |
761 | 759 | | |
762 | 760 | | |
763 | | - | |
764 | | - | |
| 761 | + | |
| 762 | + | |
765 | 763 | | |
766 | 764 | | |
767 | | - | |
| 765 | + | |
768 | 766 | | |
769 | 767 | | |
770 | 768 | | |
| |||
774 | 772 | | |
775 | 773 | | |
776 | 774 | | |
777 | | - | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
778 | 779 | | |
779 | | - | |
780 | | - | |
| 780 | + | |
781 | 781 | | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | 782 | | |
788 | | - | |
| 783 | + | |
789 | 784 | | |
790 | 785 | | |
791 | 786 | | |
| |||
Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| 384 | + | |
| 385 | + | |
384 | 386 | | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
388 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
389 | 394 | | |
390 | | - | |
| 395 | + | |
391 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
392 | 403 | | |
| 404 | + | |
| 405 | + | |
393 | 406 | | |
394 | | - | |
| 407 | + | |
395 | 408 | | |
396 | 409 | | |
397 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
398 | 414 | | |
399 | | - | |
400 | | - | |
| 415 | + | |
| 416 | + | |
401 | 417 | | |
402 | 418 | | |
403 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
404 | 436 | | |
405 | 437 | | |
406 | 438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
221 | 222 | | |
222 | | - | |
223 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
224 | 260 | | |
225 | 261 | | |
226 | 262 | | |
| |||
0 commit comments