Changes

Summary

  1. [clang] Avoid suggesting typoed directives in `.S` files (details)
  2. [mlir][Tablegen-LSP] Add support for a basic TableGen language server (details)
  3. [llvm-objcopy][test] Add cmp after copy (details)
  4. [mlir][NFC] Fix a few langref typos (details)
  5. [llvm-ar][NFC] Address post-commit comments on D125439. (details)
  6. Teach PeepholeOpt to eliminate redundant copy from constant physreg (e.g VLENB on RISCV) (details)
  7. [mlir][sparse] Restyling macros in the runtime library (details)
  8. [mlir][PDLL] Tweak the grammar to highlight partial code better (details)
  9. [mlir][NFC] Fix the tags for various doc code blocks (details)
  10. [lld-macho] Demangle symbol names in export-symbol error messages when -demangle is specified. (details)
  11. [dwarf] Emit a DIGlobalVariable for constant strings. (details)
  12. [test-suite][cmake] sort unit test targets (details)
  13. [RISCV] Fix missing vsetvli in transparent block case (details)
  14. [RISCV] Use classic dataflow for VSETVLI insertion (details)
  15. [lld-macho] Temporarily disable test on windows (details)
  16. [nfc][lld-macho] Fixed test from https://reviews.llvm.org/D125732 (details)
  17. [WebAssembly] Update relaxed SIMD opcodes and names (details)
  18. [mlir][sparse] Moved _mlir_ciface_newSparseTensor closer to its macros (details)
  19. [nfc][lld-macho] Follow up fixes to bd9e46815d73e4236c207bad8b5c54e7188154d7 (details)
  20. Revert "[dwarf] Emit a DIGlobalVariable for constant strings." (details)
Commit 45e01ce5fe6a5e4dc25ffdf626caa344fbcb93dd by ndesaulniers
[clang] Avoid suggesting typoed directives in `.S` files

This patch is itended to avoid suggesting typoed directives in `.S`
files to support the cases of `#` directives treated as comments or
various pseudo-ops. The feature is implemented in
https://reviews.llvm.org/D124726.

Fixes: https://reviews.llvm.org/D124726#3516346.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D125727
The file was addedclang/test/Preprocessor/suggest-typoed-directive.S
The file was modifiedclang/lib/Lex/PPDirectives.cpp
Commit 5de12bb703c5104b3fd64ee51c6900d6171d826a by riddleriver
[mlir][Tablegen-LSP] Add support for a basic TableGen language server

This follows the same general structure of the MLIR and PDLL language
servers. This commits adds the basic functionality for setting up the server,
and initially only supports providing diagnostics. Followon commits will
build out more comprehensive behavior.

Realistically this should eventually live in llvm/, but building in MLIR is an easier
initial step given that:
* All of the necessary LSP functionality is already here
* It allows for proving out useful language features (e.g. compilation databases)
  without affecting wider scale tablegen users
* MLIR has a vscode extension that can immediately take advantage of it

Differential Revision: https://reviews.llvm.org/D125440
The file was modifiedmlir/tools/CMakeLists.txt
The file was addedmlir/tools/tblgen-lsp-server/tblgen-lsp-server.cpp
The file was modifiedmlir/utils/vscode/src/mlirContext.ts
The file was addedmlir/tools/tblgen-lsp-server/CMakeLists.txt
The file was modifiedmlir/lib/Tools/lsp-server-support/CMakeLists.txt
The file was addedmlir/test/tblgen-lsp-server/exit-without-shutdown.test
The file was addedmlir/test/tblgen-lsp-server/diagnostics.test
The file was addedmlir/lib/Tools/tblgen-lsp-server/LSPServer.h
The file was addedmlir/include/mlir/Tools/tblgen-lsp-server/TableGenLspServerMain.h
The file was addedmlir/lib/Tools/lsp-server-support/SourceMgrUtils.cpp
The file was addedmlir/utils/vscode/tablegen-language-configuration.json
The file was addedmlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
The file was addedmlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp
The file was addedmlir/lib/Tools/lsp-server-support/SourceMgrUtils.h
The file was modifiedmlir/docs/Tools/MLIRLSP.md
The file was addedmlir/lib/Tools/tblgen-lsp-server/TableGenLspServerMain.cpp
The file was addedmlir/test/tblgen-lsp-server/initialize-params.test
The file was modifiedmlir/test/CMakeLists.txt
The file was addedmlir/lib/Tools/tblgen-lsp-server/TableGenServer.h
The file was addedmlir/test/tblgen-lsp-server/exit-with-shutdown.test
The file was modifiedmlir/utils/vscode/package.json
The file was addedmlir/test/tblgen-lsp-server/initialize-params-invalid.test
The file was addedmlir/test/tblgen-lsp-server/exit-eof.test
The file was addedmlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
The file was modifiedmlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
The file was modifiedmlir/lib/Tools/CMakeLists.txt
The file was modifiedmlir/utils/vscode/.gitignore
Commit 0d863b5b90a2f11e58b0b54d7183cb1577fd3a0b by keithbsmiley
[llvm-objcopy][test] Add cmp after copy

