Changes

Summary

  1. [mlir] FlatAffineConstraint parsing for unit tests (details)
  2. [Driver] Default to libc++ on FreeBSD (details)
  3. [mlir][memref] Fix expanded shape ops memref.cast folding with changed type (details)
  4. [ELF] Simplify a condition with config->copyRelocs. NFC (details)
  5. [openmp][amdgpu] Make plugin robust to presence of explicit implicit arguments (details)
  6. [MachO] Fix struct size assertion (details)
  7. [flang] Remove typo that affected complex namelist input (details)
  8. [InstCombine] Enable fold select into operand for FAdd,  FMul, FSub and FDiv. (details)
  9. [formatters] Add a formatter for libstdc++ optional (details)
  10. [flang] Correct the argument keyword for AIMAG(Z=...) (details)
  11. Attempt to fix e3dea5cf0e326366ab95a49d167fde8b0816e292 (details)
  12. [mlir][linalg][bufferize][NFC] Clean up headers and function visibility (details)
  13. [mlir][linalg][bufferize][NFC] Remove special casing of CallOps (details)
  14. [mlir][linalg][bufferize][NFC] Move helper function to op interface (details)
  15. [mlir][linalg][bufferize] Limited support for scf.execute_region (details)
  16. [llvm] Use range-based for loops (NFC) (details)
  17. [mlir] Refactoring a few Parser APIs (details)
Commit f6718fc6d30219816a20235984e84db2e1f96fd8 by groverkss
[mlir] FlatAffineConstraint parsing for unit tests

This patch adds functionality to parse FlatAffineConstraints from a
StringRef with the intention to be used for unit tests. This should
make the construction of FlatAffineConstraints easier for testing
purposes.

The patch contains an example usage of the functionality in a unit test that
uses FlatAffineConstraints.

Reviewed By: bondhugula, grosser

Differential Revision: https://reviews.llvm.org/D113275
The file was modifiedmlir/include/mlir/Parser.h
The file was addedmlir/unittests/Analysis/AffineStructuresParserTest.cpp
The file was modifiedmlir/unittests/Analysis/AffineStructuresTest.cpp
The file was modifiedmlir/lib/Parser/AffineParser.cpp
The file was addedmlir/unittests/Analysis/AffineStructuresParser.h
The file was modifiedmlir/unittests/Analysis/CMakeLists.txt
The file was addedmlir/unittests/Analysis/AffineStructuresParser.cpp
Commit 2dec2aa3ad083dbde838809f0e8c7ae31110e111 by emaste
[Driver] Default to libc++ on FreeBSD

All supported FreeBSD releases use libc++, so default to it if the
target's major version is not specified.

Reviewed by: dim, emaste
Differential Revision: https://reviews.llvm.org/D77776
The file was modifiedclang/lib/Driver/ToolChains/FreeBSD.cpp
The file was modifiedclang/test/Driver/freebsd.cpp
Commit 966b72098363d44adf2882b9c34fcdbe344ff913 by benny.kra
[mlir][memref] Fix expanded shape ops memref.cast folding with changed type

`memref.expand_shape` has verification logic to make sure
result dim must be static if all the collapsing src dims are static.

This can be relaxed once expand_shape supports more dynamism.

Differential Revision: https://reviews.llvm.org/D114391
The file was modifiedmlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
The file was modifiedmlir/test/Dialect/MemRef/canonicalize.mlir
Commit 7aafe467d2aa6307d34c5762b8c3bf843d713737 by i
[ELF] Simplify a condition with config->copyRelocs. NFC
The file was modifiedlld/ELF/InputFiles.cpp
Commit ae5348a38eb1668cd9042d9a5207dc32bc4edb87 by jonathanchesterfield
[openmp][amdgpu] Make plugin robust to presence of explicit implicit arguments

OpenMP (compiler) does not currently request any implicit kernel
arguments. OpenMP (runtime) allocates and initialises a reasonable guess at
the implicit kernel arguments anyway.

This change makes the plugin check the number of explicit arguments, instead
of all arguments, and puts the pointer to hostcall buffer in both the current
location and at the offset expected when implicit arguments are added to the
metadata by D113538.

This is intended to keep things running while fixing the oversight in the
compiler (in D113538). Once that patch lands, and a following one marks
openmp kernels that use printf such that the backend emits an args element
with the right type (instead of hidden_node), the over-allocation can be
removed and the hardcoded 8*e+3 offset replaced with one read from the
.offset of the corresponding metadata element.

Reviewed By: estewart08

Differential Revision: https://reviews.llvm.org/D114274
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/system.cpp
The file was modifiedopenmp/libomptarget/plugins/amdgpu/impl/internal.h
The file was modifiedopenmp/libomptarget/plugins/amdgpu/src/rtl.cpp
Commit 2f5d6a0ea51b8c9ac3d241dbdd05f96e35193a26 by smeenai
[MachO] Fix struct size assertion

std::vector can have different sizes depending on the STL's debug level,
so account for its size separately. (You could argue that we should be
accounting for all the other members separately as well, but that would
be very unergonomic, and std::vector is the only one that's caused
problems so far.)
The file was modifiedlld/MachO/InputSection.cpp
Commit d02b318af636a887e85741a5fe699fe3852d1199 by pklausler
[flang] Remove typo that affected complex namelist input

A recent patch to real/complex formatted input included what must
have been an editing hiccup: "++ ++p" instead of "++p".  This
compiles, and it broke the consumption of the trailing ')' of a
complex value in namelist input by skipping over the character.

Extend existing test to cover this case.

Differential Revision: https://reviews.llvm.org/D114297
The file was modifiedflang/unittests/Runtime/NumericalFormatTest.cpp
The file was modifiedflang/runtime/edit-input.cpp
Commit 9cd7c534e27c2558ef16e14d4440bd838320334b by huihuiz
[InstCombine] Enable fold select into operand for FAdd,  FMul, FSub and FDiv.

For FAdd, FMul, FSub and FDiv, fold select into one of the operands to enable
further optimizations, i.e., floating-point reduction detection.

Turn code:
  %C = fadd %A, %B
  %D = select %cond, %C, %A

into:
  %C = select %cond, %B, -0.000000e+00
  %D = fadd %A, %C

Alive2 verification (with --disable-undef-input), timed out otherwise.
FAdd - https://alive2.llvm.org/ce/z/eUxN4Y
FMul - https://alive2.llvm.org/ce/z/5SWZz4
FSub - https://alive2.llvm.org/ce/z/Dhj8dU
FDiv - https://alive2.llvm.org/ce/z/Yj_NA2

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D113442
The file was modifiedllvm/test/Transforms/PhaseOrdering/AArch64/hoisting-sinking-required-for-vectorization.ll
The file was modifiedllvm/test/Transforms/LoopVectorize/ARM/mve-selectandorcost.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
The file was modifiedllvm/test/Transforms/LoopVectorize/reduction-inloop.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-binop-foldable-floating-point.ll
The file was modifiedllvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
Commit e3dea5cf0e326366ab95a49d167fde8b0816e292 by walter erquinigo
[formatters] Add a formatter for libstdc++ optional

Besides adding the formatter and the summary, this makes the libcxx
tests also work for this case.

This is the polished version of https://reviews.llvm.org/D114266,
authored by Danil Stefaniuc.

Differential Revision: https://reviews.llvm.org/D114403
The file was modifiedlldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
The file was addedlldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/optional/Makefile
The file was addedlldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/optional/TestDataFormatterGenericOptional.py
The file was addedlldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/optional/main.cpp
The file was removedlldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/optional/Makefile
The file was removedlldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/optional/main.cpp
The file was modifiedlldb/include/lldb/API/SBValue.h
The file was modifiedlldb/examples/synthetic/gnu_libstdcpp.py
The file was removedlldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/optional/TestDataFormatterLibcxxOptional.py
The file was modifiedlldb/bindings/interface/SBValue.i
The file was modifiedlldb/source/API/SBValue.cpp
Commit bb0d8e4bd9bc9426a5092368f086f52293dcc186 by pklausler
[flang] Correct the argument keyword for AIMAG(Z=...)

