1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/lib
Florian Hahn fc0ecc3cd2 [SCCP] Do not replace deref'able ptr with un-deref'able one.
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
2020-09-03 10:22:21 +01:00
..
Analysis Revert "[NewPM][Lint] Port -lint to NewPM" 2020-09-02 21:34:29 -07:00
AsmParser [DebugInfo][flang]Added support for representing Fortran assumed length strings 2020-08-22 10:13:40 +05:30
BinaryFormat [DebugInfo] Allow GNU macro extension to be read 2020-08-11 13:30:52 +02:00
Bitcode Set alignment of .llvmbc and .llvmcmd to 1 2020-08-29 18:27:34 -07:00
Bitstream [Bitstream] Use alignTo to make code more readable. NFC 2020-09-01 11:06:45 -07:00
CodeGen [StackProtector] Fix crash with vararg due to not checking LocationSize validity. 2020-09-03 00:08:48 -07:00
DebugInfo [llvm-dwarfdump] Warn user when it encounters no null terminated strings. 2020-09-03 08:49:57 +08:00
Demangle [NFC] Use std::free instead of ::free 2020-07-20 16:19:08 -04:00
DWARFLinker
ExecutionEngine [ORC] Remove stray debugging output. 2020-09-01 20:53:49 -07:00
Extensions
FileCheck Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library 2020-09-01 14:59:28 +02:00
Frontend [OpenMP][OMPBuilder] Adding support for omp single 2020-08-16 01:15:16 -04:00
Fuzzer
FuzzMutate [NewPM][LSR] Rename strength-reduce -> loop-reduce 2020-07-02 11:15:29 -07:00
InterfaceStub Remove unnecessary HEADER_DIRS in lib/InterfaceStub/CMakeLists.txt 2020-08-14 11:22:50 -07:00
IR Revert "[NewPM][Lint] Port -lint to NewPM" 2020-09-02 21:34:29 -07:00
IRReader
LineEditor
Linker [ThinLTO] Fix a metadata lost issue with DICompileUnit import. 2020-09-02 14:40:41 -07:00
LTO [LTO] Don't apply LTOPostLink module flag during writeMergedModule 2020-08-26 11:17:45 -07:00
MC [AArch64] Add asm directives for the remaining SEH unwind codes 2020-09-03 11:12:01 +03:00
MCA [APInt] New member function setBitVal 2020-09-02 21:40:31 +01:00
Object [llvm-lipo] Add support for bitcode files 2020-08-25 21:11:18 -07:00
ObjectYAML [DWARFYAML] Make the debug_str section optional. 2020-09-01 10:02:09 +08:00
Option [Clang options] Optimize optionMatches() runtime by removing mallocs 2020-08-12 23:07:07 -07:00
Passes Revert "[NewPM][Lint] Port -lint to NewPM" 2020-09-02 21:34:29 -07:00
ProfileData [SampleFDO] Enhance profile remapping support for searching inline instance 2020-08-26 11:07:35 -07:00
Remarks BitstreamRemarkParser.h - remove unnecessary includes. NFCI. 2020-08-06 13:17:53 +01:00
Support [lldb] Add reproducer verifier 2020-09-02 22:00:00 -07:00
TableGen Replace TableGen range piece punctuator with '...' 2020-08-21 23:33:57 +02:00
Target [AArch64] Add asm directives for the remaining SEH unwind codes 2020-09-03 11:12:01 +03:00
Testing [cmake] Make gtest include directories a part of the library interface 2020-08-27 15:35:57 +02:00
TextAPI [TextAPI] update DriverKit string value 2020-08-15 06:44:30 -07:00
ToolDrivers [llvm-lib] Support adding short import library objects with llvm-lib 2020-07-24 22:15:08 +03:00
Transforms [SCCP] Do not replace deref'able ptr with un-deref'able one. 2020-09-03 10:22:21 +01:00
WindowsManifest
XRay
CMakeLists.txt Reland [FileCheck] Move FileCheck implementation out of LLVMSupport into its own library 2020-09-01 14:59:28 +02:00
LLVMBuild.txt [elfabi] Move llvm-elfabi related code to InterfaceStub library 2020-08-13 11:51:44 -07:00