SuccessChanges

Summary

  1. [libc++] [test] Fix some GCC 11 errors/warnings in these tests. NFCI. (details)
  2. [mlir][linalg][python] Adapt the OpDSL to use scalars. (details)
  3. [mlir] separable registration of attribute and type interfaces (details)
  4. [mlir] Add SignOp to complex dialect. (details)
  5. [llvm-exegesis] Fix X86LbrCounter destructor to correctly unmap memory and not double-close fd (PR50620) (details)
  6. [ARM] Rejig some of the MVE gather/scatter lowering pass. NFC (details)
  7. [libc] Add a set of elementary operations (details)
  8. [mlir] Avoid GCC naming conflict. (details)
  9. [libcxx][atomic] Fix failure mapping in compare_exchange_{strong,weak}. (details)
  10. Revert "[libc] Add a set of elementary operations" (details)
  11. [flang] [openmp] Add Fortran specific semantic check 4 for OpenMP Allocate directive. (details)
  12. Work around MSVC compiler intricacies. (details)
  13. [mlir][linalg] Adapt yaml codegen to support scalar parameters. (details)
  14. [IROutliner] Adding DebugInfo handling for IR Outlined Functions (details)
  15. [ARM] Use rq gather/scatters for smaller v4 vectors (details)
  16. DirectoryWatcher: close a possible window of race on Windows (details)
Commit 389e749c42307ae589f84c79cceb175e6c9b510b by arthur.j.odwyer
[libc++] [test] Fix some GCC 11 errors/warnings in these tests. NFCI.

Differential Revision: https://reviews.llvm.org/D104228
The file was addedlibcxx/test/std/ranges/range.access/range.access.end/end.pass.cpp
The file was modifiedlibcxx/test/std/ranges/range.access/range.access.begin/begin.pass.cpp
The file was removedlibcxx/test/std/ranges/range.access/range.access.end/end.cpp
The file was modifiedlibcxx/test/std/strings/string.view/string.view.ops/copy.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/random_access_iterator.compile.pass.cpp
The file was modifiedlibcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/deduct.pass.cpp
The file was modifiedlibcxx/test/std/ranges/range.adaptors/range.all.pass.cpp
The file was modifiedlibcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp
The file was modifiedlibcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.random.access/contiguous_iterator.compile.pass.cpp
The file was modifiedlibcxx/test/std/ranges/range.utility/range.subrange/subrange_test_types.h
Commit 662f9bff337b99819301113fc8634eb5123b9e23 by gysit
[mlir][linalg][python] Adapt the OpDSL to use scalars.

The patch replaces the existing capture functionality by scalar operands that have been introduced by https://reviews.llvm.org/D104109. Scalar operands behave as tensor operands except for the fact that they are not indexed. As a result ScalarDefs can be accessed directly as no indexing expression is needed.

The patch only updates the OpDSL. The C++ side is updated by a follow up patch.

Differential Revision: https://reviews.llvm.org/D104220
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/lang/dsl.py
The file was modifiedmlir/test/python/dialects/linalg/opdsl/arguments.py
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/lang/config.py
The file was modifiedmlir/test/python/dialects/linalg/opsrun.py
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/lang/comprehension.py
The file was modifiedmlir/test/python/dialects/linalg/opdsl/assignments.py
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/ops/core_named_ops.py
The file was modifiedmlir/test/python/dialects/linalg/opdsl/emit_structured_generic.py
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/lang/emitter.py
The file was modifiedmlir/python/mlir/dialects/linalg/opdsl/lang/scalar_expr.py
Commit 9b2a1bcf6fbe79cfa3725cfd654f45cce0375d3b by zinenko
[mlir] separable registration of attribute and type interfaces

It may be desirable to provide an interface implementation for an attribute or
a type without modifying the definition of said attribute or type. Notably,
this allows to implement interfaces for attributes and types outside of the
dialect that defines them and, in particular, provide interfaces for built-in
types. Provide the mechanism to do so.

