Commit 9b4f6f9
committed
[CodeGenPrepare] Make sure instruction get from SunkAddrs is before MemoryInst
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 move the sunk instruction before MemoryInst2.
It fixes issue 138208.1 parent 55a88cd commit 9b4f6f9
File tree
2 files changed
+47
-0
lines changed- llvm
- lib/CodeGen
- test/Transforms/CodeGenPrepare/X86
2 files changed
+47
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5913 | 5913 | | |
5914 | 5914 | | |
5915 | 5915 | | |
| 5916 | + | |
| 5917 | + | |
| 5918 | + | |
5916 | 5919 | | |
5917 | 5920 | | |
5918 | 5921 | | |
| |||
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