Commit 3271922
[LLVM][MemCpyOpt] Unify alias tags if we optimize allocas (llvm#129537)
Optimization of alloca instructions may lead to invalid alias tags.
Incorrect alias tags can result in incorrect optimization outcomes for
Fortran source code compiled by Flang with flags: `-O3 -mmlir
-local-alloc-tbaa -flto`.
This commit removes alias tags when memcpy optimization replaces two
arrays with one array, thus ensuring correct compilation of Fortran
source code using flags: `-O3 -mmlir -local-alloc-tbaa -flto`.
This commit is also a proposal to fix the reported issue:
llvm#133984
---------
Co-authored-by: Shilei Tian <[email protected]>
(cherry picked from commit 716b02d)1 parent 907734e commit 3271922
1 file changed
+12
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1466 | 1466 | | |
1467 | 1467 | | |
1468 | 1468 | | |
1469 | | - | |
| 1469 | + | |
1470 | 1470 | | |
1471 | 1471 | | |
1472 | 1472 | | |
| |||
1521 | 1521 | | |
1522 | 1522 | | |
1523 | 1523 | | |
1524 | | - | |
1525 | | - | |
| 1524 | + | |
| 1525 | + | |
1526 | 1526 | | |
1527 | 1527 | | |
1528 | 1528 | | |
| |||
1627 | 1627 | | |
1628 | 1628 | | |
1629 | 1629 | | |
1630 | | - | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1634 | 1636 | | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
1635 | 1640 | | |
1636 | 1641 | | |
1637 | 1642 | | |
| |||
0 commit comments