mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
fc0ecc3cd2
Currently IPSCCP (and others like CVP/GVN) blindly propagate pointer equalities. In certain cases, that leads to dereferenceable pointers being replaced, as in the example test case. I think this is not allowed, as it introduces an access of an un-dereferenceable pointer. Note that the pointer is inbounds, but one past the last element, so it is valid, but not dereferenceable. This patch is mostly to highlight the issue and start a discussion. Currently it only checks for specifically looking one-past-the-last-element pointers with array typed bases. This causes the mis-compile outlined in https://stackoverflow.com/questions/55754313/is-this-gcc-clang-past-one-pointer-comparison-behavior-conforming-or-non-standar In the test case, if we replace %p with the GEP for the store, we subsequently determine that the store and the load cannot alias, because they are to different underlying objects. Note that Alive2 seems to think that the replacement is valid: https://alive2.llvm.org/ce/z/2rorhk Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D85332 |
||
---|---|---|
.. | ||
Analysis | ||
AsmParser | ||
BinaryFormat | ||
Bitcode | ||
Bitstream | ||
CodeGen | ||
DebugInfo | ||
Demangle | ||
DWARFLinker | ||
ExecutionEngine | ||
Extensions | ||
FileCheck | ||
Frontend | ||
Fuzzer | ||
FuzzMutate | ||
InterfaceStub | ||
IR | ||
IRReader | ||
LineEditor | ||
Linker | ||
LTO | ||
MC | ||
MCA | ||
Object | ||
ObjectYAML | ||
Option | ||
Passes | ||
ProfileData | ||
Remarks | ||
Support | ||
TableGen | ||
Target | ||
Testing | ||
TextAPI | ||
ToolDrivers | ||
Transforms | ||
WindowsManifest | ||
XRay | ||
CMakeLists.txt | ||
LLVMBuild.txt |