Commit 59c6d70
authored
[CodeGenPrepare] Make sure instruction get from SunkAddrs is before MemoryInst (llvm#139303)
Function optimizeBlock may do optimizations on a block for multiple
times. In the first iteration of the loop, MemoryInst1 may generate a
sunk instruction and store it into SunkAddrs. In the second iteration of
the loop, MemoryInst2 may use the same address and then it can reuse the
sunk instruction stored in SunkAddrs, but MemoryInst2 may be before
MemoryInst1 and the corresponding sunk instruction. In order to avoid
use before def error, we need to find appropriate insert position for the
sunk instruction.
Fixes llvm#138208.1 parent 0eb4bd2 commit 59c6d70
File tree
2 files changed
+80
-5
lines changed- llvm
- lib/CodeGen
- test/Transforms/CodeGenPrepare/X86
2 files changed
+80
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5771 | 5771 | | |
5772 | 5772 | | |
5773 | 5773 | | |
| 5774 | + | |
| 5775 | + | |
| 5776 | + | |
| 5777 | + | |
| 5778 | + | |
| 5779 | + | |
| 5780 | + | |
| 5781 | + | |
| 5782 | + | |
| 5783 | + | |
| 5784 | + | |
| 5785 | + | |
| 5786 | + | |
| 5787 | + | |
| 5788 | + | |
| 5789 | + | |
| 5790 | + | |
| 5791 | + | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
| 5795 | + | |
| 5796 | + | |
| 5797 | + | |
| 5798 | + | |
| 5799 | + | |
| 5800 | + | |
| 5801 | + | |
| 5802 | + | |
5774 | 5803 | | |
5775 | 5804 | | |
5776 | 5805 | | |
| |||
5895 | 5924 | | |
5896 | 5925 | | |
5897 | 5926 | | |
5898 | | - | |
5899 | | - | |
5900 | | - | |
5901 | | - | |
5902 | | - | |
5903 | 5927 | | |
5904 | 5928 | | |
5905 | 5929 | | |
| |||
5910 | 5934 | | |
5911 | 5935 | | |
5912 | 5936 | | |
| 5937 | + | |
| 5938 | + | |
| 5939 | + | |
| 5940 | + | |
| 5941 | + | |
| 5942 | + | |
| 5943 | + | |
5913 | 5944 | | |
5914 | 5945 | | |
5915 | 5946 | | |
| |||
Lines changed: 44 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 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments