If the size of memory access is unknown, do not use it to analysis. One example of unknown size memory access is to load/store scalable vector objects on the stack.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | ||
---|---|---|
103 | This is too aggressive. We can still determine that a two addresses are non-aliasing even if one is unknown size. (e.g. FrameIndex vs. Global) |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | ||
---|---|---|
103 | The checking is under the condition that BasePtr0.equalBaseIndex(BasePtr1, ...) equals true. It would not be the case you considered. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | ||
---|---|---|
103 | What about the case where equalBaseIndex returns true, and the lowered addressed access has a known size smaller than the difference? In that case, we should be able to determine that they are do not alias. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | ||
---|---|---|
103 | I doubt there is a such scenario to share the same base between fixed and scalable types. I could add an assertion here. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | ||
---|---|---|
103 | I could not exclude the case that one fixed object is fixed length type and another fixed object is scalable vector type. Sorry for that. I will update the patch. |
LGTM modulo minor nit. Thanks!
llvm/lib/CodeGen/SelectionDAG/SelectionDAGAddressAnalysis.cpp | ||
---|---|---|
105 | nit: These bools are single use and can be inlined. |
This is too aggressive. We can still determine that a two addresses are non-aliasing even if one is unknown size. (e.g. FrameIndex vs. Global)