Commit 97e0ecf
authored
Precompute: Avoid caching heap values of partial precomputations (#7766)
Fixes a regression from #7763
This is pretty subtle, unfortunately. We cache the results of a struct.new
etc as we go, so that identity is preserved for precomputing RefEq etc.
The old code always computed structs in full before checking the cache.
#7763 removed that code as an optimization. But, it turns out,
that was load-bearing in that it, by pure luck, happened to avoid a bug.
The bug that was avoided, and which this PR fixes, is that when we
partially precompute, we modify a struct.new and see if we can
precompute that version. We were still using the same heap value
cache, so we could cache the value, then later end up using it for
the original (before, we'd still compute the struct.new again and
use those values). To fix that, do such speculative precomputations on a
side (throwaway) cache.
Fixes #77651 parent b75c885 commit 97e0ecf
File tree
2 files changed
+72
-5
lines changed- src/passes
- test/lit/passes
2 files changed
+72
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
675 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
676 | 681 | | |
677 | 682 | | |
678 | | - | |
| 683 | + | |
679 | 684 | | |
680 | 685 | | |
681 | 686 | | |
| |||
714 | 719 | | |
715 | 720 | | |
716 | 721 | | |
717 | | - | |
718 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
719 | 731 | | |
720 | 732 | | |
721 | 733 | | |
722 | | - | |
| 734 | + | |
723 | 735 | | |
724 | 736 | | |
725 | 737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments