- Loads from the constant memory (either explicit one or as the source of memory transfer intrinsics) won't alias any stores.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Makes sense.
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | ||
---|---|---|
1571 | Is it possible to write this using getModRefInfo()? Something like if (isModSet(AA->getModRefInfo(M, MemoryLocation::getForSource(M)))). | |
llvm/test/Transforms/MemCpyOpt/memset-memcpy-redundant-memset.ll | ||
21 | Please don't use undef here, or in the other tests. It might lead to confusing results in the future. |
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | ||
---|---|---|
1571 | Good point! |
LGTM
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | ||
---|---|---|
1176–1179 | I think the original code was trying to do something slightly different... but I guess there isn't any test coverage? Not completely sure how the difference could matter, anyway; maybe we could do something funny with pointer alignment in certain edge cases. |
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | ||
---|---|---|
1176–1179 | not regression with all targets enabled, I will check any regression due to this change. |
I think the original code was trying to do something slightly different... but I guess there isn't any test coverage? Not completely sure how the difference could matter, anyway; maybe we could do something funny with pointer alignment in certain edge cases.