UnstableChanges

Summary

  1. [SelectionDAG][AArch64] Restrict matchUnaryPredicate to only handle SPLAT_VECTOR for scalable vectors. (details)
  2. [RISCV] Add support for fixed vector mask logic operations. (details)
  3. [DAG] PromoteIntRes_ADDSUBSHLSAT - promote ISD::UADDSAT as clamped add (details)
  4. [mlir] Simplify ModuleTranslation for LLVM IR (details)
  5. [OpenMP] Implement '#pragma omp tile', by Michael Kruse (@Meinersbur). (details)
  6. [SystemZ][ZOS] Prefer -nostdlib++ as opposed to -nodefaultlibs when building c++ libraries (details)
  7. Revert "[AArch64][GlobalISel] Fold constants into G_GLOBAL_VALUE" (details)
  8. libunwind: Don't attempt to authenticate a null return address. (details)
  9. [SampleFDO][NFC] Refactor SampleProfile.cpp (details)
  10. [RISCV] Add add/sub saturation tests that exist on ARM/AArch64/X86 (details)
  11. [clangd] Treat paths case-insensitively depending on the platform (details)
  12. [FileCollector] Fix that the file system case-sensitivity check was inverted (details)
  13. [gn build] Port 310b35304cdf (details)
  14. [gn build] Port ecea7218fb9b (details)
  15. [clangd] Fix windows buildbots after ecea7218fb9b994b26471e9877851cdb51a5f1d4 (details)
Commit 064ada4ec6bb4cb77d809ba366c90ca59e95d4ba by craig.topper
[SelectionDAG][AArch64] Restrict matchUnaryPredicate to only handle SPLAT_VECTOR for scalable vectors.

fde24661718c7812a20a10e518cd853e8e060107 added support for
scalable vectors to matchUnaryPredicate by handling SPLAT_VECTOR in
addition to BUILD_VECTOR. This was used to enabled UDIV/SDIV/UREM/SREM
by constant expansion in BuildUDIV/BuildSDIV in TargetLowering.cpp

The caller there expects to call getBuildVector from the match factors.
This leads to a crash right now if there is a SPLAT_VECTOR of
fixed vectors since the number of vectors won't match the number
of elements.

To fix this, this patch updates the callers to check the opcode
instead of whether the type is fixed or scalable. This assumes
that only 3 opcodes are handled by matchUnaryPredicate so
I've added an assertion to the final else to check that opcode.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D96174
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/sve-fixed-length-int-div.ll
Commit 07ca13fe0766ded6fd69a6729275020e6b4c0b1b by craig.topper
[RISCV] Add support for fixed vector mask logic operations.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D96741
The file was addedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-mask-logic.ll
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.h
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
Commit df45c1813509fc579c5e0a4f2824923db92c2dbb by llvm-dev
[DAG] PromoteIntRes_ADDSUBSHLSAT - promote ISD::UADDSAT as clamped add

Similar to D96622, we're better off just promoting uaddsat(x,y) -> umin(add(x,y),c) instead of trying to perform a shifted uaddsat.

I initially tried to just use shifted promotion in cases where we didn't have a legal/custom umin - but we don't appear to have any targets that have uaddsat but not umin, so imo we're better off always using the umin and avoid an untested shifted uaddsat code path.

Differential Revision: https://reviews.llvm.org/D96767
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
The file was modifiedllvm/test/CodeGen/X86/uadd_sat_vec.ll
The file was modifiedllvm/test/CodeGen/AArch64/uadd_sat_vec.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/uaddsat.ll
Commit ce8f10d6cbe03c1a78a7938070654d363e25f27d by zinenko
[mlir] Simplify ModuleTranslation for LLVM IR

A series of preceding patches changed the mechanism for translating MLIR to
LLVM IR to use dialect interface with delayed registration. It is no longer
necessary for specific dialects to derive from ModuleTranslation. Remove all
virtual methods from ModuleTranslation and factor out the entry point to be a
free function.

Also perform some cleanups in ModuleTranslation internals.

Depends On D96774

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D96775
The file was modifiedmlir/examples/toy/Ch6/toyc.cpp
The file was modifiedmlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
The file was modifiedmlir/tools/mlir-rocm-runner/mlir-rocm-runner.cpp
The file was modifiedmlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
The file was modifiedmlir/include/mlir/Target/LLVMIR.h
The file was modifiedmlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
The file was modifiedmlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
The file was addedmlir/include/mlir/Target/LLVMIR/Export.h
The file was modifiedmlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
The file was modifiedmlir/tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp
The file was modifiedmlir/examples/toy/Ch7/toyc.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
Commit 6c05005238a805a699d9dec39a61971affd1cab4 by a.bataev
[OpenMP] Implement '#pragma omp tile', by Michael Kruse (@Meinersbur).

The tile directive is in OpenMP's Technical Report 8 and foreseeably will be part of the upcoming OpenMP 5.1 standard.

This implementation is based on an AST transformation providing a de-sugared loop nest. This makes it simple to forward the de-sugared transformation to loop associated directives taking the tiled loops. In contrast to other loop associated directives, the OMPTileDirective does not use CapturedStmts. Letting loop associated directives consume loops from different capture context would be difficult.

A significant amount of code generation logic is taking place in the Sema class. Eventually, I would prefer if these would move into the CodeGen component such that we could make use of the OpenMPIRBuilder, together with flang. Only expressions converting between the language's iteration variable and the logical iteration space need to take place in the semantic analyzer: Getting the of iterations (e.g. the overload resolution of `std::distance`) and converting the logical iteration number to the iteration variable (e.g. overload resolution of `iteration + .omp.iv`). In clang, only CXXForRangeStmt is also represented by its de-sugared components. However, OpenMP loop are not defined as syntatic sugar. Starting with an AST-based approach allows us to gradually move generated AST statements into CodeGen, instead all at once.

I would also like to refactor `checkOpenMPLoop` into its functionalities in a follow-up. In this patch it is used twice. Once for checking proper nesting and emitting diagnostics, and additionally for deriving the logical iteration space per-loop (instead of for the loop nest).

Differential Revision: https://reviews.llvm.org/D76342
The file was modifiedclang/include/clang/AST/OpenMPClause.h
The file was modifiedclang/lib/Sema/TreeTransform.h
The file was modifiedclang/tools/libclang/CIndex.cpp
The file was modifiedclang/include/clang/Serialization/ASTBitCodes.h
The file was modifiedclang/include/clang-c/Index.h
The file was modifiedclang/lib/Serialization/ASTReader.cpp
The file was addedclang/test/Index/openmp-tile.c
The file was modifiedclang/lib/AST/StmtProfile.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/tools/libclang/CXCursor.cpp
The file was modifiedclang/include/clang/Basic/OpenMPKinds.h
The file was modifiedclang/lib/AST/StmtPrinter.cpp
The file was modifiedclang/lib/CodeGen/CGOpenMPRuntime.cpp
The file was modifiedclang/lib/Basic/OpenMPKinds.cpp
The file was modifiedclang/include/clang/Basic/StmtNodes.td
The file was modifiedclang/include/clang/Basic/DiagnosticCommonKinds.td
The file was modifiedclang/lib/CodeGen/CodeGenFunction.h
The file was addedclang/test/OpenMP/tile_messages.cpp
The file was modifiedclang/lib/AST/StmtOpenMP.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/ExprEngine.cpp
The file was addedclang/test/OpenMP/tile_codegen.cpp
The file was modifiedclang/include/clang/AST/StmtOpenMP.h
The file was modifiedclang/include/clang/Parse/Parser.h
The file was modifiedclang/lib/AST/OpenMPClause.cpp
The file was addedclang/test/OpenMP/tile_ast_print.cpp
The file was modifiedllvm/include/llvm/Frontend/OpenMP/OMP.td
The file was modifiedclang/include/clang/AST/RecursiveASTVisitor.h
The file was modifiedclang/lib/CodeGen/CGStmtOpenMP.cpp
The file was modifiedclang/lib/Parse/ParseOpenMP.cpp
The file was modifiedclang/lib/Serialization/ASTReaderStmt.cpp
The file was modifiedclang/lib/CodeGen/CGStmt.cpp
The file was modifiedclang/lib/Serialization/ASTWriterStmt.cpp
The file was modifiedclang/lib/Serialization/ASTWriter.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/lib/Sema/SemaExceptionSpec.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
Commit 5f9be2c3e37c0428ba56876dd84af04b8d9d8915 by zibi
[SystemZ][ZOS] Prefer -nostdlib++ as opposed to -nodefaultlibs when building c++ libraries

