SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. BreakCriticalEdges: do not split the critical edge from a CallBr indirect successor (details)
  2. [mlir][Linalg] Add missing check to canonicalization of GenericOp that are identity ops. (details)
  3. Skip 'g' packet tests when running on darwin; debugserver doesn't impl (details)
  4. [SLP] remove dead code in reduction matching; NFC (details)
  5. Revert "Revert "ADT: Fix reference invalidation in SmallVector..."" (details)
  6. [AArch64][GlobalISel] Select immediate fcmp if the zero is on the LHS. (details)
  7. [ADT][Support] Fix C4146 error from MSVC (details)
  8. [SimplifyCFG] Optimize CFG when null is passed to a function with nonnull argument (details)
  9. Revert "[WebAssembly] MC layer writes table symbols to object files" (details)
  10. Revert "[WebAssembly] Add support for table linking to wasm-ld" (details)
  11. hwasan: Update register-dump-read.c test to reserve x23 instead of x20. (details)
  12. [NFC] Disallow unused prefixes under MC/RISCV (details)
  13. [flang] Create names to allow access to inaccessible specifics (details)
  14. [mlir][NFC] Move helper substWithMin into Affine utils (details)
  15. [mlir][AsmPrinter] Properly escape strings when printing locations (details)
Commit ed0fd567ebdbbbbc61eb87346a58196a73f9b814 by ndesaulniers
BreakCriticalEdges: do not split the critical edge from a CallBr indirect successor

Otherwise we'll fail the assertion in SplitBlockPredecessors() related
to splitting the edges from CallBr's.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1161
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1252

Reviewed By: void, MaskRay, jyknight

Differential Revision: https://reviews.llvm.org/D88438
The file was addedllvm/test/Transforms/LoopStrengthReduce/callbr-critical-edge-splitting.ll
The file was addedllvm/test/Transforms/LoopStrengthReduce/callbr-critical-edge-splitting2.ll
The file was modifiedllvm/lib/Transforms/Utils/BreakCriticalEdges.cpp
Commit d7bc3b7ce23b664d6620cdc32370a8614523ca2f by ravishankarm
[mlir][Linalg] Add missing check to canonicalization of GenericOp that are identity ops.

The operantion is an identity if the values yielded by the operation
is the argument of the basic block of that operation. Add this missing check.

Differential Revision: https://reviews.llvm.org/D94819
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/Dialect/Linalg/canonicalize.mlir
Commit 10ac9b29a4ca9e75bcbfa9576e3d8ee83cc9cd78 by Jason Molenda
Skip 'g' packet tests when running on darwin; debugserver doesn't impl

Differential Revision: https://reviews.llvm.org/D94754
The file was modifiedlldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py
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/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-fcmp.mir
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/ADT/StringExtras.h
The file was modifiedllvm/include/llvm/Support/MathExtras.h
Commit a1500105ee6074f992f376c916dcfa3a54acb717 by Dávid Bolvanský
[SimplifyCFG] Optimize CFG when null is passed to a function with nonnull argument

Example:

```
__attribute__((nonnull,noinline)) char * pinc(char *p)  {
  return ++p;
}

char * foo(bool b, char *a) {
       return pinc(b ? 0 : a);

}
```

optimize to

```
char * foo(bool b, char *a) {
       return pinc(a);

}
```

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D94180
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
The file was modifiedllvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
Commit e65b9b04cdeff17fbcdae8d2bb268da832e4a267 by dschuff
Revert "[WebAssembly] MC layer writes table symbols to object files"

This reverts commit e9f1ed2306b1b3aedcb1acef2b50e252a77a04b9.

Reverting because it depends on 38dfce706f
The file was modifiedllvm/test/MC/WebAssembly/reloc-pic.s
The file was modifiedllvm/test/MC/WebAssembly/debug-info64.ll
The file was modifiedllvm/test/MC/WebAssembly/function-alias.ll
The file was modifiedllvm/test/MC/WebAssembly/type-index.s
The file was modifiedllvm/test/MC/WebAssembly/weak-alias.s
The file was modifiedllvm/test/MC/WebAssembly/debug-info.ll
The file was modifiedllvm/test/MC/WebAssembly/global-ctor-dtor.ll
The file was modifiedllvm/lib/MC/WasmObjectWriter.cpp
Commit 187d771d27ed9059675b53e92e8fb8aeee9c43d8 by dschuff
Revert "[WebAssembly] Add support for table linking to wasm-ld"

This reverts commit 38dfce706f796dc109ea495dd69a8cb4c8fa819d.
CI discovered a bug where the table is exported twice: see
D91870
The file was modifiedlld/test/wasm/local-symbols.ll
The file was modifiedlld/wasm/InputFiles.h
The file was modifiedlld/wasm/SymbolTable.cpp
The file was modifiedlld/wasm/InputFiles.cpp
The file was modifiedlld/test/wasm/shared.ll
The file was modifiedlld/wasm/SyntheticSections.cpp
The file was modifiedlld/test/wasm/init-fini.ll
The file was modifiedlld/test/wasm/stack-pointer.ll
The file was modifiedlld/wasm/SymbolTable.h
The file was modifiedlld/wasm/Writer.cpp
The file was modifiedlld/test/wasm/signature-mismatch.ll
The file was modifiedlld/wasm/Symbols.cpp
The file was modifiedlld/test/wasm/alias.s
The file was modifiedlld/test/wasm/section-symbol-relocs.yaml
The file was modifiedlld/test/wasm/locals-duplicate.test
The file was modifiedlld/wasm/Symbols.h
The file was modifiedlld/wasm/MarkLive.cpp
The file was modifiedlld/test/wasm/weak-alias.ll
The file was modifiedlld/test/wasm/pie.ll
The file was modifiedlld/wasm/Driver.cpp
The file was modifiedlld/wasm/SyntheticSections.h
Commit d302398ff05f6d2bfbcb5c4fdafccf8a0e3b9875 by peter
hwasan: Update register-dump-read.c test to reserve x23 instead of x20.

D90422 changed this test to write a fixed value into register x23
instead of x20, but it did not update the list of reserved registers.
This meant that x23 may have been live across the register write,
although this happens to not be the case with the current compiler.
Fix the problem by updating the reserved register list.
The file was modifiedcompiler-rt/test/hwasan/TestCases/register-dump-read.c
Commit aa3d4d9939595295d19969c62077cc09e4823f58 by mtrofin
[NFC] Disallow unused prefixes under MC/RISCV

Differential Revision: https://reviews.llvm.org/D94836
The file was modifiedllvm/test/MC/RISCV/lit.local.cfg
The file was modifiedllvm/test/MC/RISCV/rv32c-only-valid.s
The file was modifiedllvm/test/MC/RISCV/rv32zfh-valid.s
The file was modifiedllvm/test/MC/RISCV/rv64zfh-valid.s
Commit 1bd083b5d6d0619f532a7310e72887ea6d2e87eb by pklausler
[flang] Create names to allow access to inaccessible specifics

When a reference to a generic interface occurs in a specification
expression that must be emitted to a module file, we have a problem
when the generic resolves to a function whose name is inaccessible
due to being PRIVATE or due to a conflict with another use of the
same name in the scope.  In these cases, construct a new name for
the specific procedure and emit a renaming USE to the module file.
Also, relax enforcement of PRIVATE when analyzing module files.

Differential Revision: https://reviews.llvm.org/D94815
The file was modifiedflang/lib/Evaluate/check-expression.cpp
The file was modifiedflang/lib/Semantics/semantics.cpp
The file was modifiedflang/lib/Semantics/tools.cpp
The file was modifiedflang/include/flang/Semantics/expression.h
The file was addedflang/test/Semantics/modfile39.f90
The file was modifiedflang/include/flang/Semantics/tools.h
The file was modifiedflang/lib/Semantics/expression.cpp
The file was modifiedflang/lib/Semantics/resolve-names.cpp
The file was modifiedflang/include/flang/Semantics/semantics.h
Commit 3afbfb4145bea3796f1137c377774848093c3435 by thomasraoux
[mlir][NFC] Move helper substWithMin into Affine utils

This allow using this helper outside of the linalg canonicalization.

Differential Revision: https://reviews.llvm.org/D94826
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
The file was modifiedmlir/include/mlir/Dialect/Affine/Utils.h
The file was modifiedmlir/lib/Dialect/Affine/Utils/Utils.cpp
Commit 2a27a9819a1e3371e3e08d7fbad6235cf50d336d by riddleriver
[mlir][AsmPrinter] Properly escape strings when printing locations

This fixes errors when location strings contains newlines, or other non-ascii characters.

Differential Revision: https://reviews.llvm.org/D94847
The file was modifiedmlir/test/IR/locations.mlir
The file was modifiedmlir/lib/IR/AsmPrinter.cpp