All of the other tests here either check that the copy fails, or that
the resulting binary is the same, it seems like this check was omitted
for the universal object case.

Differential Revision: https://reviews.llvm.org/D125478
The file was modifiedllvm/test/tools/llvm-objcopy/MachO/universal-object.test
Commit 9f39867b103213d34121668381cb7dc054eda068 by riddleriver
[mlir][NFC] Fix a few langref typos
The file was modifiedmlir/docs/LangRef.md
Commit 52ddae132f8ccd646e93d42b69f1efd902ecb4f2 by Ben.Dunbobbin
[llvm-ar][NFC] Address post-commit comments on D125439.

Remove errant whitespace.

AIX uses big archive format so check for both !<arch> and <bigaf>.

Only the "gnu" format has thin archives; specify --format=gnu for
thin archive test-cases.
The file was modifiedllvm/tools/llvm-ar/llvm-ar.cpp
The file was modifiedllvm/test/tools/llvm-ar/mri-create-overwrite.test
Commit 7dbf2e7b576f52f1c459665fe524d7521d560dae by preames
Teach PeepholeOpt to eliminate redundant copy from constant physreg (e.g VLENB on RISCV)

The existing redundant copy elimination required a virtual register source, but the same logic works for any physreg where we don't have to worry about clobbers.  On RISCV, this helps eliminate redundant CSR reads from VLENB.

Differential Revision: https://reviews.llvm.org/D125564
The file was modifiedllvm/lib/CodeGen/PeepholeOptimizer.cpp
The file was modifiedllvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
The file was modifiedllvm/test/CodeGen/RISCV/vlenb.ll
Commit 1313f5d3071c5aee6eaf3c366747d44585522fb4 by 2998727+wrengr
[mlir][sparse] Restyling macros in the runtime library

In addition to reducing code repetition, this also helps ensure that the various API functions follow the naming convention of mlir::sparse_tensor::primaryTypeFunctionSuffix (e.g., due to typos in the repetitious code).

Depends On D125428

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D125431
The file was modifiedmlir/lib/ExecutionEngine/SparseTensorUtils.cpp
Commit 1febbd67aa9cf31119398dde27d2dbf016de351e by riddleriver
[mlir][PDLL] Tweak the grammar to highlight partial code better

This commit enables proper highlighting when inner statements are
outside of a constraint/pattern/etc. This shouldn't really happen in
actual code, but can happen in documentation (which uses the same
syntax grammar).
The file was modifiedmlir/utils/vscode/pdll-grammar.json
Commit 6593886a35025af7b32e5d317dd91779bf60014f by riddleriver
[mlir][NFC] Fix the tags for various doc code blocks
The file was modifiedmlir/docs/Interfaces.md
The file was modifiedmlir/docs/PassManagement.md
The file was modifiedmlir/docs/DataLayout.md
The file was modifiedmlir/docs/AttributesAndTypes.md
The file was modifiedmlir/docs/OpDefinitions.md
Commit 4c5b187f2c065648799e109a6754917e642dc659 by vyng
[lld-macho] Demangle symbol names in export-symbol error messages when -demangle is specified.
PR/55512

Reviewed By: keith

Differential Revision: https://reviews.llvm.org/D125732
The file was modifiedlld/test/MachO/demangle.s
The file was modifiedlld/MachO/Driver.cpp
Commit 4680982b36a84770a1600fc438be8ec090671724 by 31459023+hctim
[dwarf] Emit a DIGlobalVariable for constant strings.

