Commit f29e3f7
committed
[DSE] Delay deleting non-memory-defs until end of DSE.
DSE uses BatchAA, which caches queries using pairs of MemoryLocations.
At the moment, DSE may remove instructions that are used as pointers in
cached MemoryLocations. If a new instruction used by a new MemoryLoation
and this instruction gets allocated at the same address as a previosuly
cached and then removed instruction, we may access an incorrect entry in
the cache.
To avoid this delay removing all instructions except MemoryDefs until
the end of DSE. This should avoid removing any values used in BatchAA's
cache.
Test case by @vporpo from
llvm#83181.
(Test not precommitted because the results are non-determinstic - memset
only sometimes gets removed)1 parent d1a461d commit f29e3f7
File tree
2 files changed
+68
-5
lines changed- llvm
- lib/Transforms/Scalar
- test/Transforms/DeadStoreElimination
2 files changed
+68
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
860 | 863 | | |
861 | 864 | | |
862 | 865 | | |
| |||
1692 | 1695 | | |
1693 | 1696 | | |
1694 | 1697 | | |
1695 | | - | |
| 1698 | + | |
| 1699 | + | |
1696 | 1700 | | |
1697 | 1701 | | |
1698 | 1702 | | |
| |||
1708 | 1712 | | |
1709 | 1713 | | |
1710 | 1714 | | |
1711 | | - | |
1712 | | - | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
1713 | 1719 | | |
1714 | 1720 | | |
1715 | 1721 | | |
| |||
1730 | 1736 | | |
1731 | 1737 | | |
1732 | 1738 | | |
1733 | | - | |
| 1739 | + | |
1734 | 1740 | | |
1735 | 1741 | | |
1736 | 1742 | | |
1737 | 1743 | | |
1738 | 1744 | | |
1739 | | - | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
1740 | 1754 | | |
1741 | 1755 | | |
1742 | 1756 | | |
| |||
2287 | 2301 | | |
2288 | 2302 | | |
2289 | 2303 | | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
2290 | 2311 | | |
2291 | 2312 | | |
2292 | 2313 | | |
| |||
Lines changed: 42 additions & 0 deletions
| 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 | + | |
0 commit comments