Changes

Summary

  1. [flang][fir] Add support to mangle/deconstruct namelist group name (details)
  2. [mlir:OpAsm] Factor out the common bits of (Op/Dialect)Asm(Parser/Printer) (details)
  3. [IR] Handle large element size when calculating GEP indices (details)
  4. [SystemZ][z/OS] Introduce the GOFFMCAsmInfo Interface for z/OS (details)
  5. [ORC] Add 'contains' and 'overlaps' operations to ExecutorAddrRange. (details)
  6. [gn build] Port a9ae2436fc0d (details)
  7. [gn build] Port c0d889995e70 (details)
  8. [AMDGPU] Limit promote alloca max size in functions (details)
  9. [llvm-profgen] Ignore invalid perf line in LBR record (details)
  10. [mlir] Create a generic reduction detection utility (details)
  11. [AutoFDO][llvm-profgen] Profile generation for LBR(non-CS) sample (details)
  12. [mlir][tosa] Do not fold transpose with quantized types (details)
  13. [AutoFDO][llvm-profgen] Report zero count for unexecuted part of function code (details)
  14. [llvm-profgen] Unify output format of different unsymbolized profiles (details)
  15. [dsymutil] Track incompleteness across unions (details)
  16. WIP: Verify -gsimple-template-names=mangled values (details)
  17. [ORC] Allow construction of an ExecutorAddrRange from an addr and a size. (details)
  18. [lldb] Copy the system debugserver in LLDB.framework (details)
  19. [dsymutil] Update union-fwd-decl.test for Windows (details)
  20. [RISCV] Add another isel optimization for (and (shl X, c2), c1). (details)
  21. Fixed a bug in https://reviews.llvm.org/rG8eb617d719bdc6a4ed7773925d2421b9bbdd4b7a. (details)
  22. Add "REQUIRES: zlib" in forward-compatible.test since it handles compressed file. (details)
  23. [llvm] Improve export.sh with help and snapshot (details)
  24. Revert "[Driver] Correctly handle static C++ standard library" (details)
  25. [llvm] Remove LLVM_CHECK_ENABLED_PROJECTS again (details)
Commit 62cc6b0da2912d770c125fc9ea0949f3a7b75fb9 by clementval
[flang][fir] Add support to mangle/deconstruct namelist group name

Add support to create unique name for namelist group and be able to
deconstruct them.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
The file was modifiedflang/include/flang/Optimizer/Support/InternalNames.h
The file was modifiedflang/lib/Lower/Mangler.cpp
The file was modifiedflang/unittests/Optimizer/InternalNamesTest.cpp
The file was modifiedflang/lib/Optimizer/Support/InternalNames.cpp
Commit 531206310a27477f088f672f5e6fd688d77d9292 by riddleriver
[mlir:OpAsm] Factor out the common bits of (Op/Dialect)Asm(Parser/Printer)

This has a few benefits:
* It allows for defining parsers/printer code blocks that
  can be shared between operations and attribute/types.
* It removes the weird duplication of generic parser/printer hooks,
  which means that newly added hooks only require touching one class.

Differential Revision: https://reviews.llvm.org/D110375
The file was modifiedmlir/lib/IR/Dialect.cpp
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/lib/Parser/DialectSymbolParser.cpp
The file was addedmlir/lib/Parser/AsmParserImpl.h
The file was modifiedmlir/include/mlir/IR/DialectImplementation.h
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
Commit 5969e5743ae9cd17d08436a4b1139b8c4a24cc4d by nikita.ppv
[IR] Handle large element size when calculating GEP indices

This is a fix for the issue reported at
https://reviews.llvm.org/D110043#3019942:
The ElementSize is a uint64_t and as such may be larger than the
index space, or be negative in the index space. This is UB, but
shouldn't cause assertion failures.

We address this by detecting whether the size is too large and
use a zero index in that case (which is always conservatively
correct).

Differential Revision: https://reviews.llvm.org/D110437
The file was addedllvm/test/Transforms/GlobalOpt/large-element-size.ll
The file was modifiedllvm/lib/IR/DataLayout.cpp
Commit a9ae2436fc0dcb68ef8a478948e46d0a9998b0c9 by anirudh_prasad
[SystemZ][z/OS] Introduce the GOFFMCAsmInfo Interface for z/OS