Let's use -nostdlib++ rather than -nodefaultlibs when building libc++/libc++abi/libunwind libraries. The default is -nostdlib++ if supported by a build compiler like it is the case with clang, otherwise -nodefaultlibs is used as before.

This change is needed to avoid additional changes at the link step and not to increase the maintenance costs. If clang with -nodefaultlibs is used all the libraries which are removed but required would have to be manually added in. This set of libraries are unique and will send out.

The propose change will allow to make the link step simple for other platforms as well.

Reviewed By: #libc, #libc_abi, ldionne

Differential Revision: https://reviews.llvm.org/D95875
The file was modifiedlibcxx/cmake/config-ix.cmake
The file was modifiedlibcxxabi/src/CMakeLists.txt
The file was modifiedlibunwind/cmake/config-ix.cmake
The file was modifiedlibcxxabi/cmake/config-ix.cmake
The file was modifiedlibcxx/CMakeLists.txt
The file was modifiedlibunwind/src/CMakeLists.txt
Commit 962b73dd0fc3906980e597f72a35eee7121cc5e2 by Jessica Paquette
Revert "[AArch64][GlobalISel] Fold constants into G_GLOBAL_VALUE"

This reverts commit 61b4702a408834228c1c139b0e9af98616774db4.

We were seeing some test failures in SPECINT2006 due to this change. Reverting
to investigate.
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-global-pic.mir
The file was modifiedllvm/test/CodeGen/AArch64/fold-global-offsets.ll
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was removedllvm/test/CodeGen/AArch64/GlobalISel/fold-global-offsets.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-global.mir
The file was removedllvm/test/CodeGen/AArch64/GlobalISel/fold-global-offsets-target-features.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-store.mir
The file was removedllvm/test/CodeGen/AArch64/GlobalISel/select-gv-with-offset.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
The file was removedllvm/test/CodeGen/AArch64/GlobalISel/select-add-low.mir
Commit cddc53ef088b68586094c9841a76b41bee3994a4 by peter
libunwind: Don't attempt to authenticate a null return address.

Null return addresses can appear at the bottom of the stack (i.e. the
frame corresponding to the entry point). Authenticating these addresses
will set the error code in the address, which will lead to a segfault
in the sigreturn trampoline detection code. Fix this problem by not
authenticating null addresses.

Differential Revision: https://reviews.llvm.org/D96560
The file was modifiedlibunwind/src/DwarfInstructions.hpp
Commit 310b35304cdf5a230c042904655583c5532d3e91 by xur
[SampleFDO][NFC] Refactor SampleProfile.cpp

Refactor SampleProfile.cpp to use the core code in CodeGen.
The main changes are:
(1) Move SampleProfileLoaderBaseImpl class to a header file.
(2) Split SampleCoverageTracker to a head file and a cpp file.
(3) Move the common codes (common options and callsiteIsHot())
to the common cpp file.

Differential Revision: https://reviews.llvm.org/D96455
The file was addedllvm/include/llvm/ProfileData/SampleProfileLoaderBaseUtil.h
The file was addedllvm/lib/ProfileData/SampleProfileLoaderBaseUtil.cpp
The file was modifiedllvm/lib/ProfileData/CMakeLists.txt
The file was addedllvm/include/llvm/ProfileData/SampleProfileLoaderBaseImpl.h
The file was modifiedllvm/lib/Transforms/IPO/SampleProfile.cpp
Commit acfab44eebbeccb41f9fd3c2c363ff61f02dbf76 by craig.topper
[RISCV] Add add/sub saturation tests that exist on ARM/AArch64/X86

