Commit 2afe678
authored
[MemCpyOpt] Allow memcpy elision for non-noalias arguments (#107860)
We currently elide memcpys for readonly nocapture noalias arguments.
noalias is checked to make sure that there are no other ways to write
the memory, e.g. through a different argument or an escaped pointer.
In addition to the current noalias check, also query alias analysis, in
case it can prove that modification is not possible through other means.
This fixes the problem reported in
https://discourse.llvm.org/t/problem-about-memcpy-elimination/81121.1 parent 19f604e commit 2afe678
File tree
2 files changed
+16
-10
lines changed- llvm
- lib/Transforms/Scalar
- test/Transforms/MemCpyOpt
2 files changed
+16
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1950 | 1950 | | |
1951 | 1951 | | |
1952 | 1952 | | |
1953 | | - | |
| 1953 | + | |
1954 | 1954 | | |
1955 | 1955 | | |
1956 | 1956 | | |
| |||
1961 | 1961 | | |
1962 | 1962 | | |
1963 | 1963 | | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
1964 | 1967 | | |
1965 | | - | |
1966 | | - | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
1967 | 1977 | | |
| 1978 | + | |
1968 | 1979 | | |
1969 | | - | |
1970 | 1980 | | |
1971 | 1981 | | |
1972 | 1982 | | |
| |||
1986 | 1996 | | |
1987 | 1997 | | |
1988 | 1998 | | |
1989 | | - | |
1990 | 1999 | | |
1991 | 2000 | | |
1992 | 2001 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
476 | | - | |
477 | | - | |
| 475 | + | |
478 | 476 | | |
479 | 477 | | |
480 | 478 | | |
| |||
489 | 487 | | |
490 | 488 | | |
491 | 489 | | |
492 | | - | |
493 | | - | |
| 490 | + | |
494 | 491 | | |
495 | 492 | | |
496 | 493 | | |
| |||
0 commit comments