- This patch adds in the GOFFMCAsmInfo interfaces for the z/OS target.
- This patch decouples the previously existing SystemZMCAsmInfo interface for the ELF target and the z/OS target.
- This patch also removes a small test in the SystemZAsmLexerTest.cpp. The reason for this is because, the test is set up for the s390x-ibm-linux (SystemZ ELF triple), and the test checks a function which is overridden only for the z/OS target. The reason we can't change the test to use a z/OS triple outright is because there is still missing support which prevents the successful running of a test (assert in AsmParser.cpp due to missing GOFFAsmParser support)

Reviewed By: uweigand, abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D110077
The file was modifiedllvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.h
The file was modifiedllvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp
The file was addedllvm/include/llvm/MC/MCAsmInfoGOFF.h
The file was modifiedllvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
The file was modifiedllvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp
The file was addedllvm/lib/MC/MCAsmInfoGOFF.cpp
The file was modifiedllvm/lib/MC/CMakeLists.txt
Commit c0d889995e708f8bcb0fd688f63d031ee06b5874 by Lang Hames
[ORC] Add 'contains' and 'overlaps' operations to ExecutorAddrRange.

Also includes unit tests for not-yet tested operations like comparison and
to/from pointer conversion.
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
The file was addedllvm/unittests/ExecutionEngine/Orc/ExecutorAddressTest.cpp
The file was modifiedllvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
Commit 5f9802401145a56d16c5712bf25b0a3894e68cb2 by llvmgnsyncbot
[gn build] Port a9ae2436fc0d
The file was modifiedllvm/utils/gn/secondary/llvm/lib/MC/BUILD.gn
Commit 70a48697d5f547ca72053b5dcf0d10756f6f2477 by llvmgnsyncbot
[gn build] Port c0d889995e70
The file was modifiedllvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
Commit cf74ef134c9a8089d8997144d54628952c6d4552 by Stanislav.Mekhanoshin
[AMDGPU] Limit promote alloca max size in functions

Non-entry functions have 32 caller saved VGPRs available. If we
promote alloca to consume more registers we will have to spill
CSRs. There is no reason to eliminate scratch access to get
another scratch access instead.

Differential Revision: https://reviews.llvm.org/D110372
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/vector-alloca-limits.ll
Commit a7cdcf25c17e169eedba276791299c3b2b78fbf1 by wlei
[llvm-profgen] Ignore invalid perf line in LBR record

Similar to https://reviews.llvm.org/D109637, there is a whole invalid line of message in perfscript.

```
warning: Invalid address in LBR record at line 14118674: Processed 14138923 events and lost 1 chunks!
warning: Invalid address in LBR record at line 14118676: Check IO/CPU overload!
```

This only happened for LBR only perfscript, hybridperfscript have a check of " 0x" to make sure it's the LBR perf line.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D110424
The file was modifiedllvm/test/tools/llvm-profgen/Inputs/noprobe.perfscript
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
Commit 2a876a711dc7c644936017daf20e78f48bfd2270 by diegocaballero
[mlir] Create a generic reduction detection utility

This patch introduces a generic reduction detection utility that works
across different dialecs. It is mostly a generalization of the reduction
detection algorithm in Affine. The reduction detection logic in Affine,
Linalg and SCFToOpenMP have been replaced with this new generic utility.

The utility takes some basic components of the potential reduction and
returns: 1) the reduced value, and 2) a list with the combiner operations.
The logic to match reductions involving multiple combiner operations disabled
until we can properly test it.

Reviewed By: ftynse, bondhugula, nicolasvasilache, pifon2a

Differential Revision: https://reviews.llvm.org/D110303
The file was modifiedutils/bazel/llvm-project-overlay/mlir/BUILD.bazel
The file was modifiedmlir/include/mlir/IR/Diagnostics.h
The file was modifiedmlir/lib/IR/Diagnostics.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was modifiedmlir/tools/mlir-opt/mlir-opt.cpp
The file was modifiedmlir/include/mlir/Analysis/LoopAnalysis.h
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
The file was modifiedmlir/lib/Analysis/AffineAnalysis.cpp
The file was modifiedmlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp
The file was addedmlir/test/lib/Analysis/TestMatchReduction.cpp
The file was addedmlir/test/Analysis/test-match-reduction.mlir
The file was modifiedmlir/lib/Conversion/SCFToOpenMP/CMakeLists.txt
The file was modifiedmlir/test/lib/Analysis/CMakeLists.txt
Commit d5f2013004ef8d2d9995fd45a154744bf7c264e9 by wlei
[AutoFDO][llvm-profgen] Profile generation for LBR(non-CS) sample

This patch introduces non-CS AutoFDO profile generation into LLVM. The profile is supposed to be well consumed by compiler using `-fprofile-sample-use=[profile]`.

After range and branch counters are extracted from the LBR sample, here we go through each addresses for symbolization, create FunctionSamples and populate its sub fields like TotalSamples, BodySamples and HeadSamples etc. For inlined code, as we need to map back to original code, so we always add body samples to the leaf frame's function sample.

Reviewed By: wenlei, hoy

Differential Revision: https://reviews.llvm.org/D109551
The file was removedllvm/test/tools/llvm-profgen/noprobe.test
The file was modifiedllvm/tools/llvm-profgen/ProfileGenerator.h
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
The file was addedllvm/test/tools/llvm-profgen/inline-noprobe.test
The file was addedllvm/test/tools/llvm-profgen/Inputs/inline-noprobe2.perfscript
The file was addedllvm/test/tools/llvm-profgen/noinline-noprobe.test
The file was addedllvm/test/tools/llvm-profgen/Inputs/inline-noprobe.perfbin
The file was modifiedllvm/tools/llvm-profgen/ProfileGenerator.cpp
The file was addedllvm/test/tools/llvm-profgen/Inputs/inline-noprobe2.perfbin
The file was modifiedllvm/tools/llvm-profgen/llvm-profgen.cpp
The file was addedllvm/test/tools/llvm-profgen/inline-noprobe2.test
The file was addedllvm/test/tools/llvm-profgen/Inputs/inline-noprobe.perfscript
Commit b45476c94ce8ea94e2ad4d93ceda00eb4078e682 by antiagainst
[mlir][tosa] Do not fold transpose with quantized types

For such cases, the type of the constant DenseElementsAttr is
different from the transpose op return type.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D110446
The file was modifiedmlir/lib/Dialect/Tosa/IR/TosaOps.cpp
The file was modifiedmlir/test/Dialect/Tosa/canonicalize.mlir
Commit 28277e9b48601dee7027ba6ed50554db821ba09b by wlei
[AutoFDO][llvm-profgen] Report zero count for unexecuted part of function code

In order to be consistent with compiler that interprets zero count as unexecuted(cold), this change reports zero-value count for unexecuted part of function code. For the implementation, it leverages the range counter, initializes all the executed function range with the zero-value. After all ranges are merged and converted into disjoint ranges, the remaining zero count will indicates the unexecuted(cold) part of the function.

This change also extends the current `findDisjointRanges` method which now can support adding zero-value range.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D109713
The file was modifiedllvm/test/tools/llvm-profgen/inline-noprobe2.test
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.cpp
The file was modifiedllvm/tools/llvm-profgen/ProfileGenerator.h
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.h
The file was modifiedllvm/test/tools/llvm-profgen/inline-noprobe.test
The file was modifiedllvm/tools/llvm-profgen/ProfileGenerator.cpp
Commit 1422fa5fab369b0ec223b58788c68f91a4093076 by wlei
[llvm-profgen] Unify output format of different unsymbolized profiles

Differential Revision: https://reviews.llvm.org/D110080
The file was modifiedllvm/test/tools/llvm-profgen/noinline-cs-pseudoprobe.test
The file was modifiedllvm/test/tools/llvm-profgen/noinline-cs-noprobe.test
The file was modifiedllvm/tools/llvm-profgen/PerfReader.cpp
The file was modifiedllvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test
The file was modifiedllvm/tools/llvm-profgen/PerfReader.h
The file was modifiedllvm/test/tools/llvm-profgen/inline-cs-noprobe.test
The file was modifiedllvm/test/tools/llvm-profgen/inline-cs-pseudoprobe.test
The file was modifiedllvm/test/tools/llvm-profgen/cs-interrupt.test
Commit 62d6ff5e9e70dd11a4e9e6efc48ce174cd6849bd by Jonas Devlieghere
[dsymutil] Track incompleteness across unions

When determining the incompleteness of a DIE based on its children, make
sure we propagate it across union types. See test case for an example.
Without this patch we never emit the definition of Container_ivars.

Differential revision: https://reviews.llvm.org/D110443
The file was addedllvm/test/tools/dsymutil/X86/union-fwd-decl.test
The file was addedllvm/test/tools/dsymutil/Inputs/private/tmp/union/use.o
The file was modifiedllvm/lib/DWARFLinker/DWARFLinker.cpp
The file was addedllvm/test/tools/dsymutil/Inputs/private/tmp/union/a.out
The file was addedllvm/test/tools/dsymutil/Inputs/private/tmp/union/container.o
Commit 9911af4b91c670477cf920f168b339bd2f3f307f by dblaikie
WIP: Verify -gsimple-template-names=mangled values

Clang will encode names that should be able to be simplified as
"_STNname|<template, args>" (eg: "_STNt1|<int>") - this verification
mode will detect these names, decode them, create the original name
("t1<int>") and the simple name ("t1") - letting the simple name run
through the usual rebuilding logic - then compare the two sources of the
full name - the rebuilt and the _STN encoding.

This helps ensure that -gsimple-template-names is lossless.
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
The file was modifiedllvm/lib/DebugInfo/DWARF/DWARFDie.cpp
The file was modifiedllvm/test/tools/llvm-dwarfdump/X86/prettyprint_types.s
Commit 37f1b7a3f35fd9edbb110a3845e79d46224ea79b by Lang Hames
[ORC] Allow construction of an ExecutorAddrRange from an addr and a size.
The file was modifiedllvm/unittests/ExecutionEngine/Orc/ExecutorAddressTest.cpp
The file was modifiedllvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h
Commit c6288759296f808a2f7304bbd1bd5b18974e4ccc by Jonas Devlieghere
[lldb] Copy the system debugserver in LLDB.framework

When using the system debugserver for testing, copy the binary in the
LLDB.framework Resource directory instead of the build's bin directory.

rdar://82998263
The file was modifiedlldb/test/API/CMakeLists.txt
Commit d0649320bf39efddf10a430c1821911060d684b2 by Jonas Devlieghere
[dsymutil] Update union-fwd-decl.test for Windows

Remove path separators from CHECK-lines in union-fwd-decl.test
The file was modifiedllvm/test/tools/dsymutil/X86/union-fwd-decl.test
Commit 715cf6ffb9a0491aa8749bf024d741de520fa1f2 by craig.topper
[RISCV] Add another isel optimization for (and (shl X, c2), c1).

Where c1 is a shifted mask with 32-c2 leading zeros and c3 trailing
zeros and c3>c2. We can select it as (slli (srliw X, c3-c2), c3).
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-bswap.ll
The file was modifiedllvm/test/CodeGen/RISCV/bswap-ctlz-cttz-ctpop.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rv64zbb.ll
The file was modifiedllvm/test/CodeGen/RISCV/rv64zbp.ll
Commit e8b376547b4b77671c36607ade025d3272699e7a by wmi
Fixed a bug in https://reviews.llvm.org/rG8eb617d719bdc6a4ed7773925d2421b9bbdd4b7a.

For compressed profile when reading an unknown section, the data reader pointer
adjustment was incorrect. This patch fixed that.
The file was modifiedllvm/include/llvm/ProfileData/SampleProfReader.h
The file was addedllvm/test/tools/llvm-profdata/Inputs/unknown.section.compressed.extbin.profdata
The file was modifiedllvm/test/tools/llvm-profdata/forward-compatible.test
Commit 80865f7579d619dee4ffd5abb72f641ef74dedbb by wmi
Add "REQUIRES: zlib" in forward-compatible.test since it handles compressed file.
The file was modifiedllvm/test/tools/llvm-profdata/forward-compatible.test
Commit 6deaebe5fe00bfb69d9d007bae95fac70779398a by kkleine
[llvm] Improve export.sh with help and snapshot

This change adds the ability to create source tarballs for unreleased or untagged code by providing the `--git-ref <GIT_REF>` flag to the `llvm/utils/release/export.sh` script. This is useful for creating daily snapshot tarballs that can easily be consumed by packagers who want to build a daily snapshot.

The default behavior of `export.sh` hasn't changed.

You may also provide a `--template` argument to say how the artifacts
are supposed to be named (as suggested by @hans).

The `-help` output of `export.sh` was changed quite significantly to look like this:

```
Export the Git sources and build tarballs from them.

Usage: export.sh [-release|--release <major>.<minor>.<patch>]
                      [-rc|--rc <num>]
                      [-final|--final]
                      [-git-ref|--git-ref <git-ref>]
                      [-template|--template <template>]

Flags:

  -release  | --release <major>.<minor>.<patch>    The version number of the release
  -rc       | --rc <num>                           The release candidate number
  -final    | --final                              When provided, this option will disable the rc flag
  -git-ref  | --git-ref <git-ref>                  (optional) Use <git-ref> to determine the release and don't export the test-suite files
  -template | --template <template>                (optional) Possible placeholders: $PROJECT $YYYYMMDD $GIT_REF $RELEASE $RC.
                                                   Defaults to '${PROJECT}-${RELEASE}${RC}.src.tar.xz'.

The following list shows the filenames (with <placeholders>) for the artifacts
that are being generated (given that you don't touch --template).

  * llvm-<RELEASE><RC>.src.tar.xz
  * clang-<RELEASE><RC>.src.tar.xz
  * compiler-rt-<RELEASE><RC>.src.tar.xz
  * libcxx-<RELEASE><RC>.src.tar.xz
  * libcxxabi-<RELEASE><RC>.src.tar.xz
  * libclc-<RELEASE><RC>.src.tar.xz
  * clang-tools-extra-<RELEASE><RC>.src.tar.xz
  * polly-<RELEASE><RC>.src.tar.xz
  * lldb-<RELEASE><RC>.src.tar.xz
  * lld-<RELEASE><RC>.src.tar.xz
  * openmp-<RELEASE><RC>.src.tar.xz
  * libunwind-<RELEASE><RC>.src.tar.xz
  * flang-<RELEASE><RC>.src.tar.xz

Additional files being generated:

  * llvm-project-<RELEASE><RC>.src.tar.xz    (the complete LLVM source project)
  * test-suite-<RELEASE><RC>.src.tar.xz      (only when not using --git-ref)

To ease the creation of snapshot builds, we also provide these files

  * llvm-release-<YYYYMMDD>.txt        (contains the <RELEASE> as a text)
  * llvm-rc-<YYYYMMDD>.txt             (contains the rc version passed to the invocation of export.sh)
  * llvm-git-revision-<YYYYMMDD>.txt   (contains the current git revision sha1)

Example values for the placeholders:

  * <RELEASE>  -> 13.0.0
  * <YYYYMMDD> -> 20210414
  * <RC>       -> rc4        (will be empty when using --git-ref)

In order to generate snapshots of the upstream main branch you could do this for example:

  export.sh --git-ref upstream/main --template '${PROJECT}-${YYYYMMDD}.src.tar.xz'

```

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D101446
The file was modifiedllvm/utils/release/export.sh
Commit 6ece82e9006d16b7fba7660ce09b2c62ab8460fa by thakis
Revert "[Driver] Correctly handle static C++ standard library"

This reverts commit 03142c5f67788bcc1573f76732d0fccd75c6b965.
Breaks check-asan if system ld doesn't support --push-state, even
if lld was built and is used according to lit's output.
See comments on https://reviews.llvm.org/D110128
The file was modifiedclang/lib/Driver/ToolChains/Fuchsia.cpp
The file was modifiedclang/test/Driver/fuchsia.cpp
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
The file was modifiedclang/test/Driver/linux-ld.c
Commit 4a45f95e7612bc5dd1d68db84df266cfcc62ff95 by thakis
[llvm] Remove LLVM_CHECK_ENABLED_PROJECTS again

This reverts commit 55f0b337087136554122f942fea951a357bc4a49 and
follow-up reverts commit e9ea03c62ccc1ed4e3ed4f20e37640cfdd76cbcf.

LLVM_EXTERNAL_PROJECTS is sufficient, see https://reviews.llvm.org/D110016
The file was modifiedllvm/cmake/modules/CrossCompile.cmake
The file was modifiedllvm/CMakeLists.txt