SuccessChanges

Summary

  1. [sparse][mlir] simplify lattice optimization logic (details)
  2. [libunwind] unw_* alias fixes for ELF and Mach-O (details)
  3. [MacroExpansionContext] Fix a warning. (details)
  4. [lldb] Reinstate support for LLDB_VERSION_STRING (details)
  5. [GlobalISel] Implement narrowScalar for UADDO/USUBO (details)
  6. [GlobalISel] Implement narrowScalar for SADDO/SSUBO (details)
  7. [GlobalISel] Implement narrowScalar for SADDE/SSUBE/UADDE/USUBE (details)
  8. [AArch64][GlobalISel] Make overflow legalization use clampScalar (details)
  9. [Test][AArch64] Test SADDE/SSUBE/UADDE/USUBE narrowing legalization (details)
  10. Revert "[AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt" (details)
  11. [mlir][IR] Refactor the `getChecked` and `verifyConstructionInvariants` methods on Attributes/Types (details)
  12. [lldb] add check for libcxx runtime (details)
  13. [obj2yaml,yaml2obj] Add NumBlocks to the BBAddrMapEntry yaml field. (details)
  14. [dfsan] Propagate origins at non-memory/phi/call instructions (details)
  15. Changes to mktime to handle invalid dates, overflow and underflow andcalculating the correct date and thenumber of seconds even if invalid datesare passed as arguments. (details)
  16. [GVN] Fix a typo in comment (details)
  17. [mlir][pdl] Fix bug when ordering predicates (details)
  18. [mlir][pdl][NFC] Extract the execution of each bytecode operation into its own function (details)
  19. [libc] [Obvious] Fix. (details)
Commit 0df59f234bf09dac203b98427f366be97288f636 by ajcbik
[sparse][mlir] simplify lattice optimization logic

Simplifies the way lattices are optimized with less, but more
powerful rules. This also fixes an inaccuracy where too many
lattices resulted (expecting a non-existing universal index).
Also puts no-side-effects on all proper getters and unifies
bufferization flags order in integration tests (for future,
more complex use cases).

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D97134
The file was modifiedmlir/test/Dialect/Linalg/sparse_1d.mlir
The file was modifiedmlir/integration_test/Sparse/CPU/sparse_sum.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgSparseOps.td
The file was modifiedmlir/integration_test/Sparse/CPU/sparse_sampled_matmul.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Sparsification.cpp
Commit 729899f7b6bf6aff65988d895d7a639391a67608 by rprichard
[libunwind] unw_* alias fixes for ELF and Mach-O

Rename the CMake option, LIBUNWIND_HERMETIC_STATIC_LIBRARY, to
LIBUNWIND_HIDE_SYMBOLS. Rename the C macro define,
_LIBUNWIND_DISABLE_VISIBILITY_ANNOTATIONS, to _LIBUNWIND_HIDE_SYMBOLS,
because now the macro adds a .hidden directive rather than merely
suppress visibility annotations.

For ELF, when LIBUNWIND_HIDE_SYMBOLS is enabled, mark unw_getcontext as
hidden. This symbol is the only one defined using src/assembly.h's
WEAK_ALIAS macro. Other unw_* weak aliases are defined in C++ and are
already hidden.

Mach-O doesn't support weak aliases, so remove .weak_reference and
weak_import. When LIBUNWIND_HIDE_SYMBOLS is enabled, output
.private_extern for the unw_* aliases.

In assembly.h, add missing SYMBOL_NAME macro invocations, which are
used to prefix symbol names with '_' on some targets.

Fixes PR46709.

Reviewed By: #libunwind, phosek, compnerd, steven_wu

Differential Revision: https://reviews.llvm.org/D93003
The file was modifiedlibunwind/src/CMakeLists.txt
The file was modifiedlibunwind/CMakeLists.txt
The file was modifiedclang/cmake/caches/Fuchsia-stage2.cmake
The file was modifiedlibunwind/src/config.h
The file was modifiedlibunwind/src/assembly.h
The file was modifiedllvm/utils/gn/secondary/libunwind/src/BUILD.gn
Commit 7c83799fd838df3ed00ead500997168ed3f1bd17 by kazu
[MacroExpansionContext] Fix a warning.

This patch fixes:

  error: private field 'PP' is not used [-Werror,-Wunused-private-field]
The file was modifiedclang/lib/Analysis/MacroExpansionContext.cpp
Commit 5d2850161e8cc14254a615911b0277d0050575d6 by Jonas Devlieghere
[lldb] Reinstate support for LLDB_VERSION_STRING

Reinstate support for specifying -DLLDB_VERSION_STRING="best-lldb"
which seems to have gotten accidentally removed in the past.

rdar://38983903