An upcoming patch will extend llvm-symbolizer to provide the source line
information for global variables. The goal is to move AddressSanitizer
off of internal debug info for symbolization onto the DWARF standard
(and doing a clean-up in the process). Currently, ASan reports the line
information for constant strings if a memory safety bug happens around
them. We want to keep this behaviour, so we need to emit debuginfo for
these variables as well.

Reviewed By: dblaikie, rnk, aprantl

Differential Revision: https://reviews.llvm.org/D123534
The file was addedclang/test/CodeGen/debug-info-variables.c
The file was modifiedllvm/lib/AsmParser/LLParser.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedclang/lib/CodeGen/CGDebugInfo.cpp
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
The file was modifiedclang/test/VFS/external-names.c
The file was removedllvm/test/Assembler/invalid-diglobalvariable-missing-name.ll
The file was modifiedclang/lib/CodeGen/CGDebugInfo.h
The file was modifiedllvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
The file was addedllvm/test/DebugInfo/COFF/global-no-strings.ll
Commit f20e6a6e61da83fbc444e21aa51f4794d1273bec by smeenai
[test-suite][cmake] sort unit test targets

This patch sorts unit test targets into directories corresponding to the
test source file directories to improve target navigation.

Reviewed By: smeenai

Differential Revision: https://reviews.llvm.org/D124810
The file was modifiedllvm/unittests/DebugInfo/GSYM/CMakeLists.txt
The file was modifiedllvm/unittests/DebugInfo/MSF/CMakeLists.txt
The file was modifiedllvm/unittests/Target/ARM/CMakeLists.txt
The file was modifiedllvm/unittests/Transforms/Scalar/CMakeLists.txt
The file was modifiedllvm/unittests/CMakeLists.txt
The file was modifiedllvm/unittests/Transforms/Vectorize/CMakeLists.txt
The file was modifiedllvm/unittests/DebugInfo/DWARF/CMakeLists.txt
The file was modifiedllvm/unittests/DebugInfo/PDB/CMakeLists.txt
The file was modifiedllvm/unittests/Target/AMDGPU/CMakeLists.txt
The file was modifiedllvm/unittests/DebugInfo/CodeView/CMakeLists.txt
The file was modifiedllvm/unittests/Target/PowerPC/CMakeLists.txt
The file was modifiedllvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
The file was modifiedllvm/unittests/tools/llvm-profgen/CMakeLists.txt
The file was modifiedllvm/unittests/ExecutionEngine/MCJIT/CMakeLists.txt
The file was modifiedllvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt
The file was modifiedllvm/unittests/ExecutionEngine/CMakeLists.txt
The file was modifiedllvm/unittests/tools/llvm-exegesis/CMakeLists.txt
The file was modifiedllvm/unittests/Target/WebAssembly/CMakeLists.txt
The file was modifiedllvm/unittests/Transforms/Utils/CMakeLists.txt
The file was modifiedllvm/unittests/Target/X86/CMakeLists.txt
The file was modifiedllvm/unittests/Transforms/IPO/CMakeLists.txt
The file was modifiedllvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt
The file was modifiedllvm/unittests/Target/AArch64/CMakeLists.txt
Commit 3d17c917099a691e12f05d2502d81b972600a4ae by preames
[RISCV] Fix missing vsetvli in transparent block case

We've got a lurking problem with our data flow implementation where different phases disagree, resulting in possible miscompiles. D119518 introduced a workaround, but failed to consider blocks which only contain load/stores compatible with their incoming state.

When I went to rebase and simplify D125232, it turned out that not all of the correctness issues had been fixed yet after all. This is the correctness fix accidentally embedded in the original more complicated version.

Note that the test changes here are mostly regressions. It's worth noting that the simplified version of D125232 exactly reverses all the non-functional diffs in the test caused here. D125232 should be the immediate following commit.

Differential Revision: https://reviews.llvm.org/D125703
The file was modifiedllvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.mir
Commit 1474880353f12a5a1beb62fc873477a8a2e6afda by preames
[RISCV] Use classic dataflow for VSETVLI insertion