It was X= in the intrinsics table.

Differential Revision: https://reviews.llvm.org/D114296
The file was modifiedflang/lib/Evaluate/intrinsics.cpp
Commit a2c76312ed0acd9cb8a1ac03c94c1464a2dbb208 by walter erquinigo
Attempt to fix e3dea5cf0e326366ab95a49d167fde8b0816e292

https://lab.llvm.org/buildbot/#/builders/17/builds/13728 found an issue
in the optional formatter.
The file was modifiedlldb/examples/synthetic/gnu_libstdcpp.py
Commit b1083830d609cd984eee189c6dffccbc25df0408 by springerm
[mlir][linalg][bufferize][NFC] Clean up headers and function visibility

Differential Revision: https://reviews.llvm.org/D113964
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h
Commit 8d0994ed21b2fa063bc530ece580109d55593d29 by springerm
[mlir][linalg][bufferize][NFC] Remove special casing of CallOps

Differential Revision: https://reviews.llvm.org/D113966
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
Commit 26c0dd83ab0d1dc408856e50a80ca8d186e634cc by springerm
[mlir][linalg][bufferize][NFC] Move helper function to op interface

This is in preparation of changing the op traversal during bufferization.

Differential Revision: https://reviews.llvm.org/D114040
The file was modifiedutils/bazel/llvm-project-overlay/mlir/BUILD.bazel
The file was modifiedmlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.h
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.h
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
Commit fb99686bfd82061d07877228e4737f98fa4e83d4 by springerm
[mlir][linalg][bufferize] Limited support for scf.execute_region

Add support for analysis only.

Differential Revision: https://reviews.llvm.org/D114055
The file was modifiedmlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
The file was modifiedmlir/test/Dialect/Linalg/comprehensive-module-bufferize-invalid.mlir
Commit d5b73a70a0611fc6c082e20acb6ce056980c8323 by kazu
[llvm] Use range-based for loops (NFC)
The file was modifiedllvm/lib/Target/Sparc/LeonPasses.cpp
The file was modifiedllvm/lib/Target/Sparc/SparcFrameLowering.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCInstrInfo.cpp
The file was modifiedllvm/lib/Target/XCore/XCoreFrameToArgsOffsetElim.cpp
The file was modifiedllvm/lib/Target/NVPTX/NVPTXReplaceImageHandles.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCExpandAtomicPseudoInsts.cpp
The file was modifiedllvm/lib/CodeGen/BranchRelaxation.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCBranchSelector.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonGenInsert.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCFrameLowering.cpp
The file was modifiedllvm/lib/CodeGen/MachineFunction.cpp
The file was modifiedllvm/lib/Target/Sparc/DelaySlotFiller.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp
The file was modifiedllvm/lib/Target/PowerPC/PPCCTRLoops.cpp
Commit e5a8c8c883f1f3f91f40c883dd4f613aca0f7105 by joker.eph
[mlir] Refactoring a few Parser APIs

Refactored two new parser APIs parseGenericOperationAfterOperands and
parseCustomOperationName out of parseGenericOperation and parseCustomOperation.

Motivation: Sometimes an op can be printed in a special way if certain criteria
is met. While parsing, we need to handle all the versions.
`parseGenericOperationAfterOperands` is handy in situation where we already
parsed the operands and decide to fall back to default parsing.

`parseCustomOperationName` is useful when we need to know details (dialect,
operation name etc.) about a parsed token meant to be an mlir operation.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D113719
The file was addedmlir/test/IR/pretty_printed_region_op.mlir
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestDialect.cpp
The file was modifiedmlir/test/lib/Dialect/Test/TestOps.td