SuccessChanges

Summary

  1. [SLP] remove dead code in reduction matching; NFC (details)
  2. Revert "Revert "ADT: Fix reference invalidation in SmallVector..."" (details)
  3. [AArch64][GlobalISel] Select immediate fcmp if the zero is on the LHS. (details)
  4. [ADT][Support] Fix C4146 error from MSVC (details)
Commit ceb3cdccd0fb597659147e0f538fdee91414541e by spatel
[SLP] remove dead code in reduction matching; NFC

To get into this block we had: !A || B || C
and we checked C in the first 'if' clause
leaving !A || B. But the 2nd 'if' is checking:
A && !B --> !(!A || B)
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Commit ceaf0110ff5e0c2de1f03d65d13703d34d0d5737 by Duncan P. N. Exon Smith
Revert "Revert "ADT: Fix reference invalidation in SmallVector...""

This reverts commit 33be50daa9ce1074c3b423a4ab27c70c0722113a,
effectively reapplying:

- 260a856c2abcef49c7cb3bdcd999701db3e2af38
- 3043e5a5c33c4c871f4a1dfd621a8839f9a1f0b3
- 49142991a685bd427d7e877c29c77371dfb7634c

... with a fix to skip a call to `SmallVector::isReferenceToStorage()`
when we know the parameter had been taken by value for small, POD-like
`T`. See https://reviews.llvm.org/D93779 for the discussion on the
revert.

At a high-level, these commits fix reference invalidation in
SmallVector's push_back, append, insert (one or N), and resize
operations. For more details, please see the original commit messages.

This commit fixes a bug that crept into
`SmallVectorTemplateCommon::reserveForAndGetAddress()` during the review
process after performance analysis was done. That function is now called
`reserveForParamAndGetAddress()`, clarifying that it only works for
parameter values. It uses that knowledge to bypass
`SmallVector::isReferenceToStorage()` when `TakesParamByValue`. This is
`constexpr` and avoids adding overhead for "small enough", trivially
copyable `T`.

Performance could potentially be tuned further by increasing the
threshold for `TakesParamByValue`, which is currently defined as:
```
bool TakesParamByValue = sizeof(T) <= 2 * sizeof(void *);
```
in the POD-like version of SmallVectorTemplateBase (else, `false`).

Differential Revision: https://reviews.llvm.org/D94800
The file was modifiedllvm/include/llvm/ADT/SmallVector.h
The file was modifiedllvm/unittests/ADT/SmallVectorTest.cpp
Commit aa8a2d8a3da3704f82ba4ea3a6e7b463737597e1 by Amara Emerson
[AArch64][GlobalISel] Select immediate fcmp if the zero is on the LHS.
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-fcmp.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
Commit 76f5c5a7b059929f0e0352ad4ff5ec1b78511868 by dblaikie
[ADT][Support] Fix C4146 error from MSVC

Unary minus operator applied to unsigned type, result still unsigned.

Use `~0U` instead of `-1U` and `1 + ~VAL` instead of `-VAL`.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D94417
The file was modifiedllvm/include/llvm/Support/MathExtras.h
The file was modifiedllvm/include/llvm/ADT/StringExtras.h