Our current implementation of the InsertVSETVLI dataflow allows phase 3 to arrive at a different block end state than the data flow in phase 1/2 computed. This arises because a block which contains instructions (e.g. load or stores) which don't consume all the incoming bits of the VL/VTYPE can be compatible with multiple incoming states. The algorithm effectively changes the SEW on such instructions, and propagates the prior state forward. As phase 3 uses the block input state for this propagation, but phase 1/2 doesn't, this can result in different block end states.

If we don't correct for it, this discrepancy can result in miscompiles. This was the source of multiple recent bugs. However, by now we have fixes for all known correctness issues.

The basic strategy we use is to insert a compensation vsetvli to bring the block state leaving the block back into consistency with the one computed. This is correct, but results in extra vsetvlis being placed at the end of blocks.

This change adjusts the phase 1/2 algorithm to propagate the incoming block state through the block, allowing the compatibility rules to modify the end state. The algorithm may need to run slightly more iterations, but the end result is consistent with what phase 3 does.

The benefit of doing this is two fold.

First, we reverse some of the code quality introductions introduced in the functional fixes.

Second, we simplify the invariants, and allow the strict assertions to be enabled. Several humans, myself included, have found it quite surprising that invariant didn't hold already, and arguably that confusion is the cause of several of our recent miscompiles in this code.

The downside to this patch is that the dataflow may require additional iterations to stabilize. In the worse case, we go from O(Edges) to O(E + UniquePaths) as the incoming state (and thus the outgoing one) can now change once for each path from the entry block.

Differential Revision: https://reviews.llvm.org/D125232
The file was modifiedllvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/vsetvli-insert-crossbb.mir
The file was modifiedllvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
Commit a997cdc3b798e6294ceb32bcece62abe6276aae1 by vyng
[lld-macho] Temporarily disable test on windows
The metadata seems to be demangled differently
The file was modifiedlld/test/MachO/demangle.s
Commit bd9e46815d73e4236c207bad8b5c54e7188154d7 by vyng
[nfc][lld-macho] Fixed test from https://reviews.llvm.org/D125732

Details:
The test was incorrectly expecting the error messages for the export symbols to have a particular order.
It shouldn't because the export symbol list is processed concurrently.
The file was modifiedlld/test/MachO/demangle.s
Commit 82a13d05ab7184a93befe7c5c284b79596cd5fb3 by tlively
[WebAssembly] Update relaxed SIMD opcodes and names

to reflect the latest state of the proposal:
https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md#binary-format.
Moves code around to match the instruction order from the proposal, but the only
functional changes are to the names and opcodes.

Reviewed By: aheejin

Differential Revision: https://reviews.llvm.org/D125726
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
The file was modifiedllvm/test/CodeGen/WebAssembly/simd-intrinsics.ll
The file was modifiedllvm/test/MC/WebAssembly/simd-encodings.s
Commit bfadd13df474aac157d759cea946f1e5c1297000 by 2998727+wrengr
[mlir][sparse] Moved _mlir_ciface_newSparseTensor closer to its macros

This is a followup to D125431, to keep from confusing the machinery that generates diffs (since combining these two changes into one would obfuscate the changes actually made in the previous differential).

Depends On D125431

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D125432
The file was modifiedmlir/lib/ExecutionEngine/SparseTensorUtils.cpp
Commit 3cde6d83f86c274e5608abfe852b95fd6668f9fd by vyng
[nfc][lld-macho] Follow up fixes to bd9e46815d73e4236c207bad8b5c54e7188154d7

Need -DAG in the first expect statement too
The file was modifiedlld/test/MachO/demangle.s
Commit ed2c3218f5badf88cb7897fabf8faa01e8aa2044 by 31459023+hctim
Revert "[dwarf] Emit a DIGlobalVariable for constant strings."

This reverts commit 4680982b36a84770a1600fc438be8ec090671724.

Broke a fuchsia windows bot. More details in the review:
https://reviews.llvm.org/D123534
The file was modifiedllvm/lib/AsmParser/LLParser.cpp
The file was modifiedclang/lib/CodeGen/CGDebugInfo.h
The file was modifiedclang/test/VFS/external-names.c
The file was modifiedllvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
The file was removedclang/test/CodeGen/debug-info-variables.c
The file was removedllvm/test/DebugInfo/COFF/global-no-strings.ll
The file was addedllvm/test/Assembler/invalid-diglobalvariable-missing-name.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
The file was modifiedclang/lib/CodeGen/CGDebugInfo.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp