Changes

Summary

  1. [libc] add printf converter (details)
  2. [mlir:Pass] Add support for op-agnostic pass managers (details)
  3. [mlir] Fix pipeline-parsing.mlir on windows (details)
  4. [yaml2obj][COFF] Add missing RISCV constants (details)
  5. [AArch64] Replace `performANDSCombine` with `performFlagSettingCombine`. (details)
  6. [AArch64] Add `foldADCToCINC` DAG combine. (details)
  7. [runtimes] [CMake] Fix checks for -Werror when building with incomplete toolchains (details)
  8. Revision 3339000e0bda696c2e29173d15958c0a4978a143 caused the Language (details)
  9. [MIPS] Correct the implementation of the msub optimization (details)
  10. [LV] Add crashing test from #55096. (details)
  11. [MIPS} Address ISel failures for 64 bit fpus in microMIPS (details)
  12. [mlir] Significantly overhaul the textmate grammar (details)
  13. [mlir] Bump mlir-vscode to 0.0.7 (details)
  14. [mlir][sparse] add sparse sign integration test (details)
  15. [llvm][lldb] use FindLibEdit.cmake everywhere (details)
  16. [Lit] Add pushd and popd builtins (details)
  17. [clang-format] Handle comments below r_brace in RemoveBracesLLVM (details)
  18. [lldb/API] Add SBCompileUnit::GetIndexForLineEntry method to SB API (details)
  19. [lldb/test] Skip TestCppIncompleteTypeMembers.py on Darwin (NFC) (details)
  20. [mlir][sparse] Factoring out an enumerator over elements of SparseTensorStorage (details)
  21. In 92eaad2dd7adb5ee92f397cef85ab11f2612294e I made it possible to run (details)
  22. [lldb/test] Skip TestCppIncompleteTypeMembers.py for -gmodules on macOS (details)
  23. [LinkerWrapper] Remove stripping features from the linker wrapper (details)
  24. [LinkerWrapper] Group static libraries in their own buffer (details)
Commit 6a22b185d6f9461209947685e521a8f9a28bd983 by michaelrj
[libc] add printf converter

This adds the main pieces of the last piece of printf, the converter.
This takes the completed format section from the parser and then
converts it to a string for the writer, which is why it was the last
piece to be written. So far it supports chars and strings, but more
pieces are coming. Additionally, it supports replacing all of the
conversion functions with user supplied versions at compile time to
allow for additional functionality.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D125327
The file was modifiedlibc/src/stdio/printf_core/CMakeLists.txt
The file was modifiedlibc/src/stdio/printf_core/core_structs.h
The file was modifiedlibc/src/stdio/printf_core/printf_main.h
The file was addedlibc/test/src/stdio/printf_core/converter_test.cpp
The file was addedlibc/src/stdio/printf_core/char_converter.h
The file was modifiedlibc/src/stdio/printf_core/parser.cpp
The file was addedlibc/src/stdio/printf_core/converter_atlas.h
The file was addedlibc/src/stdio/printf_core/string_converter.h
The file was addedlibc/src/stdio/printf_core/converter.cpp
The file was modifiedlibc/src/stdio/printf_core/converter.h
The file was modifiedlibc/test/src/stdio/printf_core/CMakeLists.txt
Commit c2fb9c29b4076da8f68a27df2bee4a2f3c81c830 by riddleriver
[mlir:Pass] Add support for op-agnostic pass managers

This commit refactors the current pass manager support to allow for
operation agnostic pass managers. This allows for a series of passes
to be executed on any viable pass manager root operation, instead
of one specific operation type. Op-agnostic/generic pass managers
only allow for adding op-agnostic passes.