Currently, separable registration requires the attribute or type to have been
registered with the context, i.e. for the dialect containing the attribute or
type to be loaded. This can be relaxed in the future using a mechanism similar
to delayed dialect interface registration.

See https://llvm.discourse.group/t/rfc-separable-attribute-type-interfaces/3637

Depends On D104233

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D104234
The file was modifiedmlir/include/mlir/IR/StorageUniquerSupport.h
The file was addedmlir/unittests/IR/InterfaceAttachmentTest.cpp
The file was modifiedmlir/include/mlir/IR/TypeSupport.h
The file was modifiedmlir/include/mlir/IR/Attributes.h
The file was modifiedmlir/tools/mlir-tblgen/OpInterfacesGen.cpp
The file was modifiedmlir/include/mlir/Support/InterfaceSupport.h
The file was modifiedmlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
The file was modifiedmlir/lib/IR/MLIRContext.cpp
The file was modifiedmlir/unittests/IR/CMakeLists.txt
The file was modifiedmlir/test/lib/Dialect/Test/TestAttributes.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestAttributes.h
The file was modifiedmlir/test/lib/Dialect/Test/CMakeLists.txt
The file was modifiedmlir/docs/Interfaces.md
The file was modifiedmlir/test/lib/Dialect/Test/TestInterfaces.td
The file was modifiedmlir/include/mlir/IR/AttributeSupport.h
The file was modifiedmlir/include/mlir/IR/Types.h
Commit f112bd61ebf315b563fdd3dae947f0c67d02a6cc by akuegel
[mlir] Add SignOp to complex dialect.

Also add a conversion pattern from Complex Dialect to Standard/Math Dialect.

Differential Revision: https://reviews.llvm.org/D104292
The file was modifiedmlir/test/Conversion/ComplexToStandard/convert-to-standard.mlir
The file was modifiedmlir/include/mlir/Dialect/Complex/IR/ComplexOps.td
The file was modifiedmlir/lib/Conversion/ComplexToStandard/ComplexToStandard.cpp
Commit 941188e9653463bc269ecb43e87ec22c63a4a02b by llvm-dev
[llvm-exegesis] Fix X86LbrCounter destructor to correctly unmap memory and not double-close fd (PR50620)

As was reported on PR50620, the X86LbrCounter destructor was double-closing the filedescriptor and not unmapping the buffer.

Differential Revision: https://reviews.llvm.org/D104201
The file was modifiedllvm/tools/llvm-exegesis/lib/X86/X86Counter.cpp
Commit 09924cbab78016d793c15ece5762faff3756c0cf by david.green
[ARM] Rejig some of the MVE gather/scatter lowering pass. NFC

This adjusts some of how the gather/scatter lowering pass passes around
data and where certain gathers/scatters are created from. It should not
effect code generation on its own, but allows other patches to more
clearly reason about the code.

A number of extra test cases were also added for smaller gathers/
scatters that can be extended, and some of the test comments were
updated.
The file was modifiedllvm/test/CodeGen/Thumb2/mve-scatter-ind16-scaled.ll
The file was modifiedllvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-scatter-ind8-unscaled.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-scatter-ind16-unscaled.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-scatter-ptrs.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-gather-ptrs.ll
Commit 8387187c2ffe0bef0696edfffab00cd7d0ee3e6e by gchatelet
[libc] Add a set of elementary operations

Resubmission of D100646 now making sure that we handle cases were `__builtin_memcpy_inline` is not available.

Original commit message:
Each of these elementary operations can be assembled to support higher order constructs (Overlapping access, Loop, Aligned Loop).
The patch does not compile yet as it depends on other ones (D100571, D100631) but it allows to get the conversation started.

