Changes

Summary

  1. [DebugInfo][InstrRef] Fix Wdangling-else warning in InstrRefLDVTest (details)
  2. [DebugInfo][NFC] Zero-initialize a class field (details)
  3. [mlir][RFC] Refactor layout representation in MemRefType (details)
  4. [lldb] Filter duplicates in Target::GetScratchTypeSystems (details)
  5. [lldb] change name demangling to be consistent between windows and linx (details)
  6. [lldb] Allow dumping the state of all scratch TypeSystems (details)
  7. [lldb] Reduce code duplication around inferior building (details)
  8. [DebugInfo][InstrRef] Avoid un-necessary densemap copies and comparisons (details)
  9. Revert "[lldb] [ABI/X86] Support combining xmm* and ymm*h regs into ymm*" (details)
  10. [lldb] Adjust udt-layout.test after MS mangling change (details)
  11. [clangd] Add code completion of param name on /* inside function calls. (details)
  12. [lldb] [Host] Make Terminal methods return llvm::Error (details)
  13. [lldb] [ABI/X86] Refactor ABIX86::AugmentRegisterInfo() (details)
  14. [MLIR][OpenMP] Added parseClauses (details)
  15. [fir] Add FIRBuilder utility functions (details)
  16. [runtimes] Make sure LLVM_LIT_ARGS is set before including individual runtimes (details)
Commit 9da51402f477dd550847fac542c99416c5275388 by jeremy.morse
[DebugInfo][InstrRef] Fix Wdangling-else warning in InstrRefLDVTest

Fix a dangling else that gcc-11 warned about. The EXPECT_EQ macro
expands to an if-else, so the whole construction contains a hidden
dangling else.

Differential Revision: https://reviews.llvm.org/D112044
The file was modifiedllvm/unittests/CodeGen/InstrRefLDVTest.cpp
Commit cf033bb2d39c42818e3f13829b5ac6cc66b0ed6f by jeremy.morse
[DebugInfo][NFC] Zero-initialize a class field

This field gets assigned when the relevant object starts being used; but it
remains uninitialized beforehand. This risks introducing hard-to-detect
bugs if something changes, so zero-initialize the field.
The file was modifiedllvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
Commit e41ebbecf97ac70326dfa2c54e3ef5fa13df54eb by vlad.vinogradov
[mlir][RFC] Refactor layout representation in MemRefType

The change is based on the proposal from the following discussion:
https://llvm.discourse.group/t/rfc-memreftype-affine-maps-list-vs-single-item/3968

* Introduce `MemRefLayoutAttr` interface to get `AffineMap` from an `Attribute`
  (`AffineMapAttr` implements this interface).
* Store layout as a single generic `MemRefLayoutAttr`.

This change removes the affine map composition feature and related API.
Actually, while the `MemRefType` itself supported it, almost none of the upstream
can work with more than 1 affine map in `MemRefType`.

The introduced `MemRefLayoutAttr` allows to re-implement this feature
in a more stable way - via separate attribute class.

Also the interface allows to use different layout representations rather than affine maps.
For example, the described "stride + offset" form, which is currently supported in ASM parser only,
can now be expressed as separate attribute.

Reviewed By: ftynse, bondhugula

Differential Revision: https://reviews.llvm.org/D111553
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/lib/Conversion/LLVMCommon/Pattern.cpp
The file was modifiedmlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
The file was modifiedmlir/lib/Transforms/NormalizeMemRefs.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
The file was modifiedmlir/unittests/IR/ShapedTypeTest.cpp
The file was modifiedmlir/include/mlir/IR/BuiltinTypes.h
The file was modifiedmlir/include/mlir-c/BuiltinTypes.h
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was modifiedmlir/lib/Parser/TypeParser.cpp
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/test/IR/parser.mlir
The file was modifiedmlir/test/Dialect/Vector/invalid.mlir
The file was modifiedmlir/lib/IR/BuiltinAttributeInterfaces.cpp
The file was modifiedmlir/lib/IR/BuiltinTypes.cpp
The file was modifiedmlir/lib/Bindings/Python/IRTypes.cpp
The file was modifiedmlir/lib/CAPI/IR/BuiltinTypes.cpp
The file was modifiedmlir/lib/Dialect/GPU/Transforms/AllReduceLowering.cpp
The file was modifiedmlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
The file was modifiedmlir/test/IR/invalid-ops.mlir
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was modifiedmlir/include/mlir/IR/BuiltinAttributeInterfaces.h
The file was modifiedmlir/include/mlir/IR/BuiltinAttributeInterfaces.td
The file was modifiedmlir/test/python/ir/builtin_types.py
The file was modifiedmlir/test/CAPI/ir.c
The file was modifiedmlir/test/IR/invalid.mlir
The file was modifiedmlir/include/mlir/IR/BuiltinTypes.td
The file was modifiedmlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
The file was modifiedmlir/lib/Dialect/Vector/VectorOps.cpp
The file was modifiedmlir/include/mlir/IR/BuiltinAttributes.td
Commit cfaa5c344d5bc73aae0ec39d57d98acf7463fccf by Raphael Isemann
[lldb] Filter duplicates in Target::GetScratchTypeSystems

`Target::GetScratchTypeSystems` returns the list of scratch TypeSystems. The
current implementation is iterating over all LanguageType values and retrieves
the respective TypeSystem for each LanguageType.

All C/C++/Obj-C LanguageTypes are however mapped to the same
ScratchTypeSystemClang instance, so the current implementation adds this single
TypeSystem instance several times to the list of TypeSystems (once for every
LanguageType that we support).

The only observable effect of this is that `SBTarget.FindTypes` for builtin
types currently queries the ScratchTypeSystemClang several times (and also adds
the same result several times).

Reviewed By: bulbazord, labath

Differential Revision: https://reviews.llvm.org/D111931
The file was addedlldb/test/API/lang/c/builtin-types/TestCBuiltinTypes.py
The file was modifiedlldb/source/Target/Target.cpp
Commit 134e1817f62c08cde1ed1f7e94e51425536085ac by werat
[lldb] change name demangling to be consistent between windows and linx

When printing names in lldb on windows these names contain the full type information while on linux only the name is contained.

This change introduces a flag in the Microsoft demangler to control if the type information should be included.
With the flag enabled demangled name contains only the qualified name, e.g:
without flag -> with flag
int (*array2d)[10] -> array2d
int (*abc::array2d)[10] -> abc::array2d
const int *x -> x

For globals there is a second inconsistency which is not yet addressed by this change. On linux globals (in global namespace) are prefixed with :: while on windows they are not.

Reviewed By: teemperor, rnk

Differential Revision: https://reviews.llvm.org/D111715
The file was modifiedllvm/lib/Demangle/MicrosoftDemangle.cpp
The file was modifiedllvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
The file was modifiedllvm/test/Demangle/ms-options.test
The file was modifiedllvm/include/llvm/Demangle/Demangle.h
The file was modifiedllvm/tools/llvm-undname/llvm-undname.cpp
The file was modifiedllvm/lib/Demangle/MicrosoftDemangleNodes.cpp
The file was modifiedlldb/source/Core/Mangled.cpp
Commit 9a57d1e52680ac05c29d6d0d2cfbaf3b05a5cbce by Raphael Isemann
[lldb] Allow dumping the state of all scratch TypeSystems

This adds the `target dump typesystem'`command which dumps the TypeSystem of the
target itself (aka the 'scratch TypeSystem'). This is similar to `target modules
dump ast` which dumps the AST of lldb::Modules associated with a selected
target.

Unlike `target modules dump ast`, the new command is not a subcommand of `target
modules dump` as it's not touching the modules of a target at all. Also unlike
`target modules dump ast` I tried to keep the implementation language-neutral,
so this patch moves our Clang `Dump` to the `TypeSystem` interface so it will
also dump the state of any future/downstream scratch TypeSystems (e.g., Swift).
That's also why the command just refers to a 'typesystem' instead of an 'ast'
(which is only how Clang is necessarily modelling the internal TypeSystem
state).

The main motivation for this patch is that I need to write some tests that check
for duplicates in the ScratchTypeSystemClang of a target. There is currently no
way to check for this at the moment (beside measuring memory consumption of
course). It's probably also useful for debugging LLDB itself.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D111936
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
The file was addedlldb/test/API/commands/target/dump/main.cpp
The file was modifiedlldb/source/Commands/CommandObjectTarget.cpp
The file was addedlldb/test/API/commands/target/dump/TestTargetDumpTypeSystem.py
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
The file was modifiedlldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
The file was modifiedlldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
The file was modifiedlldb/include/lldb/Symbol/TypeSystem.h
The file was addedlldb/test/API/commands/target/dump/Makefile
Commit 8bac18be0e45adc7b096375bf4f65635fb994df0 by pavel
[lldb] Reduce code duplication around inferior building

We had two sets of build<flavour> methods, whose bodies were largely
identical. This makes any kind of modification in their vicinity
repetitive and error-prone.

Replace each set with a single method taking an optional debug_info
parameter.

Differential Revision: https://reviews.llvm.org/D111989
The file was modifiedlldb/test/API/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
The file was modifiedlldb/test/API/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
The file was modifiedlldb/docs/testsuite/a-detailed-walkthrough.txt
The file was modifiedlldb/packages/Python/lldbsuite/test/README-TestSuite
The file was modifiedlldb/packages/Python/lldbsuite/test/builders/darwin.py
The file was modifiedlldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
The file was modifiedlldb/test/API/macosx/add-dsym/TestAddDsymDownload.py
The file was modifiedlldb/packages/Python/lldbsuite/test/lldbtest.py
The file was modifiedlldb/packages/Python/lldbsuite/test/builders/builder.py
The file was modifiedlldb/test/API/commands/add-dsym/uuid/TestAddDsymCommand.py
Commit 849b17949f18b5753592588a2290f2f3dde73ac0 by jeremy.morse
[DebugInfo][InstrRef] Avoid un-necessary densemap copies and comparisons

This is purely a performance patch: InstrRefBasedLDV used to use three
DenseMaps to store variable values, two for long term storage and one as a
working set. This patch eliminates the working set, and updates the long
term storage in place, thus avoiding two DenseMap comparisons and two
DenseMap assignments, which can be expensive.

Differential Revision: https://reviews.llvm.org/D111716
The file was modifiedllvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
The file was modifiedllvm/unittests/CodeGen/InstrRefLDVTest.cpp
The file was modifiedllvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.h
Commit ee11612ee10edd0d1f219c302f1a0abe0b46ddb3 by mgorny
Revert "[lldb] [ABI/X86] Support combining xmm* and ymm*h regs into ymm*"

This reverts commit 5352ea4a721ef252129994111b83dc350ecc71da.  It seems
to have broken the arm buildbot.
The file was modifiedlldb/source/Plugins/ABI/X86/ABIX86.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py
The file was modifiedlldb/include/lldb/lldb-private-types.h
The file was modifiedlldb/source/Target/DynamicRegisterInfo.cpp
Commit 7dfb1395549c34f4b607055c01f8c510ead6b0db by Raphael Isemann
[lldb] Adjust udt-layout.test after MS mangling change

The demangled name no longer contains the redundant name since D111715.
The file was modifiedlldb/test/Shell/SymbolFile/PDB/udt-layout.test
Commit 8fbac4e88ac3dde30310bb63b234045075cd338b by adamcz
[clangd] Add code completion of param name on /* inside function calls.

For example, if you have:
  void foo(int bar);
  foo(/*^
it should auto-complete to "bar=".

Because Sema callbacks for code completion in comments happen before we
have an AST we need to cheat in clangd by detecting completion on /*
before, moving cursor back by two characters, then running a simplified
verion of SignatureHelp to extract argument name(s) from possible
overloads.

Differential Revision: https://reviews.llvm.org/D110823
The file was modifiedclang-tools-extra/clangd/ClangdLSPServer.cpp
The file was modifiedclang-tools-extra/clangd/test/initialize-params.test
The file was modifiedclang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
The file was modifiedclang-tools-extra/clangd/CodeComplete.cpp
Commit 39f2b059633ec1dc51b10b3fb48b616d87c273e3 by mgorny
[lldb] [Host] Make Terminal methods return llvm::Error

Differential Revision: https://reviews.llvm.org/D111890
The file was modifiedlldb/source/Host/common/Terminal.cpp
The file was modifiedlldb/source/Target/Process.cpp
The file was modifiedlldb/include/lldb/Host/Terminal.h
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
The file was modifiedlldb/unittests/Host/posix/TerminalTest.cpp
Commit c6d7f248bda3439a06c630c35360d40dbfc06abe by mgorny
[lldb] [ABI/X86] Refactor ABIX86::AugmentRegisterInfo()

Refactor ABIX86::AugmentRegisterInfo() and helper functions for better
readability.  This also fixes listing eax & co. as potential subregs
on 32-bit systems.

Differential Revision: https://reviews.llvm.org/D108937
The file was modifiedlldb/source/Plugins/ABI/X86/ABIX86.cpp
Commit d576f4501439860faa95e4f3b782cd6da5123ef1 by Shraiysh.Vaishay
[MLIR][OpenMP] Added parseClauses

Code reorganized in OpenMPDialect.cpp to have all functions corresponding to an operation together.

Added parseClauses function to avoid code duplication while parsing clauses in OpenMP operations. Also added printers and verifiers for clauses, which are being used for multiple operations.

Reviewed By: kiranchandramohan, peixin

Differential Revision: https://reviews.llvm.org/D110903
The file was modifiedmlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
The file was modifiedmlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
The file was modifiedmlir/test/Dialect/OpenMP/invalid.mlir
Commit 45503fc044499a5dc88be273a2d599f8ad5bccd3 by clementval
[fir] Add FIRBuilder utility functions

Extract some code from the big ptach D111337. This patch
contains some utility functions from the FIRBuidler.

List of utility functions added:
- getRegion
- getModule
- getKindMap
- getRefType
- getVarLenSeqTy
- getRealType
- createNullConstant
- createRealConstant
- createRealZeroConstant
- createGlobal
- createGlobalConstant
- createStringLitOp
- getNamedFunction
- getNamedGlobal
- createFunction
- addNamedFunction
- createBool

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: kiranchandramohan

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
The file was modifiedflang/lib/Optimizer/Builder/FIRBuilder.cpp
The file was modifiedflang/unittests/Optimizer/Builder/FIRBuilderTest.cpp
The file was modifiedflang/include/flang/Optimizer/Builder/FIRBuilder.h
The file was modifiedflang/lib/Optimizer/Dialect/FIROps.cpp
Commit 7a801138f8bddf17d7df52c1c3f1d4ce8da702ad by Louis Dionne
[runtimes] Make sure LLVM_LIT_ARGS is set before including individual runtimes

Otherwise, the individual `check-cxx`, `check-cxxabi` and similar targets
will not know about `LLVM_LIT_ARGS`, and we'll end up running lit without
any argument.

Differential Revision: https://reviews.llvm.org/D112035
The file was modifiedruntimes/CMakeLists.txt