Commit 25b9ed6
authored
[DAGCombine] Fix multi-use miscompile in load combine (#81586)
The load combine replaces a number of original loads with one new loads
and also replaces the output chains of the original loads with the
output chain of the new load. This is incorrect if the original load is
retained (due to multi-use), as it may get incorrectly reordered.
Fix this by using makeEquivalentMemoryOrdering() instead, which will
create a TokenFactor with both chains.
Fixes #80911.1 parent 89c1bf1 commit 25b9ed6
File tree
2 files changed
+2
-3
lines changed- llvm
- lib/CodeGen/SelectionDAG
- test/CodeGen/X86
2 files changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9252 | 9252 | | |
9253 | 9253 | | |
9254 | 9254 | | |
9255 | | - | |
| 9255 | + | |
9256 | 9256 | | |
9257 | 9257 | | |
9258 | 9258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1283 | 1283 | | |
1284 | 1284 | | |
1285 | 1285 | | |
1286 | | - | |
1287 | 1286 | | |
1288 | 1287 | | |
1289 | 1288 | | |
| |||
1299 | 1298 | | |
1300 | 1299 | | |
1301 | 1300 | | |
| 1301 | + | |
1302 | 1302 | | |
1303 | 1303 | | |
1304 | | - | |
1305 | 1304 | | |
1306 | 1305 | | |
1307 | 1306 | | |
| |||
0 commit comments