Differential revision: https://reviews.llvm.org/D97235
The file was modifiedlldb/source/lldb.cpp
Commit c63b33b7926187750e844cf12d6ca8d172e1bb37 by code
[GlobalISel] Implement narrowScalar for UADDO/USUBO

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D96671
The file was modifiedllvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Commit e1532649cb2af05991b62fe177e19f9c8ce212de by code
[GlobalISel] Implement narrowScalar for SADDO/SSUBO

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D96672
The file was modifiedllvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Commit 8f956a5e8f5a64064ba62d0c503d80f5dc44564a by code
[GlobalISel] Implement narrowScalar for SADDE/SSUBE/UADDE/USUBE

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D96673
The file was modifiedllvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Commit 8b10aa67ad5c97ece9ddb699adeae1ae85a5b28d by code
[AArch64][GlobalISel] Make overflow legalization use clampScalar

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D96674
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-usubo.mir
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-uaddo.mir
Commit 0596086242b2b80c084d3e0e8d755fb4a6c75ef3 by code
[Test][AArch64] Test SADDE/SSUBE/UADDE/USUBE narrowing legalization

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D96676
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-usube.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-ssube.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-uadde.mir
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/legalize-sadde.mir
Commit 662402a8b30dc96139bfdd9e37d6d92111659e77 by Jessica Paquette
Revert "[AArch64][GlobalISel] Match G_SHUFFLE_VECTOR -> insert elt + extract elt"

This reverts commit 867e379c0e14527eb7aa68485a10324693e35f5d.

For some reason this is upsetting Linux/Windows bots. Reverting while I try to
reproduce.
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td
The file was removedllvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-lowering-shuf-to-ins.mir
Commit 06e25d56451977ef5b7052282faacfe3d42acb65 by riddleriver
[mlir][IR] Refactor the `getChecked` and `verifyConstructionInvariants` methods on Attributes/Types

`verifyConstructionInvariants` is intended to allow for verifying the invariants of an attribute/type on construction, and `getChecked` is intended to enable more graceful error handling aside from an assert. There are a few problems with the current implementation of these methods:
* `verifyConstructionInvariants` requires an mlir::Location for emitting errors, which is prohibitively costly in the situations that would most likely use them, e.g. the parser.
This creates an unfortunate code duplication between the verifier code and the parser code, given that the parser operates on llvm::SMLoc and it is an undesirable overhead to pre-emptively convert from that to an mlir::Location.
* `getChecked` effectively requires duplicating the definition of the `get` method, creating a quite clunky workflow due to the subtle different in its signature.

This revision aims to talk the above problems by refactoring the implementation to use a callback for error emission. Using a callback allows for deferring the costly part of error emission until it is actually necessary.

Due to the necessary signature change in each instance of these methods, this revision also takes this opportunity to cleanup the definition of these methods by:
* restructuring the signature of `getChecked` such that it can be generated from the same code block as the `get` method.
* renaming `verifyConstructionInvariants` to `verify` to match the naming scheme of the rest of the compiler.

Differential Revision: https://reviews.llvm.org/D97100
The file was modifiedmlir/lib/Dialect/Quant/Utils/FakeQuantSupport.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestTypes.cpp
The file was modifiedmlir/lib/CAPI/IR/BuiltinAttributes.cpp
The file was modifiedmlir/include/mlir/Dialect/Async/IR/AsyncTypes.td
The file was modifiedmlir/include/mlir-c/BuiltinTypes.h
The file was modifiedmlir/include/mlir/IR/BuiltinTypes.h
The file was modifiedmlir/lib/IR/BuiltinTypes.cpp
The file was modifiedmlir/docs/Tutorials/DefiningAttributesAndTypes.md
The file was modifiedmlir/include/mlir/IR/Types.h
The file was modifiedmlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
The file was modifiedflang/include/flang/Optimizer/Dialect/FIRTypes.td
The file was modifiedmlir/lib/CAPI/IR/BuiltinTypes.cpp
The file was modifiedmlir/lib/Dialect/Quant/IR/QuantTypes.cpp
The file was modifiedmlir/test/mlir-tblgen/typedefs.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/IR/SPIRVTypes.h
The file was modifiedmlir/include/mlir/Dialect/SPIRV/IR/SPIRVAttributes.h
The file was modifiedmlir/include/mlir/IR/StorageUniquerSupport.h
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/include/mlir/TableGen/TypeDef.h
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
The file was modifiedmlir/lib/IR/MLIRContext.cpp
The file was modifiedflang/include/flang/Optimizer/Dialect/FIRType.h
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMTypeSyntax.cpp
The file was modifiedmlir/include/mlir-c/BuiltinAttributes.h
The file was modifiedmlir/include/mlir/Dialect/Quant/QuantTypes.h
The file was modifiedmlir/lib/Bindings/Python/IRModules.cpp
The file was modifiedmlir/lib/Dialect/Quant/IR/TypeParser.cpp
The file was modifiedflang/lib/Optimizer/Dialect/FIRType.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestTypeDefs.td
The file was modifiedmlir/tools/mlir-tblgen/TypeDefGen.cpp
The file was modifiedmlir/docs/OpDefinitions.md
The file was modifiedmlir/include/mlir/IR/BuiltinTypes.td
The file was modifiedmlir/lib/TableGen/TypeDef.cpp
The file was modifiedmlir/include/mlir/IR/BuiltinAttributes.h
The file was modifiedmlir/lib/Parser/DialectSymbolParser.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/IR/SPIRVAttributes.cpp
The file was modifiedmlir/lib/IR/BuiltinAttributes.cpp
Commit 389955c69a3b9f418e3f39694c94b4519322dd42 by smeenai
[lldb] add check for libcxx runtime

When enabling LLDB tests with `LLVM_ENABLE_RUNTIMES=libcxx` CMake will
fail with:

```
LLDB test suite requires libc++, but it is currently disabled.
```

The issue is that the targets in LLVM_ENABLE_RUNTIMES are configured
after the targets in LLVM_ENABLE_PROJECTS, so at this point the check
for the `cxx` target will fail. CMake will add a dependency for a target
that does not exist yet however, so by first checking for `libcxx` in
LLVM_ENABLE_RUNTIMES we ensure that the `cxx` target will be present at
build time.

Tested with:
```
% cmake -G Ninja \
    -C ~/local/llvm-project/lldb/cmake/caches/Apple-lldb-macOS.cmake \
    -DLLVM_ENABLE_PROJECTS="clang;lldb" -DLLVM_ENABLE_RUNTIMES="libcxx" \
    -DLIBCXX_INCLUDE_TESTS=NO ~/local/llvm-project/llvm
% ninja check-lldb
```

Reviewed By: smeenai, JDevlieghere

Differential Revision: https://reviews.llvm.org/D97227
The file was modifiedlldb/test/CMakeLists.txt
Commit 9f527086609ee52122c5495830979a0af0dbc121 by rahmanl
[obj2yaml,yaml2obj] Add NumBlocks to the BBAddrMapEntry yaml field.

As discussed in D95511, this allows us to encode invalid BBAddrMap
sections to be used in more rigorous testing.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D96831
The file was modifiedllvm/lib/ObjectYAML/ELFYAML.cpp
The file was modifiedllvm/tools/obj2yaml/elf2yaml.cpp
The file was modifiedllvm/test/tools/obj2yaml/ELF/bb-addr-map.yaml
The file was modifiedllvm/lib/ObjectYAML/ELFEmitter.cpp
Commit 7424efd5ad57d18de65e1a5e572a04e1348a7e04 by jianzhouzh
[dfsan] Propagate origins at non-memory/phi/call instructions

This is a part of https://reviews.llvm.org/D95835.

Reviewed-by: morehouse

Differential Revision: https://reviews.llvm.org/D97200
The file was addedllvm/test/Instrumentation/DataFlowSanitizer/origin_other_ops.ll
The file was modifiedllvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
The file was addedllvm/test/Instrumentation/DataFlowSanitizer/origin_select.ll
Commit 034f5629256c810ecf4805911e3fe407e562f3b7 by rtenneti
Changes to mktime to handle invalid dates, overflow and underflow andcalculating the correct date and thenumber of seconds even if invalid datesare passed as arguments.

Added tests for invalid dates like the following
  Date 1970-01-01 00:00:-1 is treated as 1969-12-31 23:59:59 and seconds
  are returned for the modified date.

Tested the code by doing ninja check-libc (and cmake).

Reviewed By: sivachandra, rtenneti

Differential Revision: https://reviews.llvm.org/D96684
The file was modifiedlibc/src/time/CMakeLists.txt
The file was modifiedlibc/src/time/mktime.cpp
The file was addedlibc/src/time/time_utils.h
The file was addedlibc/test/src/time/TmMatcher.h
The file was modifiedlibc/test/src/time/CMakeLists.txt
The file was modifiedlibc/test/src/time/mktime_test.cpp
Commit 4125cabce1374209843393d1e9474efea58cbeaf by 18738953+ksyx
[GVN] Fix a typo in comment

NFC.

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

Reviewed By: fhahn
The file was modifiedllvm/lib/Transforms/Scalar/GVN.cpp
Commit ddd556f10e382e64003c98fa9308ce1860cc2ad6 by riddleriver
[mlir][pdl] Fix bug when ordering predicates

We should be ordering predicates with higher primary/secondary sums first, but we are currently ordering them last. This allows for predicates more frequently encountered to be checked first.

Differential Revision: https://reviews.llvm.org/D95715
The file was modifiedmlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp
The file was modifiedmlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-matcher.mlir
Commit 154cabe722de4d9837d49790e913d2b511f17d70 by riddleriver
[mlir][pdl][NFC] Extract the execution of each bytecode operation into its own function

This makes the implementation of each bytecode operation much easier to reason about, and lets the compiler decide which implementations are beneficial to inline into the main switch.

Differential Revision: https://reviews.llvm.org/D95716
The file was modifiedmlir/lib/Rewrite/ByteCode.cpp
Commit 80bea4a0d58178e3077bc320282d4cdf07e9c1ca by rtenneti
[libc] [Obvious] Fix.
The file was modifiedlibc/src/time/mktime.cpp
The file was modifiedlibc/src/time/time_utils.h