FailedChanges

Summary

  1. [lldb/Interpreter] Fix language detection for the REPL InitFile (details)
  2. [SCCP] Add test where dereferenceable ptr is replaced with un-dereferenceable one (details)
  3. [llvm-readelf/obj] - Cleanup the interface of `DumpStyle`. NFCI. (details)
  4. [SCCP] Do not replace deref'able ptr with un-deref'able one. (details)
  5. Revert "[SCCP] Do not replace deref'able ptr with un-deref'able one." (details)
Commit bf8f6e89c8d6fbac3e91ab37de7431d8e7c8aab4 by medismail.bennani
[lldb/Interpreter] Fix language detection for the REPL InitFile

Previously, before loading the REPL language-specific init file, lldb
checked the selected target language in which case it returned an unknown
language type with the REPL target.

Instead, the patch calls `Language::GetLanguagesSupportingREPLs` and
look for the first element of that set. In case lldb was not configured
with a REPL language, then, it will just stop sourcing the REPL init
file and fallback to the original logic (continuing with the default
init file).

rdar://65836048

Differential Revision: https://reviews.llvm.org/D87076

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
The file was modifiedlldb/source/Interpreter/CommandInterpreter.cpp
Commit ce654f4be085f0039e7c0d2f1e37db25931e56e2 by flo
[SCCP] Add test where dereferenceable ptr is replaced with un-dereferenceable one
The file was addedllvm/test/Transforms/SCCP/replace-dereferenceable-ptr-with-undereferenceable.ll
Commit 3a204318c6cd6a6b54081e58ced012e2ec120cc9 by grimar
[llvm-readelf/obj] - Cleanup the interface of `DumpStyle`. NFCI.

We have 2 DumpStyles currently:
`class GNUStyle : public DumpStyle<ELFT>` and `class LLVMStyle : public DumpStyle<ELFT>`.

The problem of `DumpStyle` interface is that almost for each method
we provide `const ELFFile<ELFT> *` as argument. But in fact each of
dump styles keeps `ELFDumper<ELFT> *Dumper` which can be used to get an object from.

But since we use the `Obj` too often, I've decided to introduce a one more reference member
instead of reading it from the `Dumper` each time:
`const ELFFile<ELFT> &Obj;` This is kind of similar to `FileName` member which we have already:
it is also used to store a the file name which can be read from `Dumper->getElfObject()->getFileName()`.

I had to adjust the code which previously worked with a pointer to an object
and now works with a reference.

In a follow-up I am going to try to get rid of `const ELFObjectFile<ELFT>` arguments
which are still passed to a set of functions.

Differential revision: https://reviews.llvm.org/D87040
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
Commit 3542feeb2077f267bff1ab98fb4bf20099f44bb8 by flo
[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
The file was modifiedllvm/test/Transforms/SCCP/apint-bigint2.ll
The file was modifiedllvm/test/Transforms/SCCP/indirectbr.ll
The file was modifiedllvm/test/Transforms/SCCP/replace-dereferenceable-ptr-with-undereferenceable.ll
The file was modifiedllvm/lib/Transforms/Scalar/SCCP.cpp
Commit 4c5e4aa89b11ec3253258b8df5125833773d1b1e by flo
Revert "[SCCP] Do not replace deref'able ptr with un-deref'able one."

This reverts commit 3542feeb2077f267bff1ab98fb4bf20099f44bb8.

This seems to be causing issues with a sanitizer build
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/21677
The file was modifiedllvm/test/Transforms/SCCP/apint-bigint2.ll
The file was modifiedllvm/test/Transforms/SCCP/replace-dereferenceable-ptr-with-undereferenceable.ll
The file was modifiedllvm/lib/Transforms/Scalar/SCCP.cpp
The file was modifiedllvm/test/Transforms/SCCP/indirectbr.ll