Changes

Summary

  1. [SLP]Improve isFixedVectorShuffle and its use. (details)
  2. Typo fix (details)
  3. [flang] Address TODO from previous changes to IsSaved() (details)
  4. [memprof] Extend llvm-profdata to display MemProf profile summaries. (details)
  5. [gn build] Port 7cca33b40f77 (details)
  6. [ELF] Change -z unknown from error to warning (details)
  7. [InstSimplify] make 'or' test names more descriptive; NFC (details)
  8. [InstSimplify] reduce code duplication for 'or' logic folds; NFC (details)
  9. [InstSimplify] add logic fold for 'or' (details)
  10. [lldb] Search PrivateFrameworks when using an internal SDK (details)
  11. [lldb] Fix indentation in builders/darwin.py (details)
  12. [ELF][PPC64] Remove unneeded PPC64PCRelLongBranchThunk (details)
  13. [memprof] Fix unit test build after refactoring shared header. (details)
  14. [libc][clang-tidy] fix namespace check for externals (details)
  15. fix inverted logic for HideUnrelatedOptions (details)
  16. [mlir][tosa] Add tosa.conv2d as fully_connected canonicalization (details)
  17. [memprof] Disable pedantic warnings, suppress variadic macro warning. (details)
  18. [NFC][Clang]Inclusive language: Replace uses of whitelist in clang/test (details)
  19. [clang][docs] Inclusive language: remove use of sanity check in option description (details)
  20. [SCEV] Verify integrity of ValuesAtScopes and users (NFC) (details)
  21. [memprof] Disallow memprof profile reader tests on non-x86 archs. (details)
  22. AArch64 GIsel: legalize lshr operands, even if it is poison (details)
  23. [mlir][MemRef] Fix SubViewOp canonicalization when a subset of unit-dims are dropped. (details)
  24. [mlir][tensor] InsertSliceOp verification. (details)
  25. [lldb] Mark TestTsanBasic and TestUbsanBasic as "no debug info" tests (details)
  26. [lldb] Fix TypeError: argument of type 'NoneType' is not iterable (details)
  27. [flang] Fix usage & catch errors for MAX/MIN with keyword= arguments (details)
  28. [lldb] Fix broken skipUnlessUndefinedBehaviorSanitizer decorator (details)
  29. [clang-repl][NFC] Fix calling convention mismatch in test (details)
  30. [flang] Re-fold bounds expressions in DATA implied DO loops (details)
Commit dce6c434ead3ccbaa67b8db2301b2a9fb4319123 by a.bataev
[SLP]Improve isFixedVectorShuffle and its use.

Extended support for undefined source vector/extract indices/non-fixed
vector types, also no need to check for the parent of the extractelement
instructions with the constant indicies.

Differential Revision: https://reviews.llvm.org/D114121
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/alternate-int-inseltpoison.ll
The file was modifiedllvm/test/Transforms/SLPVectorizer/X86/alternate-int.ll
Commit c0b33a65f21c780a1a89ea7e8caa43871b2fd29c by hans
Typo fix
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 8bc593cbbb1ae6aac6443132ae2d33c6513b1a2c by pklausler
[flang] Address TODO from previous changes to IsSaved()

An earlier fix to evaluate::IsSaved() needed to preserve its
treatment of named constants in modules and main programs -- i.e.
they would appear to be saved -- until a correction was added
to the lowering code.  This TODO can now be resolved.

Differential Revision: https://reviews.llvm.org/D114756
The file was modifiedflang/lib/Evaluate/tools.cpp
Commit 7cca33b40f77c2d8bcd4241bcd0e4c45a0209683 by snehasishk
[memprof] Extend llvm-profdata to display MemProf profile summaries.

This commit adds initial support to llvm-profdata to read and print
summaries of raw memprof profiles.
Summary of changes:
* Refactor shared defs to MemProfData.inc
* Extend show_main to display memprof profile summaries.
* Add a simple raw memprof profile reader.
* Add a couple of tests to tools/llvm-profdata.

Differential Revision: https://reviews.llvm.org/D114286
The file was modifiedcompiler-rt/lib/memprof/CMakeLists.txt
The file was addedllvm/test/tools/llvm-profdata/Inputs/basic.memprofraw
The file was addedllvm/test/tools/llvm-profdata/Inputs/multi.memprofraw
The file was addedllvm/lib/ProfileData/RawMemProfReader.cpp
The file was addedllvm/test/tools/llvm-profdata/memprof-basic.test
The file was modifiedcompiler-rt/include/CMakeLists.txt
The file was modifiedllvm/lib/ProfileData/CMakeLists.txt
The file was addedllvm/test/tools/llvm-profdata/memprof-multi.test
The file was addedllvm/include/llvm/ProfileData/RawMemProfReader.h
The file was addedllvm/include/llvm/ProfileData/MemProfData.inc
The file was modifiedcompiler-rt/lib/memprof/memprof_rawprofile.cpp
The file was modifiedllvm/tools/llvm-profdata/llvm-profdata.cpp
The file was modifiedcompiler-rt/lib/memprof/memprof_rawprofile.h
The file was modifiedllvm/test/tools/llvm-profdata/text-format-errors.test
The file was addedcompiler-rt/include/profile/MemProfData.inc
Commit 299cec3c51a9bbe4683825c9aac86551733d689d by llvmgnsyncbot
[gn build] Port 7cca33b40f77
The file was modifiedllvm/utils/gn/secondary/llvm/lib/ProfileData/BUILD.gn
Commit 8c3641d03ec0cb0e8730cad349b54d67581b4c73 by i
[ELF] Change -z unknown from error to warning

There is a trend of having more optional options (usually security
hardening related) like -z cet-report=, -z bti-report=, -z force-bti.
If ld.lld 14.0.0 uses a warning, in 15/16/17/... timeframe when people
add new options to software, they can worry less about linker errors on ld.lld 14.0.0.

In some cases `-z foo` does essential work where a silent ignore can be
problematic, but the user has received a warning. From my observation, the
doing-essential-work `-z foo` is much fewer than the converse. In addition,
the user who cares can use `--fatal-warnings` (Note: GNU ld doesn't upgrade warnings to errors).
It is unclear whether we need something like `clang -Wunknown-warning-option`.

If we ever run into unfortunate transition like `-z start-stop-gc`, the
affected software (e.g. ldc is a compiler which passes linker options to the underlying ld)
can blindly add the `-z` option, without worrying it may cause a linker error to LLD 14.0.0.

Reviewed By: jrtc27, peter.smith

Differential Revision: https://reviews.llvm.org/D114748
The file was modifiedlld/ELF/Driver.cpp
The file was modifiedlld/test/ELF/driver.test
Commit 6076c1dc1ca1077923a7b82f6b155d746efa9be9 by spatel
[InstSimplify] make 'or' test names more descriptive; NFC

Also, vary the types in a couple of tests for better coverage.
The file was modifiedllvm/test/Transforms/InstSimplify/AndOrXor.ll
Commit c49ef1448d1779385e0e0ea88b1d8343f4830a79 by spatel
[InstSimplify] reduce code duplication for 'or' logic folds; NFC
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
Commit 4b30076f16fc55891da8952bda3f2d81dbeec5a5 by spatel
[InstSimplify] add logic fold for 'or'

https://alive2.llvm.org/ce/z/4PaPDy

There's a related fold where the inner 'or' is replaced by 'and',
but that needs to be more careful about matching a 'not'.
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
The file was modifiedllvm/test/Transforms/InstSimplify/or.ll
Commit 0a302f66673720a0d3fd3f0ce32ec9cfda428cf1 by Jonas Devlieghere
[lldb] Search PrivateFrameworks when using an internal SDK

Make sure to add the PrivateFrameworks directory to the frameworks path
when using an internal SDK. This is necessary for the "on-device" test
suite.

rdar://84519268

Differential revision: https://reviews.llvm.org/D114742
The file was modifiedlldb/packages/Python/lldbsuite/test/builders/darwin.py
Commit 4fa9e435209e6067b9d5921647429053ae7a8e0c by Jonas Devlieghere
[lldb] Fix indentation in builders/darwin.py
The file was modifiedlldb/packages/Python/lldbsuite/test/builders/darwin.py
Commit ad45df91ad6ad01234ded221d1cbdc168eaee53b by i
[ELF][PPC64] Remove unneeded PPC64PCRelLongBranchThunk

This reverts the PPC64PCRelLongBranchThunk part from D86706.
PPC64PCRelLongBranchThunk is the same as PPC64R12SetupStub.

Use `__gep_setup_` instead of `__long_branch_pcrel_` for the stub symbol name
as it more closely indicates the operation.
(Note: GNU ld uses `*.long_branch.*` and `*.plt_branch.*`).

Reviewed By: NeHuang, nemanjai

Differential Revision: https://reviews.llvm.org/D114656
The file was modifiedlld/test/ELF/ppc64-pcrel-long-branch.s
The file was modifiedlld/ELF/Thunks.cpp
The file was modifiedlld/test/ELF/ppc64-pcrel-cross-link.s
The file was modifiedlld/test/ELF/ppc64-pcrel-long-branch-error.s
Commit a2ce97cc3f99c8af80b2325acf03a4c171ffb48f by snehasishk
[memprof] Fix unit test build after refactoring shared header.

The memprof unittest also needs to include the MemProfData.inc header
directly to have access to MEMPROF_RAW_MAGIC and MEMPROF_RAW_VERSION
globals.
The file was modifiedcompiler-rt/lib/memprof/tests/CMakeLists.txt
The file was modifiedcompiler-rt/lib/memprof/tests/rawprofile.cpp
Commit 155f5a6dac62a902a30f60e2717c4ba8fb828139 by michaelrj
[libc][clang-tidy] fix namespace check for externals

Up until now, all references to `errno` were marked with `NOLINT`, since
it was technically calling an external function. This fixes the lint
rules so that `errno`, as well as `malloc`, `calloc`, `realloc`, and
`free` are all allowed to be called as external functions. All of the
relevant `NOLINT` comments have been removed, and the documentation has
been updated.

Reviewed By: sivachandra, lntue, aaron.ballman

Differential Revision: https://reviews.llvm.org/D113946
The file was modifiedlibc/src/__support/FPUtil/NearestIntegerOperations.h
The file was modifiedlibc/src/string/strndup.cpp
The file was modifiedclang-tools-extra/clang-tidy/llvmlibc/CalleeNamespaceCheck.cpp
The file was modifiedlibc/docs/clang_tidy_checks.rst
The file was modifiedlibc/src/math/generic/math_utils.h
The file was modifiedclang-tools-extra/test/clang-tidy/checkers/llvmlibc-callee-namespace.cpp
The file was modifiedlibc/src/__support/str_to_integer.h
The file was modifiedlibc/src/string/strdup.cpp
The file was modifiedlibc/src/__support/str_to_float.h
Commit 2e114e3fda4ff6492eaafab0d38033ea17fa99fc by vtjnash
fix inverted logic for HideUnrelatedOptions

It seems clearer to me that this would check for *any of* instead of
*all of* these option categories, as it looks to me like that was the
intent. But apparently this logic has always has been inverted, and
possibly never fully used?

Differential Revision: https://reviews.llvm.org/D114572
The file was modifiedllvm/lib/Support/CommandLine.cpp
Commit 13bdb7ab4a7acaea7144a042fe583d45fbb9b5c4 by rob.suderman
[mlir][tosa] Add tosa.conv2d as fully_connected canonicalization

For a 1x1 weight and stride of 1, the input/weight can be reshaped and passed into a fully connected op then reshaped back

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D114757
The file was modifiedmlir/lib/Dialect/Tosa/IR/TosaOps.cpp
The file was modifiedmlir/test/Dialect/Tosa/canonicalize.mlir
The file was modifiedmlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
Commit 1cf11df5912896e9b0c632c86da286513c171114 by snehasishk
[memprof] Disable pedantic warnings, suppress variadic macro warning.

The memprof unit tests use an older version of gmock (included in the
repo) which does not build cleanly with -pedantic:
https://github.com/google/googletest/issues/2650
For now just silence the warning by disabling pedantic and add the
appropriate flags for gcc and clang.
The file was modifiedcompiler-rt/lib/memprof/tests/CMakeLists.txt
Commit c379911a94c1e777c232d1e3e65f5c70d0453234 by zarko
[NFC][Clang]Inclusive language: Replace uses of whitelist in clang/test
The file was modifiedclang/unittests/Driver/SanitizerArgsTest.cpp
The file was modifiedclang/test/SemaCXX/reinterpret-cast.cpp
The file was modifiedclang/test/Preprocessor/macro-reserved.cpp
The file was modifiedclang/test/SemaObjC/warn-retain-cycle.m
The file was modifiedclang/test/Preprocessor/macro-reserved.c
The file was modifiedclang/test/Sema/conversion.c
Commit f5ad6fa279cc012427b119828bdb679af5197c70 by zarko
[clang][docs] Inclusive language: remove use of sanity check in option description

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D114562
The file was modifiedclang/docs/ThreadSafetyAnalysis.rst
Commit c9f9be0381d1a3dee1304981ad52c0285638efca by nikita.ppv
[SCEV] Verify integrity of ValuesAtScopes and users (NFC)

Make sure that ValuesAtScopes and ValuesAtScopesUsers are
consistent during SCEV verification.
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
Commit 86d5dc9afc9b99a143214604ff7a43652ce6df46 by snehasishk
[memprof] Disallow memprof profile reader tests on non-x86 archs.

The memprof profile reader tests rely on binary data which is generated
from and meant to be interpreted on little endian architectures. Add a
REQUIRES: x86_64-linux clause to both tests to ensure they don't fail on big
endian targets such as ppc.
The file was modifiedllvm/test/tools/llvm-profdata/memprof-basic.test
The file was modifiedllvm/test/tools/llvm-profdata/memprof-multi.test
Commit 18308e171b5b1dd99627a4d88c7d6c5ff21b8c96 by vtjnash
AArch64 GIsel: legalize lshr operands, even if it is poison

Previously, this caused GlobalISel to emit invalid IR (a gpr32 to gpr64
copy) and fail during verification.

While this shift is not defined (returns poison), it should not crash
codegen, as it may appear inside dead code (for example, a select
instruction), and it is legal IR input, as long as the value is unused.

Discovered while trying to build Julia with LLVM v13:
https://github.com/JuliaLang/julia/pull/42602.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D114389
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-scalar-shift-imm.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-binop.mir
Commit 311dd55c9eb9342b1c889f6db7728f15b05378bb by nicolas.vasilache
[mlir][MemRef] Fix SubViewOp canonicalization when a subset of unit-dims are dropped.

The canonical type of the result of the `memref.subview` needs to make
sure that the previously dropped unit-dimensions are the ones dropped
for the canonicalized type as well. This means the generic
`inferRankReducedResultType` cannot be used. Instead the current
dropped dimensions need to be querried and the same need to be dropped.

Reviewed By: nicolasvasilache, ThomasRaoux

Differential Revision: https://reviews.llvm.org/D114751
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Utils/Utils.h
The file was modifiedmlir/test/Dialect/MemRef/canonicalize.mlir
The file was modifiedmlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
Commit a08b750ce9df2bf1cf9270d83c50de68eeb8b6f5 by nicolas.vasilache
[mlir][tensor] InsertSliceOp verification.

This revision reintroduces tensor.insert_slice verification which seems
to have vanished over time: a verifier was initially introduced in cf9503c1b752062d9abfb2c7922a50574d9c5de4
but for some reason the invalid.mlir was not properly updated; as time passed the verifier was not called anymore and later the code was deleted.

As a consequence, a non-negligible portion of tests has run astray using invalid
tensor.insert_slice semantics and needed to be fixed.

Also, extract isRankReducedType from TensorOps for better reuse
Originally, this facility was used by both tensor and memref forms but
it got copied around as dialects were split.

Differential Revision: https://reviews.llvm.org/D114715
The file was modifiedmlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
The file was modifiedmlir/lib/IR/BuiltinTypes.cpp
The file was modifiedmlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
The file was modifiedmlir/include/mlir/Dialect/Utils/StaticValueUtils.h
The file was modifiedmlir/test/Dialect/Linalg/comprehensive-module-bufferize-analysis.mlir
The file was modifiedmlir/test/Dialect/MemRef/invalid.mlir
The file was modifiedmlir/lib/Dialect/Tensor/IR/TensorOps.cpp
The file was modifiedmlir/test/Dialect/SCF/for-loop-canonicalization.mlir
The file was modifiedmlir/include/mlir/IR/BuiltinTypes.h
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/Dialect/Linalg/roundtrip.mlir
The file was modifiedmlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
The file was modifiedmlir/test/Dialect/Tensor/ops.mlir
The file was modifiedmlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
The file was modifiedmlir/lib/Dialect/Utils/StaticValueUtils.cpp
The file was modifiedmlir/test/IR/core-ops.mlir
The file was modifiedmlir/test/Dialect/Tensor/canonicalize.mlir
The file was modifiedmlir/test/Dialect/Tensor/invalid.mlir
Commit 5f2e8f579697492fab572796f99bc713f349e6fe by Jonas Devlieghere
[lldb] Mark TestTsanBasic and TestUbsanBasic as "no debug info" tests

Speed up testing by not rerunning the test for all debug info variants.
The file was modifiedlldb/test/API/functionalities/ubsan/basic/TestUbsanBasic.py
The file was modifiedlldb/test/API/functionalities/tsan/basic/TestTsanBasic.py
Commit c47135949779904542ee1e6d5486609ebf0da1b5 by Jonas Devlieghere
[lldb] Fix TypeError: argument of type 'NoneType' is not iterable

Check if we have an apple_sdk before checking if it contains "internal".
The file was modifiedlldb/packages/Python/lldbsuite/test/builders/darwin.py
Commit 196204c72c68a577c72af95d70f18e3550939a5e by pklausler
[flang] Fix usage & catch errors for MAX/MIN with keyword= arguments

Max(), MIN(), and their specific variants are defined with an unlimited
number of dummy arguments named A1=, A2=, &c. whose names are almost never
used in practice but should be allowed for and properly checked for the
usual errors when they do appear.  The intrinsic table's entries otherwise
have fixed numbers of dummy argument definitions, so add some special
case handling in a few spots for MAX/MIN/&c. checking and procedure
characteristics construction.

Differential Revision: https://reviews.llvm.org/D114750
The file was addedflang/test/Semantics/call23.f90
The file was modifiedflang/lib/Evaluate/intrinsics.cpp
The file was modifiedflang/test/Evaluate/folding01.f90
Commit d1326a3b10054dd89be46f51f857d009cf8ae14f by Jonas Devlieghere
[lldb] Fix broken skipUnlessUndefinedBehaviorSanitizer decorator

727bd89b605b broke the UBSan decorator. The decorator compiles a custom
source code snippet that exposes UB and verifies the presence of a UBSan
symbol in the generated binary. The aforementioned commit broke both by
compiling a snippet without UB and discarding the result.
The file was modifiedlldb/packages/Python/lldbsuite/test/decorators.py
Commit 3ad0c6b75ea503e0a5bf2faaad9a34da0a020de0 by elizabeth.andrews
[clang-repl][NFC] Fix calling convention mismatch in test

Test failed on x86 platforms due to a calling convention mismatch
when member function was called like a free function. In this patch,
member function is marked static to address this.
The file was modifiedclang/unittests/Interpreter/InterpreterTest.cpp
Commit cbd445e4a331114752093746e9d596dafb8580b8 by pklausler
[flang] Re-fold bounds expressions in DATA implied DO loops

To accommodate triangular implied DO loops in DATA statements, in which
the bounds of nested implied DO loops might depend on the values of the
indices of outer implied DO loops in the same DATA statement set, it
is necessary to run them through constant folding each time they are
encountered.

Differential Revision: https://reviews.llvm.org/D114754
The file was modifiedflang/lib/Semantics/data-to-inits.cpp