There have been some recent changes to the type legalization for
some of these intrinsics so I thought it would be good to have
coverage.
The file was addedllvm/test/CodeGen/RISCV/usub_sat_plus.ll
The file was addedllvm/test/CodeGen/RISCV/uadd_sat.ll
The file was addedllvm/test/CodeGen/RISCV/uadd_sat_plus.ll
The file was addedllvm/test/CodeGen/RISCV/ssub_sat_plus.ll
The file was addedllvm/test/CodeGen/RISCV/sadd_sat.ll
The file was addedllvm/test/CodeGen/RISCV/sadd_sat_plus.ll
The file was addedllvm/test/CodeGen/RISCV/ssub_sat.ll
The file was addedllvm/test/CodeGen/RISCV/usub_sat.ll
Commit ecea7218fb9b994b26471e9877851cdb51a5f1d4 by kadircet
[clangd] Treat paths case-insensitively depending on the platform

Path{Match,Exclude} and MountPoint were checking paths case-sensitively
on all platforms, as with other features, this was causing problems on
windows. Since users can have capital drive letters on config files, but
editors might lower-case them.

This patch addresses that issue by:
- Creating regexes with case-insensitive matching on those platforms.
- Introducing a new pathIsAncestor helper, which performs checks in a
  case-correct manner where needed.

Differential Revision: https://reviews.llvm.org/D96690
The file was modifiedclang-tools-extra/clangd/ConfigCompile.cpp
The file was addedclang-tools-extra/clangd/unittests/support/PathTests.cpp
The file was modifiedclang-tools-extra/clangd/support/Path.h
The file was modifiedclang-tools-extra/clangd/unittests/CMakeLists.txt
The file was modifiedclang-tools-extra/clangd/unittests/ConfigCompileTests.cpp
The file was modifiedclang-tools-extra/clangd/support/Path.cpp
The file was modifiedclang-tools-extra/clangd/unittests/RenameTests.cpp
Commit f88b502d9bc7c2d7db8db340d5b98fc7f46eba9c by Raphael Isemann
[FileCollector] Fix that the file system case-sensitivity check was inverted

real_path returns an `std::error_code` which evaluates to `true` in case an
error happens and `false` if not. This code was checking the inverse, so
case-insensitive file systems ended up being detected as case sensitive.

Tested using an LLDB reproducer test as we anyway need a real file system and
also some matching logic to detect whether the respective file system is
case-sensitive (which the test is doing via some Python checks that we can't
really emulate with the usual FileCheck logic).

Fixes rdar://67003004

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D96795
The file was addedlldb/test/API/functionalities/reproducers/fs-case-sensitivity/TestReproducerFSCaseSensitivity.py
The file was modifiedllvm/lib/Support/FileCollector.cpp
Commit abb7570235bd69d2d7ca50633989fb3e77fe1e5b by llvmgnsyncbot
[gn build] Port 310b35304cdf
The file was modifiedllvm/utils/gn/secondary/llvm/lib/ProfileData/BUILD.gn
Commit f350fe8c55a6cfe45a7a419337fe2f3dfafd9495 by llvmgnsyncbot
[gn build] Port ecea7218fb9b
The file was modifiedllvm/utils/gn/secondary/clang-tools-extra/clangd/unittests/BUILD.gn
Commit cdef5a7161767c2c4b3b7cb2542cf1d29b6d4a09 by kadircet
[clangd] Fix windows buildbots after ecea7218fb9b994b26471e9877851cdb51a5f1d4
The file was modifiedclang-tools-extra/clangd/unittests/support/PathTests.cpp
The file was modifiedclang-tools-extra/clangd/support/Path.cpp