SuccessChanges

Summary

  1. [analyzer][StdLibraryFunctionsChecker] Elaborate the summary of fread and fwrite (details)
  2. [llvm-readobj/elf] - Don't crash when the size of s dynamic symbol table, inferred from the hash table, is broken. (details)
  3. [analyzer] Add documentation for alpha.fuchsia.Lock and alpha.core.C11Lock (details)
  4. [InstSimplify] add limit folds for fmin/fmax (details)
  5. [libc++] Use allocator_traits to consistently allocate/deallocate/construct/destroy objects in std::any (details)
  6. SLPVectorizer.h - remove unnecessary AliasAnalysis.h include. NFCI. (details)
  7. [mlir][openacc] Add loop op verifier (details)
  8. [analyzer][Liveness][NFC] Get rid of statement liveness, because such a thing doesn't exist (details)
  9. [XCOFF] Run resource intense test only on platforms where it makes sense (details)
  10. [libc++] Add a benchmark for std::map operations (details)
  11. [MachineBasicBlock] Fix a typo in function copySuccessor (details)
  12. NFC: Add whitespace change to .git-blame-ignore-revs (details)
  13. [X86][AVX] lowerShuffleWithSHUFPS - handle missed canonicalization cases. (details)
  14. [lldb] Add -l/--language option to script command (details)
  15. [VectorCombine] Don't vectorize scalar load under asan/hwasan/memtag/tsan (details)
Commit a012bc4c42e4408a18e4c4d67306b79c576df961 by gabor.marton
[analyzer][StdLibraryFunctionsChecker] Elaborate the summary of fread and fwrite

Add the BufferSize argument constraint to fread and fwrite. This change
itself makes it possible to discover a security critical case, described
in SEI-CERT ARR38-C.

We also add the not-null constraint on the 3rd arguments.

In this patch, I also remove those lambdas that don't take any
parameters (Fwrite, Fread, Getc), thus making the code better
structured.

Differential Revision: https://reviews.llvm.org/D87081
The file was addedclang/test/Analysis/std-c-library-functions-vs-stream-checker.c
The file was modifiedclang/include/clang/StaticAnalyzer/Checkers/Checkers.td
The file was modifiedclang/lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp
The file was modifiedclang/test/Analysis/Inputs/system-header-simulator.h
The file was modifiedclang/test/Analysis/analyzer-enabled-checkers.c
The file was modifiedclang/test/Analysis/std-c-library-functions-arg-constraints.c
Commit 7df873f9c67099a209f0122a1f5411e701a9d425 by grimar
[llvm-readobj/elf] - Don't crash when the size of s dynamic symbol table, inferred from the hash table, is broken.

Currently we might derive the dynamic symbol table size from the DT_HASH hash table (using its `nchain` field).
It is possible to crash dumpers with a broken relocation that refers to a symbol with an index
that is too large. To trigger it, the inferred size of the dynamic symbol table should go past the end of the object.

This patch adds a size validation + warning.

Differential revision: https://reviews.llvm.org/D86923
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/test/tools/llvm-readobj/ELF/hash-symbols.test
The file was modifiedllvm/test/tools/llvm-readobj/ELF/dyn-symbols-size-from-hash-table.test
The file was modifiedllvm/test/tools/llvm-readobj/ELF/hash-histogram.test
The file was modifiedllvm/test/tools/llvm-readobj/ELF/hash-table.test
Commit 7c6f5b7fbf5a9eee7f3ef9192c354d1536a8f1c6 by dkszelethus
[analyzer] Add documentation for alpha.fuchsia.Lock and alpha.core.C11Lock

Differential Revision: https://reviews.llvm.org/D86532
The file was modifiedclang/docs/analyzer/user-docs/CrossTranslationUnit.rst
The file was modifiedclang/docs/analyzer/checkers.rst
Commit 8985755762a429573af2ce657274772339d3b9db by spatel
[InstSimplify] add limit folds for fmin/fmax

If the constant operand is the opposite of the min/max value,
then the result must be the other value.

This is based on the similar codegen transform proposed in:
D87571
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
The file was modifiedllvm/test/Transforms/InstSimplify/fminmax-folds.ll
The file was modifiedllvm/test/Transforms/PhaseOrdering/X86/vector-reductions-expanded.ll
Commit 39c8795141703a7d8313b2448d9d34e856df0b85 by Louis Dionne
[libc++] Use allocator_traits to consistently allocate/deallocate/construct/destroy objects in std::any

https://llvm.org/PR45099 notes (correctly) that we're inconsistent in memory
allocation in `std::any`. We allocate memory with `std::allocator<T>::allocate`,
construct with placement new, destroy by calling the destructor directly, and
deallocate by calling `delete`. Most of those are customizable by the user,
but in different ways.

The standard is silent on how these things are to be accomplished.
This patch makes it so we use `allocator_traits<allocator<T>>` for all
of these operations (allocate, construct, destruct, deallocate).
This is, at least, consistent.

Fixes https://llvm.org/PR45099.

Differential Revision: https://reviews.llvm.org/D81133
The file was modifiedlibcxx/include/any
The file was addedlibcxx/test/libcxx/utilities/any/allocator.pass.cpp
Commit 2b42d53e5ea4ee648cde5b2f73523f01f2405631 by llvm-dev
SLPVectorizer.h - remove unnecessary AliasAnalysis.h include. NFCI.

Forward declare AAResults instead of the (old) AliasAnalysis type.

Remove includes from SLPVectorizer.cpp that are already included in SLPVectorizer.h.
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h
Commit 01f5fcd8290349265e6039ad9089b086ea783f00 by clementval
[mlir][openacc] Add loop op verifier

Add a verifier for the loop op in the OpenACC dialect. Check basic restriction
from 2.9 Loop construct from the OpenACC 3.0 specs.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D87546
The file was modifiedmlir/test/Dialect/OpenACC/ops.mlir
The file was modifiedmlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
The file was modifiedmlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
The file was addedmlir/test/Dialect/OpenACC/invalid.mlir
Commit dd1d5488e47d0a89217dfd22a726c3d3ad2b4984 by dkszelethus
[analyzer][Liveness][NFC] Get rid of statement liveness, because such a thing doesn't exist

The summary and very short discussion in D82122 summarizes whats happening here.

In short, liveness talks about variables, or expressions, anything that
has a value. Well, statements just simply don't have a one.

Differential Revision: https://reviews.llvm.org/D82598
The file was modifiedclang/test/Analysis/live-stmts.mm
The file was modifiedclang/include/clang/Analysis/Analyses/LiveVariables.h
The file was modifiedclang/docs/analyzer/developer-docs/DebugChecks.rst
The file was modifiedclang/lib/StaticAnalyzer/Core/SymbolManager.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Checkers/Checkers.td
The file was modifiedclang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/Environment.cpp
The file was modifiedclang/lib/Analysis/LiveVariables.cpp
The file was modifiedclang/test/Analysis/live-stmts.cpp
The file was modifiedclang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
Commit ec2b0a51977861ed7be92c365ec2636fbf690528 by jasonliu
[XCOFF] Run resource intense test only on platforms where it makes sense

This is a follow up commit for the issue raised in
https://reviews.llvm.org/D86879
The file was modifiedllvm/test/CodeGen/PowerPC/aix-overflow-toc.py
Commit 74a9c6d7e1c49cd0e3a8e8072b8aa03f7a84caff by Louis Dionne
[libc++] Add a benchmark for std::map operations

Before tackling http://llvm.org/PR38722, make sure there is a baseline
benchmark.

Differential Revision: https://reviews.llvm.org/D62778
The file was addedlibcxx/benchmarks/map.bench.cpp
Commit 243ffd0cade71ddca9b0dffec1c8e9084b0f7745 by carrot
[MachineBasicBlock] Fix a typo in function copySuccessor

The condition used to decide if need to copy probability should be reversed.

Differential Revision: https://reviews.llvm.org/D87417
The file was modifiedllvm/lib/CodeGen/MachineBasicBlock.cpp
Commit 4ddd985ca941e48a016e8d7270921b4aa76afbe1 by Louis Dionne
NFC: Add whitespace change to .git-blame-ignore-revs
The file was modified.git-blame-ignore-revs
Commit a43e68b58b085797e2f1435765255ebd431db297 by llvm-dev
[X86][AVX] lowerShuffleWithSHUFPS - handle missed canonicalization cases.

PR47534 exposes a case where calling lowerShuffleWithSHUFPS directly from a derived repeated mask (found by is128BitLaneRepeatedShuffleMask) results in us using an non-canonicalized mask.

The missed canonicalization in this case is trivial - just commute the mask so we have more (swapped) LHS than RHS references so lowerShuffleWithSHUFPS can handle it.
The file was modifiedllvm/test/CodeGen/X86/vector-shuffle-avx512.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 127faae7529aee7e8508abebbc19212ce30bbf27 by Jonas Devlieghere
[lldb] Add -l/--language option to script command

Make it possible to run the script command with a different language
than currently selected.

  $ ./bin/lldb -l python
  (lldb) script -l lua
  >>> io.stdout:write("Hello, World!\n")
  Hello, World!

When passing the language option and a raw command, you need to separate
the flag from the script code with --.

  $ ./bin/lldb -l python
  (lldb) script -l lua -- io.stdout:write("Hello, World!\n")
  Hello, World!

Differential revision: https://reviews.llvm.org/D86996
The file was modifiedlldb/source/Commands/CommandObjectScript.h
The file was modifiedlldb/test/Shell/ScriptInterpreter/Lua/lua.test
The file was modifiedlldb/source/Commands/Options.td
The file was modifiedlldb/source/Commands/CommandObjectScript.cpp
The file was addedlldb/test/Shell/ScriptInterpreter/Lua/lua-python.test
The file was addedlldb/test/Shell/ScriptInterpreter/Python/python.test
The file was modifiedllvm/lib/Support/MemoryBuffer.cpp
Commit 4452cc4086aca1a424b2cd40da9fa120add522e7 by i
[VectorCombine] Don't vectorize scalar load under asan/hwasan/memtag/tsan

Similar to the tsan suppression in
`Utils/VNCoercion.cpp:getLoadLoadClobberFullWidthSize` (rL175034; load widening used by GVN),
the D81766 optimization should be suppressed under tsan due to potential
spurious data race reports:

  struct A {
    int i;
    const short s; // the load cannot be vectorized because
    int modify;    // it overlaps with bytes being concurrently modified
    long pad1, pad2;
  };
  // __tsan_read16 does not know that some bytes are undef and accessing is safe

Similarly, under asan, users can mark memory regions with
`__asan_poison_memory_region`. A widened load can lead to a spurious
use-after-poison error. hwasan/memtag should be similarly suppressed.

`mustSuppressSpeculation` suppresses asan/hwasan/tsan but not memtag, so
we need to exclude memtag in `vectorizeLoadInsert`.

Note, memtag suppression can be relaxed if the load is aligned to the
its granule (usually 16), but that is out of scope of this patch.

Reviewed By: spatel, vitalybuka

Differential Revision: https://reviews.llvm.org/D87538
The file was modifiedllvm/lib/Transforms/Vectorize/VectorCombine.cpp
The file was modifiedllvm/test/Transforms/VectorCombine/X86/load.ll