A self-contained version of this code is available at https://godbolt.org/z/e1x6xdaxM
The file was modifiedlibc/src/string/CMakeLists.txt
The file was addedlibc/src/string/memory_utils/elements.h
The file was addedlibc/test/src/string/memory_utils/elements_test.cpp
The file was addedlibc/test/src/string/memory_utils/memory_access_test.cpp
The file was modifiedlibc/src/string/memory_utils/CMakeLists.txt
The file was removedlibc/src/string/memory_utils/memcpy_utils.h
The file was modifiedlibc/src/string/memory_utils/memset_utils.h
The file was modifiedlibc/test/src/string/memory_utils/CMakeLists.txt
The file was removedlibc/test/src/string/memory_utils/memcpy_utils_test.cpp
The file was addedlibc/src/string/memory_utils/elements_x86.h
The file was modifiedlibc/src/string/aarch64/memcpy.cpp
The file was modifiedlibc/src/string/memcpy.cpp
The file was modifiedlibc/src/string/x86_64/memcpy.cpp
Commit e893708aac04ece90fd85681c289f1a3b09b52e5 by gysit
[mlir] Avoid GCC naming conflict.

Rename AbstractType to AbstractTy to avoid a GCC naming conflict after https://reviews.llvm.org/D104234.

Differential Revision: https://reviews.llvm.org/D104297
The file was modifiedmlir/include/mlir/IR/Types.h
The file was modifiedmlir/include/mlir/IR/Attributes.h
The file was modifiedmlir/include/mlir/IR/StorageUniquerSupport.h
Commit 6d33362dafb66b3af4717990d9a06450ec13f367 by rupprecht
[libcxx][atomic] Fix failure mapping in compare_exchange_{strong,weak}.

https://eel.is/c++draft/atomics.types.operations#23 says: ... the value of failure is order except that a value of `memory_order::acq_rel` shall be replaced by the value `memory_order::acquire` and a value of `memory_order::release` shall be replaced by the value `memory_order::relaxed`.

This failure mapping is only handled for `_LIBCPP_HAS_GCC_ATOMIC_IMP`. We are seeing bad code generation for `compare_exchange_strong(cmp, 1, std::memory_order_acq_rel)` when using libc++ in place of libstdc++: https://godbolt.org/z/v3onrrq4G.

This was caught by tsan tests after D99434, `[TSAN] Honor failure memory orders in AtomicCAS`, but appears to be an issue in non-tsan code.

Reviewed By: ldionne, dvyukov

Differential Revision: https://reviews.llvm.org/D103846
The file was modifiedlibcxx/include/atomic
The file was addedlibcxx/test/std/atomics/atomics.general/replace_failure_order_codegen.sh.cpp
Commit 2e286f233e58da0aec4504ed83286fc7dcef0e3e by gchatelet
Revert "[libc] Add a set of elementary operations"

This reverts commit 8387187c2ffe0bef0696edfffab00cd7d0ee3e6e.
The file was modifiedlibc/src/string/aarch64/memcpy.cpp
The file was modifiedlibc/test/src/string/memory_utils/CMakeLists.txt
The file was modifiedlibc/src/string/x86_64/memcpy.cpp
The file was modifiedlibc/src/string/memory_utils/memset_utils.h
The file was removedlibc/test/src/string/memory_utils/elements_test.cpp
The file was addedlibc/src/string/memory_utils/memcpy_utils.h
The file was addedlibc/test/src/string/memory_utils/memcpy_utils_test.cpp
The file was removedlibc/test/src/string/memory_utils/memory_access_test.cpp
The file was modifiedlibc/src/string/memcpy.cpp
The file was modifiedlibc/src/string/memory_utils/CMakeLists.txt
The file was removedlibc/src/string/memory_utils/elements_x86.h
The file was removedlibc/src/string/memory_utils/elements.h
The file was modifiedlibc/src/string/CMakeLists.txt
Commit 80ea006ef9e08364854394b633b904fa85e38e4e by isaac.perry
[flang] [openmp] Add Fortran specific semantic check 4 for OpenMP Allocate directive.

This patch adds the 4th Fortran specific semantic check for the OpenMP
allocate directive: "If a list item has the SAVE attribute, is a common
block name, or is declared in the scope of a module, then only predefined
memory allocator parameters can be used in the allocator clause".

Code in this patch was based on code from https://reviews.llvm.org/D93549/new/.

Differential Revision: https://reviews.llvm.org/D102400
The file was modifiedflang/lib/Semantics/check-omp-structure.h
The file was addedflang/test/Semantics/omp-allocate08.f90
The file was modifiedflang/include/flang/Semantics/tools.h
The file was modifiedflang/lib/Semantics/check-omp-structure.cpp
Commit 073e7a08e83ab61198e6b9e106369e876a5b7509 by Adrian Prantl
Work around MSVC compiler intricacies.
The file was modifiedlldb/include/lldb/Utility/Timer.h
Commit ff2ef4d684821c373e989105ac51eeeca9c2027e by gysit
[mlir][linalg] Adapt yaml codegen to support scalar parameters.

The patch updates the C++ yaml code generation to support scalar operands as added in https://reviews.llvm.org/D104220.

Differential Revision: https://reviews.llvm.org/D104224
The file was modifiedmlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
The file was modifiedmlir/test/python/dialects/linalg/opsrun.py
The file was modifiedmlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
The file was modifiedmlir/test/Dialect/Linalg/generalize-named-polymorphic-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgNamedStructuredOps.yaml
The file was modifiedmlir/docs/Tools/LinalgOpDsl.md
Commit 2c21278e7471d24bcdb1c8ea2bf1440cb2fa3a4a by andrew.litteken
[IROutliner] Adding DebugInfo handling for IR Outlined Functions

This adds support for functions outlined by the IR Outliner to be
recognized by the debugger.  The expected behavior is that it will
skip over the instructions included in that section.  This is due to the
fact that we can not say which of the original locations the
instructions originated from.

These functions will show up in the call stack, but you cannot step
through them.

Reviewers: paquette, vsk, djtodoro

Differential Revision: https://reviews.llvm.org/D87302
The file was modifiedllvm/test/Transforms/IROutliner/legal-debug.ll
The file was addedllvm/test/DebugInfo/AArch64/ir-outliner.ll
The file was modifiedllvm/lib/Transforms/IPO/IROutliner.cpp
Commit 680d3f8f1785adcb128d8727234631fe866acb04 by david.green
[ARM] Use rq gather/scatters for smaller v4 vectors

A pointer will always fit into an i32, so a rq offset gather/scatter can
be used with v4i8 and v4i16 gathers, using a base of 0 and the Ptr as
the offsets. The rq gather can then correctly extend the type, allowing
us to use the gathers without falling back to scalarizing.

This patch rejigs tryCreateMaskedGatherOffset in the
MVEGatherScatterLowering pass to decompose the Ptr into Base:0 +
Offset:Ptr (with a scale of 1), if the Ptr could not be decomposed from
a GEP. v4i32 gathers will already use qi gathers, this extends that to
v4i8 and v4i16 gathers using the extending rq variants.

Differential Revision: https://reviews.llvm.org/D103674
The file was modifiedllvm/test/CodeGen/Thumb2/mve-scatter-ind32-scaled.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-gather-ptrs.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-scatter-ptrs.ll
The file was modifiedllvm/lib/Target/ARM/MVEGatherScatterLowering.cpp
Commit a6948da86ad7e78d66b26263c2681ef6385cc234 by Saleem Abdulrasool
DirectoryWatcher: close a possible window of race on Windows

The initial scan occurring before the watcher is ready allows a race
condition where a change occurs before the initial scan completes.
Ensure that we wait for the watcher to begin executing the initial scan.

Addresses some feedback from Adrian McCarthy in post-commit review.
The file was modifiedclang/lib/DirectoryWatcher/windows/DirectoryWatcher-windows.cpp