These types of pass managers are extremely useful when constructing
pass pipelines that can apply to many different types of operations,
e.g., the default inliner simplification pipeline. With the advent of
interface/trait passes, this support can be used to define FunctionOpInterface
pass managers, or other pass managers that effectively operate on
specific interfaces/traits/etc (see #52916 for an example).

Differential Revision: https://reviews.llvm.org/D123536
The file was modifiedmlir/lib/Transforms/Inliner.cpp
The file was modifiedmlir/test/Pass/pipeline-parsing.mlir
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/lib/Pass/PassTiming.cpp
The file was modifiedmlir/lib/Pass/PassStatistics.cpp
The file was addedmlir/test/Pass/generic-pipeline.mlir
The file was modifiedmlir/lib/Pass/PassRegistry.cpp
The file was modifiedmlir/lib/Pass/PassDetail.h
The file was modifiedmlir/docs/PassManagement.md
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/include/mlir/Pass/PassInstrumentation.h
Commit 86e1c2f097ca34994fa178967e617b9e6162be98 by riddleriver
[mlir] Fix pipeline-parsing.mlir on windows

We shouldn't be making assumptions about the result of llvm::getTypeName,
which may have different results for anonymous namespaces depending
on the platform.
The file was modifiedmlir/test/Pass/pipeline-parsing.mlir
Commit c5f8b98e4f442579a92926f99ed242a783dd8763 by efriedma
[yaml2obj][COFF] Add missing RISCV constants
The file was modifiedllvm/lib/ObjectYAML/COFFYAML.cpp
Commit d29fc6e7d24f9bf67512180c0be3f08526049a27 by karl.meakin
[AArch64] Replace `performANDSCombine` with `performFlagSettingCombine`.

`performFlagSettingCombine` is a generalised version of `performANDSCombine` which also works on  `ADCS` and `SBCS`.

Differential revision: https://reviews.llvm.org/D124464
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/arm64-atomic-128.ll
The file was modifiedllvm/test/CodeGen/AArch64/neon-abd.ll
The file was modifiedllvm/test/CodeGen/AArch64/i128-math.ll
The file was modifiedllvm/test/CodeGen/AArch64/addcarry-crash.ll
The file was modifiedllvm/test/CodeGen/AArch64/adc.ll
The file was modifiedllvm/test/CodeGen/AArch64/i256-math.ll
The file was modifiedllvm/test/CodeGen/AArch64/icmp-shift-opt.ll
The file was modifiedllvm/test/CodeGen/AArch64/arm64-vabs.ll
The file was modifiedllvm/test/CodeGen/AArch64/vecreduce-add-legalization.ll
The file was modifiedllvm/test/CodeGen/AArch64/neg-abs.ll
The file was modifiedllvm/test/CodeGen/AArch64/nzcv-save.ll
The file was modifiedllvm/test/CodeGen/AArch64/atomicrmw-O0.ll
Commit 0298cce257f8f8070377baab790eb8cc277904fc by karl.meakin
[AArch64] Add `foldADCToCINC` DAG combine.

Differential revision: https://reviews.llvm.org/D123781
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/adc.ll
The file was modifiedllvm/test/CodeGen/AArch64/icmp-shift-opt.ll
The file was modifiedllvm/test/CodeGen/AArch64/addcarry-crash.ll
The file was modifiedllvm/test/CodeGen/AArch64/atomicrmw-O0.ll
Commit 4169b5251f58cc0eb2ac6c3b4b9990a51728aac6 by martin
[runtimes] [CMake] Fix checks for -Werror when building with incomplete toolchains

When we add `--unwindlib=none` during the CMake configure phase (to
make CMake linking tests succeed before the unwind library has been
built for the first time - when bootstrapping a cross toolchain from
scratch), we add it to `CMAKE_REQUIRED_FLAGS` to make later CMake tests
pass.

When the option is added to `CMAKE_REQUIRED_FLAGS`, it gets added to
both compilation and linking commands. When --unwindlib=none is added
to the compilation command, it causes warnings (about being unused
during compilation, as it only affects linking).

When all CMake test compilations produce warnings, later CMake tests
for `-Werror` fail.

Add `--{start,end}-no-unused-arguments` around `--unwindlib=none`, if
supported, to avoid unnecessary warnings due to this option.

If the CMake requirement is bumped to 3.14, we could use
`CMAKE_REQUIRED_LINK_OPTIONS` instead, removing the need for the
`--{start,end}-no-unused-arguments` options. (However, do note that
`CMAKE_REQUIRED_LINK_OPTIONS` is problematic in combination with
`CMAKE_TRY_COMPILE_TARGET_TYPE` set to `STATIC_LIBRARY`; see
https://gitlab.kitware.com/cmake/cmake/-/issues/23454.)

Differential Revision: https://reviews.llvm.org/D124377
The file was modifiedruntimes/CMakeLists.txt
Commit c6799d98435df03872b960d95fcfa32718971bd6 by jingham
Revision 3339000e0bda696c2e29173d15958c0a4978a143 caused the Language
plugin to get queried earlier on in the startup, so that for .s files
we call the language "unknown" not "not-loaded".  This test was checking
against that string, so I fixed it for the change.
The file was modifiedlldb/test/Shell/SymbolFile/DWARF/x86/dwp.s
Commit a35add4c54be96a42fefc01ae1d74a23e3c16030 by simon.dardis
[MIPS] Correct the implementation of the msub optimization

The MIPS backend attempts to combine integer multiply and addition or
subtraction into a madd or msub operation. This optimization is
heavily restricted due to its utility in many cases.

PR/51114 highlighted that the optimization was performed on an
associative basis which is correct in the `add` case but not in
the `sub` case.

Resolve this bug by performing an early exit in the case where the
multiply is the LHS operand of the subtraction.

This resolves PR/51114.

Thanks to digitalseraphim for reporting the issue!

Differential Revision: https://reviews.llvm.org/D124742
The file was modifiedllvm/test/CodeGen/Mips/madd-msub.ll
The file was modifiedllvm/lib/Target/Mips/MipsISelLowering.cpp
Commit 38189438b69ca27b4c6ce707c52dbd217583d046 by flo
[LV] Add crashing test from #55096.
The file was addedllvm/test/Transforms/LoopVectorize/X86/pr55096-scalarize-add.ll
Commit e82e4fa7ef717b95eb3abf45a6f2a3571e6bc468 by simon.dardis
[MIPS} Address ISel failures for 64 bit fpus in microMIPS

Add the instructions and patterns for loads and stores in microMIPSr3
when a 64 bit FPU is present. Previously, this would lead to an
instruction selection failure.

This resolves PR/49200.

Thanks to jdeguire for reporting the issue!

Differential Revision: https://reviews.llvm.org/D124723
The file was addedllvm/test/CodeGen/Mips/pr49200.ll
The file was modifiedllvm/lib/Target/Mips/MicroMipsInstrFPU.td
The file was modifiedllvm/test/CodeGen/Mips/llvm-ir/load.ll
The file was modifiedllvm/test/CodeGen/Mips/llvm-ir/store.ll
The file was modifiedllvm/lib/Target/Mips/MipsScheduleGeneric.td
Commit 86f5caeee955660e6faf71e5efd2ae24a335a0cc by riddleriver
[mlir] Significantly overhaul the textmate grammar

The current grammar is really crusty, only supports a handful of
cases, and is also out-of-date after various refactorings. This commit
refactors the textmate grammar to handle significantly more cases,
and now provides proper coloring for a majority of cases (including
dialect attributes, operations, types, etc.)

Differential Revision: https://reviews.llvm.org/D125458
The file was modifiedmlir/utils/textmate/mlir.json
Commit 80c28a400cfec016474b0c954cab2d0bea659bb4 by riddleriver
[mlir] Bump mlir-vscode to 0.0.7

The syntax highlighting for mlir has gotten a significant facelift,
we also have some recent bug fixes for server launches.
The file was modifiedmlir/utils/vscode/package.json
Commit 6f3c7dfb7746b04cc98c2f29395dec5027e8d7f3 by ajcbik
[mlir][sparse] add sparse sign integration test

Implements a floating-point sign operator (using the new semi-ring ops)
that accomodates +/-Inf and +/-NaN in consistent way.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D125494
The file was addedmlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sign.mlir
Commit b1aed14bfea07508e4b9d864168c1ae6b5b5c665 by i
[llvm][lldb] use FindLibEdit.cmake everywhere

Currently, LLVM's LineEditor and LLDB both use libedit, but find them in different (inconsistent) ways.
This causes issues e.g. when you are using a locally installed version of libedit, which will not be used
by clang-query, but by lldb if picked up by FindLibEdit.cmake

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D124673
The file was modifiedlldb/source/Core/CMakeLists.txt
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
The file was modifiedlldb/cmake/modules/LLDBStandalone.cmake
The file was modifiedlldb/source/Interpreter/CMakeLists.txt
The file was modifiedllvm/utils/gn/secondary/lldb/source/Host/BUILD.gn
The file was modifiedlldb/source/Host/CMakeLists.txt
The file was modifiedllvm/cmake/config-ix.cmake
The file was removedlldb/cmake/modules/FindLibEdit.cmake
The file was modifiedllvm/lib/LineEditor/CMakeLists.txt
The file was addedcmake/Modules/FindLibEdit.cmake
Commit e91a73de24d60954700d7ac0293c050ab2cbe90b by davg
[Lit] Add pushd and popd builtins

This behaves just like the sh/cmd.exe equivalents.

pushd/popd are useful to verify path handling of the driver,
typically testing prefix maps or relative path handling.

Differential Revision: https://reviews.llvm.org/D125502
The file was modifiedllvm/utils/lit/lit/TestRunner.py
The file was addedllvm/utils/lit/tests/Inputs/shtest-pushd-popd/popd-no-stack.txt
The file was addedllvm/utils/lit/tests/shtest-pushd-popd.py
The file was addedllvm/utils/lit/tests/Inputs/shtest-pushd-popd/pushd-too-many-args.txt
The file was addedllvm/utils/lit/tests/Inputs/shtest-pushd-popd/popd-args.txt
The file was addedllvm/utils/lit/tests/Inputs/shtest-pushd-popd/pushd-popd-ok.txt
The file was addedllvm/utils/lit/tests/Inputs/shtest-pushd-popd/lit.cfg
Commit 6cd9633c1da5d2867306217af59bcc4b589bab02 by owenca
[clang-format] Handle comments below r_brace in RemoveBracesLLVM

If a closing brace is followed by a non-trailing comment, the
newline before the closing brace must also be removed.

Differential Revision: https://reviews.llvm.org/D125451
The file was modifiedclang/unittests/Format/FormatTest.cpp
The file was modifiedclang/lib/Format/Format.cpp
Commit a6926d576131c9ad849fef6f1d43134caab5025e by medismail.bennani
[lldb/API] Add SBCompileUnit::GetIndexForLineEntry method to SB API

This patch adds a new `GetIndexForLineEntry` method to the `SBCompileUnit`
class. As the name suggests, given an `SBLineEntry` object, this will
return the line entry index within a specific compile unit.

This method can take a `exact` boolean that will make sure that the
provided line entry matches perfectly another line entry in the compile unit.

rdar://47450887

Differention Revision: https://reviews.llvm.org/D125437

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
The file was modifiedlldb/source/API/SBCompileUnit.cpp
The file was addedlldb/test/API/python_api/compile_unit/main.c
The file was modifiedlldb/bindings/interface/SBCompileUnit.i
The file was addedlldb/test/API/python_api/compile_unit/Makefile
The file was addedlldb/test/API/python_api/compile_unit/TestCompileUnitAPI.py
The file was modifiedlldb/include/lldb/API/SBCompileUnit.h
Commit 8b9caad8eb449c1dc4df13e566a5f6c59de9be7c by medismail.bennani
[lldb/test] Skip TestCppIncompleteTypeMembers.py on Darwin (NFC)

This skips `TestCppIncompleteTypeMembers.py` on Darwin platforms since
it requires `-flimit-debug-info` which is not supported.

This should fix the Green Dragon bot test run:

https://green.lab.llvm.org/green/job/lldb-cmake/43678

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
The file was modifiedlldb/test/API/lang/cpp/incomplete-types/members/TestCppIncompleteTypeMembers.py
Commit 753fe330c1d6cfebac07ecd385fb2dcf63a0f6c9 by 2998727+wrengr
[mlir][sparse] Factoring out an enumerator over elements of SparseTensorStorage

Work towards fixing: https://github.com/llvm/llvm-project/issues/51652

Depends On D122928

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D122060
The file was modifiedmlir/lib/ExecutionEngine/SparseTensorUtils.cpp
Commit 2a21700bc5be24532952c2705fbbe784f8ec3164 by jingham
In 92eaad2dd7adb5ee92f397cef85ab11f2612294e I made it possible to run
a debug session with only a remote path to the file you are debugging
using the SB API's. This patch makes it possible to do this using
target create --remote-file <some_path> without supplying a local file
as well.

Prior to this change we errored out saying that we haven't implemented
copying the binary back from the remote. I didn't implement the copy
back (in the case I'm interested in - iOS debugging - we don't
actually have a way for lldb to do that). This patch doesn't impede
doing that, I just didn't need it. I think for some object file
formats debugging w/o the binary file is hard because of what doesn't
get mapped in. I didn't try to arbitrate that, I'm assuming anybody
who has to do this knows what they are going to get.

If there's a connected platform that can check that the remote file
exists, it will do so, otherwise we trust the user's input - if it
isn't there the process launch is going to fail with no-such-file so
it will be pretty clear what went wrong.

Differential Revision: https://reviews.llvm.org/D124947
The file was modifiedlldb/test/API/functionalities/gdb_remote_client/TestNoLocalFile.py
The file was modifiedlldb/source/Commands/CommandObjectTarget.cpp
Commit 2d7b49f389781751eac36f479b59d854664e9da5 by medismail.bennani
[lldb/test] Skip TestCppIncompleteTypeMembers.py for -gmodules on macOS

Following 8b9caad8eb449c1dc4df13e566a5f6c59de9be7c, this only skips
TestCppIncompleteTypeMembers.py on macOS if we test with `-gmodules` enabled.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
The file was modifiedlldb/test/API/lang/cpp/incomplete-types/members/TestCppIncompleteTypeMembers.py
Commit 1bfa88d0c5ad9e5ef06b770e8ca4d6d3a3aaca2d by jhuber6
[LinkerWrapper] Remove stripping features from the linker wrapper

Summary:
The linker wrapper previously had functionality to strip the sections
manually. We don't use this at all because this is much better done by
the linker via the `SHF_EXCLUDE` flag. This patch simply removes the
support for thi sfeature to simplify the code.
The file was modifiedclang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Commit 8a0fb965f6992078bb3d8bd68d3995e1150fe442 by jhuber6
[LinkerWrapper] Group static libraries in their own buffer

Summary:
Static libraries need to be handled differently from regular inpout
files, namely they are loaded lazily. Previously we used a flag to
indicate a file camm from a static library. This patch simplifies this
by simply keeping a different array that contains the static libraries
so we don't need to parse them out again.
The file was modifiedclang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp