SuccessChanges

Summary

  1. [RISCV] Replace custom isel code for RISCVISD::READ_CYCLE_WIDE with isel pattern (details)
  2. [flang] Implement derived type description table encoding (details)
  3. [mlir] Async: Add numWorkerThreads argument to createAsyncParallelForPass (details)
  4. [lld-macho][nfc] Move some methods from InputFile to ObjFile (details)
  5. [lld-macho] Support parsing of bitcode within archives (details)
  6. DenseMap: fix build with clang in C++20 mode (details)
  7. [AArch64][GlobalISel] Don't explicitly write to the zero register in emitCMN (details)
  8. [AArch64][GlobalISel] Fold binops on the true side of G_SELECT (details)
  9. [libc++] Add std::hash<char8_t> specialization if char8_t is enabled (details)
  10. [DFSan] Add several math functions to ABI list. (details)
  11. [AArch64][GlobalISel] Fold G_SELECT cc, %t, (G_ADD %x, 1) -> CSINC %t, %x, cc (details)
  12. [clangd] ExpandAutoType: Do not offer code action on lambdas. (details)
  13. [flang][openacc] Add missing loop construct restriction and validity tests (details)
  14. [PPC] Fixing a typo in altivec.h. Commenting out an unnecessary macro (details)
  15. [RISCV] When parsing vsetvli in the assembler, use StringRef::getAsInteger instead of APInt's string constructor (details)
  16. [RISCV] Detect more errors when parsing vsetvli in the assembler (details)
  17. [gn build] Move ScalarizeMaskedMemIntrin.cpp (details)
  18. [flang][openacc] Update reference to OpenACC 3.1 specification (details)
  19. [cmake] Make ExecutionEngine/Orc/Shared depend on intrinsics_gen to fix modules build (details)
  20. [llvm-lto2] Use NPM with ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER (details)
  21. [DebugInfo] Add handling of stringLengthExp operand of DIStringType. (details)
Commit 3e86fbc97189366866aac4286fb9c412c1fb526c by craig.topper
[RISCV] Replace custom isel code for RISCVISD::READ_CYCLE_WIDE with isel pattern

This node returns 2 results and uses a chain. As long as we use a DAG as part of the pseudo instruction definition where we can use the "set" operator, it looks like tablegen can handle use a pattern for this without a problem. I believe the original implementation was copied from PowerPC.

This also fixes the pseudo instruction so that it is marked as having side effects to match the definition of CSRRS and the RV64 instruction. And we don't need to explicitly clear mayLoad/mayStore since those can be inferred now.

Differential Revision: https://reviews.llvm.org/D92786
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfo.td
The file was modifiedllvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
Commit 4fede8bc8a015477f2a8feeb30a1d2a2e155106d by pklausler
[flang] Implement derived type description table encoding

Define Fortran derived types that describe the characteristics
of derived types, and instantiations of parameterized derived
types, that are of relevance to the runtime language support
library.  Define a suite of corresponding C++ structure types
for the runtime library to use to interpret instances of the
descriptions.

Create instances of these description types in Semantics as
static initializers for compiler-created objects in the scopes
that define or instantiate user derived types.

Delete obsolete code from earlier attempts to package runtime
type information.

Differential Revision: https://reviews.llvm.org/D92802
The file was addedflang/module/__fortran_type_info.f90
The file was modifiedflang/include/flang/Semantics/scope.h
The file was removedflang/runtime/derived-type.h
The file was addedflang/include/flang/Semantics/runtime-type-info.h
The file was modifiedflang/runtime/descriptor.h
The file was addedflang/runtime/type-info.h
The file was addedflang/test/Semantics/typeinfo01.f90
The file was modifiedflang/runtime/CMakeLists.txt
The file was removedflang/runtime/derived-type.cpp
The file was modifiedflang/runtime/allocatable.h
The file was modifiedflang/runtime/descriptor.cpp
The file was modifiedflang/tools/f18/f18.cpp
The file was modifiedflang/tools/f18/CMakeLists.txt
The file was addedflang/runtime/derived.h
The file was modifiedflang/runtime/allocatable.cpp
The file was modifiedflang/lib/Semantics/CMakeLists.txt
The file was modifiedflang/lib/Semantics/tools.cpp
The file was addedflang/lib/Semantics/runtime-type-info.cpp
The file was addedflang/runtime/derived.cpp
The file was modifiedflang/lib/Semantics/semantics.cpp
The file was modifiedflang/lib/Semantics/compute-offsets.cpp
The file was modifiedflang/docs/RuntimeTypeInfo.md
The file was modifiedflang/module/__fortran_builtins.f90
The file was modifiedflang/module/iso_c_binding.f90
The file was modifiedflang/runtime/transformational.cpp
Commit 94e645f9cce8fba26b4aec069103794f1779065f by ezhulenev
[mlir] Async: Add numWorkerThreads argument to createAsyncParallelForPass

Add an option to pass the number of worker threads to select the number of async regions for parallel for transformation.
```
std::unique_ptr<OperationPass<FuncOp>> createAsyncParallelForPass(int numWorkerThreads);
```

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D92835
The file was modifiedmlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
The file was modifiedmlir/include/mlir/Dialect/Async/Passes.h
Commit 7b007ac0800babe750c58b1aead15e1c3e7f3b0f by jezng
[lld-macho][nfc] Move some methods from InputFile to ObjFile

Additionally:
1. Move the helper functions in InputSection.h below the definition of
   `InputSection`, so the important stuff is on top
2. Remove unnecessary `explicit`

Reviewed By: #lld-macho, compnerd

Differential Revision: https://reviews.llvm.org/D92453
The file was modifiedlld/MachO/InputSection.cpp
The file was modifiedlld/MachO/InputFiles.h
The file was modifiedlld/MachO/InputSection.h
The file was modifiedlld/MachO/InputFiles.cpp
Commit 78976bf3dae2a4fac3b7fb2ab1a8d8e986ea36ff by jezng
[lld-macho] Support parsing of bitcode within archives

Also error out if we find anything other than an object or bitcode file
in the archive.

Note that we were previously inserting the symbols and sections of the
unpacked ObjFile into the containing ArchiveFile. This was actually
unnecessary -- we can just insert the ObjectFile (or BitcodeFile) into
the `inputFiles` vector. This is the approach taken by LLD-ELF.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D92539
The file was addedlld/test/MachO/lto-archive.ll
The file was modifiedlld/MachO/InputFiles.cpp
The file was addedlld/test/MachO/invalid/bad-archive-member.s
The file was addedlld/test/MachO/bitcode-nodatalayout.ll
Commit 3c01af9aeebe01030e6138cece02675d2f148bb3 by nunoplopes
DenseMap: fix build with clang in C++20 mode
clang was complaing about this code:
llvm/include/llvm/IR/PassManager.h:715:17: error: ISO C++20 considers use of overloaded operator '!=' to be ambiguous despite there being a unique best viable function with non-reversed arguments [-Werror,-Wambiguous-reversed-operator]
      if (IMapI != IsResultInvalidated.end())
          ~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~
llvm/include/llvm/ADT/DenseMap.h:1253:8: note: candidate function with non-reversed arguments
  bool operator!=(const ConstIterator &RHS) const {
       ^
llvm/include/llvm/ADT/DenseMap.h:1246:8: note: ambiguous candidate function with reversed arguments
  bool operator==(const ConstIterator &RHS) const {
       ^

The warning is triggered when the DenseMapIterator (lhs) is not const and so
the == operator is applied to different types on lhs/rhs.
Using a template allows the function to be available for both const/non-const
iterator types and gets rid of the warning
The file was modifiedllvm/include/llvm/ADT/DenseMap.h
Commit ce199667f65bcddc31c8c4be2b723f9132815fe6 by Jessica Paquette
[AArch64][GlobalISel] Don't explicitly write to the zero register in emitCMN

This case was missed in 78ccb0359d8da3269636d85933dd8afe50a2211f.

Differential Revision: https://reviews.llvm.org/D92438
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/opt-fold-compare.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
Commit cd9a52b99e685e8a77dd85d25c7d1ec8b86b9f55 by Jessica Paquette
[AArch64][GlobalISel] Fold binops on the true side of G_SELECT

This implements the following folds:

```
G_SELECT cc, (G_SUB 0, %x), %false -> CSNEG %x, %false, inv_cc
G_SELECT cc, (G_XOR x, -1), %false -> CSINV %x, %false, inv_cc
```

This is similar to the folds introduced in
5bc0bd05e6a8d788e08cdf3d154f3a33202aee53.

In 5bc0bd05e6a8d788e08cdf3d154f3a33202aee53 I mentioned that we may prefer to do
this in AArch64PostLegalizerLowering.

I think that it's probably better to do this in the selector. The way we select
G_SELECT depends on what register banks end up being assigned to it. If we did
this in AArch64PostLegalizerLowering, then we'd end up checking *every* G_SELECT
to see if it's worth swapping operands. Doing it in the selector allows us to
restrict the optimization to only relevant G_SELECTs.

Also fix up some comments in `TryFoldBinOpIntoSelect` which are kind of
confusing IMO.

Example IR: https://godbolt.org/z/3qPGca

Differential Revision: https://reviews.llvm.org/D92860
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-select.mir
Commit b526d8761895643cb42e62997240344420d65e0f by Louis Dionne
[libc++] Add std::hash<char8_t> specialization if char8_t is enabled

Differential Revision: https://reviews.llvm.org/D92325
The file was modifiedlibcxx/include/functional
The file was modifiedlibcxx/include/utility
Commit 3bd2ad5a0828e956400393e3ea153c417f256aab by mascasa
[DFSan] Add several math functions to ABI list.

These are all straightforward functional entries.

Reviewed By: stephan.yichao.zhao

Differential Revision: https://reviews.llvm.org/D92791
The file was modifiedcompiler-rt/lib/dfsan/done_abilist.txt
Commit 5b5d3fa9d9cf9e0b8904de0dc9ea5248f6a37ed1 by Jessica Paquette
[AArch64][GlobalISel] Fold G_SELECT cc, %t, (G_ADD %x, 1) -> CSINC %t, %x, cc

This implements

```
G_SELECT cc, %true, (G_ADD %x, 1) -> CSINC %true, %x, cc
G_SELECT cc, (G_ADD %x, 1), %false -> CSINC %x, %false, inv_cc
```

Godbolt example: https://godbolt.org/z/eoPqKq

Differential Revision: https://reviews.llvm.org/D92868
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-select.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
Commit 3c5bed734f9e02bd3bc4fbd1e0acc53506823ebf by adamcz
[clangd] ExpandAutoType: Do not offer code action on lambdas.

We can't expand lambda types anyway. Now we simply not offer the code
action instead of showing it and then returning an error in apply().

Differential Revision: https://reviews.llvm.org/D92847
The file was modifiedclang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp
The file was modifiedclang-tools-extra/clangd/test/check-fail.test
The file was modifiedclang-tools-extra/clangd/unittests/TweakTests.cpp
Commit c823d74914a287e056eb311ce293e7d4a521eb25 by clementval
[flang][openacc] Add missing loop construct restriction and validity tests

Add restriction on loop construct associated with DO CONCURRENT. Add couple of tests to ensure
clause validity checks.

Reviewed By: sameeranjoshi

Differential Revision: https://reviews.llvm.org/D92533
The file was modifiedflang/test/Semantics/acc-clause-validity.f90
The file was modifiedflang/test/Semantics/acc-canonicalization-validity.f90
The file was modifiedflang/lib/Semantics/canonicalize-acc.cpp
Commit fc750f609dfb2fd51b6810cc55058568dfe4b3a9 by msd.ataei
[PPC] Fixing a typo in altivec.h. Commenting out an unnecessary macro
The file was modifiedclang/lib/Headers/altivec.h
Commit 88e58939dcea54d59a77277d420a014dc90b06e7 by craig.topper
[RISCV] When parsing vsetvli in the assembler, use StringRef::getAsInteger instead of APInt's string constructor

APInt's string constructor asserts on error. Since this is the parser and we don't yet know if the string is a valid integer we shouldn't use that.

Instead use StringRef::getAsInteger which returns a bool to indicate success or failure.

Since we no longer need APInt, use 'unsigned' instead.

Differential Revision: https://reviews.llvm.org/D92801
The file was modifiedllvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
The file was modifiedllvm/test/MC/RISCV/rvv/invalid.s
Commit fb5b611af917f02337b69727fb8082e1ea3b22d5 by craig.topper
[RISCV] Detect more errors when parsing vsetvli in the assembler

-Reject an "mf1" lmul
-Make sure tail agnostic is exactly "tu" or "ta" not just that it starts with "tu" or "ta"
-Make sure mask agnostic is exactly "mu" or "ma" not just that it starts with "mu" or "ma"

Differential Revision: https://reviews.llvm.org/D92805
The file was modifiedllvm/test/MC/RISCV/rvv/invalid.s
The file was modifiedllvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
Commit bf30d7de7632a9b71761e6e2186aee7353a2960e by aeubanks
[gn build] Move ScalarizeMaskedMemIntrin.cpp
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Transforms/Scalar/BUILD.gn
The file was modifiedllvm/utils/gn/secondary/llvm/lib/CodeGen/BUILD.gn
Commit d553243fe4b5e1992c07aff7b54b16160a4d5e97 by clementval
[flang][openacc] Update reference to OpenACC 3.1 specification

Update all reference from the specification to the new OpenACC 3.1
document.

Reviewed By: SouraVX

Differential Revision: https://reviews.llvm.org/D92120
The file was modifiedflang/tools/f18/f18.cpp
The file was modifiedflang/lib/Parser/openacc-parsers.cpp
The file was modifiedmlir/include/mlir/Dialect/OpenACC/OpenACC.h
The file was modifiedflang/include/flang/Parser/parse-tree.h
The file was modifiedmlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
The file was modifiedllvm/include/llvm/Frontend/OpenACC/ACC.td
The file was modifiedflang/lib/Semantics/check-acc-structure.cpp
The file was modifiedflang/lib/Semantics/check-acc-structure.h
Commit a2c157eb3ebc5ed7e8037f7942991bd344a882cc by Raphael Isemann
[cmake] Make ExecutionEngine/Orc/Shared depend on intrinsics_gen to fix modules build

The LLVM_ENABLE_MODULES builds currently randomly fail due depending on the
headers generated by the intrinsics_gen target, but the current dependency only model
the non-modules dependencies:

```
While building module 'LLVM_ExecutionEngine' imported from llvm-project/llvm/lib/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.cpp:13:
While building module 'LLVM_intrinsic_gen' imported from llvm-project/llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h:17:
In file included from <module-includes>:1:
In file included from llvm-project/llvm/include/llvm/IR/Argument.h:18:
llvm/include/llvm/IR/Attributes.h:75:14: fatal error: 'llvm/IR/Attributes.inc' file not found
    #include "llvm/IR/Attributes.inc"
             ^~~~~~~~~~~~~~~~~~~~~~~~
```

Depending on whether intrinsics_gen runs before compiling Orc/Shared files we either fail or include an outdated Attributes.inc
in module builds. The Clang modules require these additional dependencies as including/importing one module requires all
includes headers by that module to be parsable.

Differential Revision: https://reviews.llvm.org/D92873
The file was modifiedllvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt
Commit dee1e6ac42e6e25e639fb053831f0723b90c18bd by aeubanks
[llvm-lto2] Use NPM with ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D92870
The file was modifiedllvm/tools/llvm-lto2/llvm-lto2.cpp
Commit 1f67247eea13f62f26de3b0eca3755ed8b3a2b8e by chih-ping.chen
[DebugInfo] Add handling of stringLengthExp operand of DIStringType.

This patch makes DWARF writer emit DW_AT_string_length using
the stringLengthExp operand of DIStringType.

This is part of the effort to add debug info support for
Fortran deferred length strings.

Also updated the tests to exercise the change.

Differential Revision: https://reviews.llvm.org/D92412
The file was modifiedllvm/test/DebugInfo/fortran-string-type.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
The file was modifiedllvm/test/DebugInfo/X86/distringtype.ll