Changes

Summary

  1. [lldb] Support querying registers via generic names without alt_names (details)
  2. [lldb] Remove redundant register alt_names (details)
  3. [OpenCL] Support cl_ext_float_atomics (details)
  4. [analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it (details)
  5. [mlir][Linalg] Use reify for padded op shape derivation. (details)
  6. [OpenCL] Initialize temporaries in the private address space (details)
  7. [clang] Check unsupported types in expressions (details)
  8. [gn build] Port 0213d7ec0c50 (details)
  9. Revert "[clang] Check unsupported types in expressions" (details)
  10. SwiftAsync: use runtime-provided flag for extended frame if back-deploying (details)
  11. [clang] Make the driver not diagnose errors on nonexistent linker inputs (details)
  12. [JITLink] Factor out forEachRelocation() function from addRelocations() in ELF Aarch64 backend (NFC) (details)
  13. [analyzer] MallocChecker: Add notes from NoOwnershipChangeVisitor only when a function "intents", but doesn't change ownership, enable by default (details)
  14. [InstCombining] Refactor checks for TryToSinkInstruction. NFC (details)
  15. [lldb] Skip TestGuiBasicDebug due to pr51833 (details)
  16. [VPlan] Add test that requires duplicating recipe for sinking. (details)
  17. [mlir][linalg] ComprehensiveBufferize: Do not copy InitTensorOps (details)
  18. [SystemZ][z/OS] Missing wchar functions libc++ (details)
  19. [lldb] [test] Remove parent output checks from follow-child tests (details)
  20. [gn build] (semi-manually) port 4247381e26dd (details)
Commit 8567f4d4b9a79f041406026011fb8151b24b8c99 by mgorny
[lldb] Support querying registers via generic names without alt_names

Update GetRegisterInfoByName() methods to support getting registers
by a generic name independently of alt_name entries in the register
context.  This makes it possible to use generic names when interacting
with gdbserver (that does not supply alt_names).  It also makes it
possible to remove some of the duplicated information from register
context declarations and/or use alt_names for another purpose.

Differential Revision: https://reviews.llvm.org/D108554
The file was modifiedlldb/include/lldb/Core/ValueObjectRegister.h
The file was modifiedlldb/source/Target/RegisterContext.cpp
The file was modifiedlldb/source/API/SBFrame.cpp
The file was modifiedlldb/source/Host/common/NativeRegisterContext.cpp
The file was modifiedlldb/source/Core/ValueObjectRegister.cpp
The file was addedlldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py
Commit e3d878bdd82e10658e7b31dc6adec4a582ba1891 by mgorny
[lldb] Remove redundant register alt_names

Remove redundant register alt_names that correspond to their respective
generic names.  D108554 makes it possible to query registers through
their generic names directly, therefore making repeating them via
alt_name unnecessary.

While at it, also remove alt_names that are equal to register names
on PPC.

This patch does not alter register definitions where the generic names
are listed as primary names, and other names are provided as alt_name
(e.g. ARM).

Differential Revision: https://reviews.llvm.org/D109626
The file was modifiedlldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
The file was modifiedlldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
The file was modifiedlldb/source/Plugins/Process/Utility/RegisterInfos_s390x.h
The file was modifiedlldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
The file was modifiedlldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
The file was modifiedlldb/source/Plugins/Process/Utility/RegisterInfos_ppc64.h
The file was modifiedlldb/source/Plugins/Process/Utility/RegisterInfos_powerpc.h
The file was modifiedlldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
The file was modifiedlldb/source/Plugins/Process/Utility/RegisterContextWindows_x86_64.cpp
The file was modifiedlldb/source/Plugins/Process/Utility/RegisterInfos_ppc64le.h
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
The file was modifiedlldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
The file was modifiedlldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
Commit d353d1c50112a1cb315eccdab18ce7bd1563cd06 by sven.vanhaastregt
[OpenCL] Support cl_ext_float_atomics

See https://github.com/KhronosGroup/OpenCL-Docs/pull/552 for initial
specification.

Patch by Haonan Yang.

Differential Revision: https://reviews.llvm.org/D106343
The file was modifiedclang/test/SemaOpenCL/fdeclare-opencl-builtins.cl
The file was modifiedclang/lib/Headers/opencl-c-base.h
The file was modifiedclang/test/Headers/opencl-c-header.cl
The file was modifiedclang/lib/Headers/opencl-c.h
The file was modifiedclang/lib/Sema/OpenCLBuiltins.td
Commit 0213d7ec0c501414d12020737fdc47e47e4392d9 by kristof.umann
[analyzer][NFCI] Allow clients of NoStateChangeFuncVisitor to check entire function calls, rather than each ExplodedNode in it

Fix a compilation error due to a missing 'template' keyword.

Differential Revision: https://reviews.llvm.org/D108695
The file was modifiedclang/unittests/StaticAnalyzer/CMakeLists.txt
The file was modifiedclang/unittests/StaticAnalyzer/CallEventTest.cpp
The file was modifiedclang/unittests/StaticAnalyzer/CheckerRegistration.h
The file was modifiedclang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
The file was modifiedclang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
The file was modifiedclang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
The file was modifiedclang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp
The file was addedclang/unittests/StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
Commit b01d223faf8ac4d62baea8a0e1d7b6cab7938118 by nicolas.vasilache
[mlir][Linalg] Use reify for padded op shape derivation.

Previously, we would insert a DimOp and rely on later canonicalizations.
Unfortunately, reifyShape kind of rewrites are not canonicalizations anymore.
This introduces undesirable pass dependencies.

Instead, immediately reify the result shape and avoid the DimOp altogether.
This is akin to a local folding, which avoids introducing more reliance on `-resolve-shaped-type-result-dims` (similar to compositions of `affine.apply` by construction to avoid chains of size > 1).

It does not completely get rid of the reliance on the pass as the process is merely local: calling the pass may still be necessary for global effects. Indeed, one of the tests still requires the pass.

Differential Revision: https://reviews.llvm.org/D109571
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
The file was modifiedmlir/test/Dialect/Linalg/tile-pad-tensor-op.mlir
Commit 8008009fd25bf51c2c85c612bfefec64e975bbe4 by olemarius.strohm
[OpenCL] Initialize temporaries in the private address space

This patch fixes initializing temporaries, which are currently initialized
without an address space, meaning that no constructor can ever be applicable.
Now they will be constructed in the private addrspace.

Fixes the second issue in PR43296.

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D107553
The file was modifiedclang/include/clang/Sema/Initialization.h
The file was modifiedclang/test/SemaOpenCLCXX/addrspace-constructors.clcpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was addedclang/test/SemaOpenCLCXX/temporaries.clcpp
Commit ec6c847179fd019acae4d97a18f9e7d3961a6fdf by andrew.savonichev
[clang] Check unsupported types in expressions

The patch adds missing diagnostics for cases like:

  float F3 = ((__float128)F1 * (__float128)F2) / 2.0f;

Sema::checkDeviceDecl (renamed to checkTypeSupport) is changed to work
with a type without the corresponding ValueDecl. It is also refactored
so that host diagnostics for unsupported types can be added here as
well.

Differential Revision: https://reviews.llvm.org/D109315
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/test/CodeGen/ibm128-unsupported.c
The file was modifiedclang/test/SemaSYCL/float128.cpp
The file was modifiedclang/lib/Sema/Sema.cpp
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/test/SemaSYCL/int128.cpp
The file was modifiedclang/test/OpenMP/nvptx_unsupported_type_messages.cpp
Commit dfc68591a6b071a6583ec8fbf982683e1689f0b9 by llvmgnsyncbot
[gn build] Port 0213d7ec0c50
The file was modifiedllvm/utils/gn/secondary/clang/unittests/StaticAnalyzer/BUILD.gn
Commit 6377426b4a326b52733065609a5d811afd2b8b1b by andrew.savonichev
Revert "[clang] Check unsupported types in expressions"

This reverts commit ec6c847179fd019acae4d97a18f9e7d3961a6fdf.

Fails on check-openmp:

/b/1/openmp-clang-x86_64-linux-debian/llvm.build/projects/openmp/runtime/test/lock/Output/omp_init_lock.c.tmp
--
Exit Code: -11
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/test/SemaSYCL/int128.cpp
The file was modifiedclang/test/SemaSYCL/float128.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/lib/Sema/Sema.cpp
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/test/CodeGen/ibm128-unsupported.c
The file was modifiedclang/test/OpenMP/nvptx_unsupported_type_messages.cpp
Commit 5d070c8259ac64355a5b5d3fd28710a335c2a16f by Tim Northover
SwiftAsync: use runtime-provided flag for extended frame if back-deploying

When back-deploying Swift async code we can't always toggle the flag showing an
extended frame is present because it will confuse unwinders on systems released
before this feature. So in cases where the code might run there, we `or` in a
mask provided by the runtime (as an absolute symbol) telling us whether the
unwinders can cope.

When deploying only for newer OSs, we can still hard-code the bit-set for
greater efficiency.
The file was modifiedllvm/lib/Target/AArch64/AArch64FrameLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/swift-async.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64Subtarget.h
The file was modifiedllvm/test/CodeGen/AArch64/swift-async.ll
The file was addedllvm/test/CodeGen/AArch64/swift-dynamic-async-frame.ll
The file was modifiedllvm/lib/Target/X86/X86FrameLowering.cpp
The file was modifiedllvm/lib/Target/X86/X86Subtarget.h
The file was addedllvm/test/CodeGen/X86/swift-dynamic-async-frame.ll
Commit 648feabc65d8ec20e5d39ac88e019d310955a6e6 by thakis
[clang] Make the driver not diagnose errors on nonexistent linker inputs

When nonexistent linker inputs are passed to the driver, the linker
now errors out, instead of the compiler. If the linker does not run,
clang now emits a "warning: linker input unused" instead of an error
for nonexistent files.

The motivation for this change is that I noticed that
`clang-cl /winsysroot sysroot main.cc ole32.lib` emitted a
"ole32.lib not found" error, even though the linker finds it just fine when
I run `clang-cl /winsysroot sysroot main.cc /link ole32.lib`.

The same problem occurs if running `clang-cl main.cc ole32.lib` in a
non-MSVC shell.

The problem is that DiagnoseInputExistence() only looked for libs in %LIB%,
but MSVCToolChain uses much more involved techniques.

For this particular problem, we could make DiagnoseInputExistence() ask
the toolchain to see if it can find a .lib file, but in general the
driver can't know what the linker will do to find files, so it shouldn't
try. For example, if we implement PR24616, lld-link will look in the
registry to determine a good default for %LIB% if it isn't set.

This is less or a problem for the gcc driver, since .a paths there are
either passed via -l flags (which honor -L), or via a qualified path
(that doesn't honor -L) -- but for example ld.lld's --chroot flag
can also trigger this problem. Without this patch,
`clang -fuse-ld=lld -Wl,--chroot,some/dir /file.o` will complain that
`/file.o` doesn't exist, even though
`clang -fuse-ld=lld -Wl,--chroot,some/dir -Wl,/file.o` succeeds just fine.

This implements rnk's suggestion on the old bug PR27234.

Differential Revision: https://reviews.llvm.org/D109624
The file was modifiedclang/lib/Driver/Driver.cpp
The file was modifiedclang/test/Driver/cl-link.c
The file was modifiedclang/test/Driver/unknown-arg.c
The file was modifiedflang/test/Driver/missing-input.f90
The file was modifiedclang/test/Driver/cl-inputs.c
Commit 96918515827be5732d1016d38767da1870107075 by Stefan Gränitz
[JITLink] Factor out forEachRelocation() function from addRelocations() in ELF Aarch64 backend (NFC)

First step in reducing redundancy in `addRelocations()` implementations across ELF JITLink backends. The patch factors out common logic for ELF relocation traversal into the new helper function `forEachRelocation()` in the `ELFLinkGraphBuilder` base class. For now, this is applied to the Aarch64 implementation. Others may follow soon.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D109516
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.h
The file was modifiedllvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
Commit 9d359f6c738632c6973e9f5328b10bf39b3df55a by kristof.umann
[analyzer] MallocChecker: Add notes from NoOwnershipChangeVisitor only when a function "intents", but doesn't change ownership, enable by default

D105819 Added NoOwnershipChangeVisitor, but it is only registered when an
off-by-default, hidden checker option was enabled. The reason behind this was
that it grossly overestimated the set of functions that really needed a note:

std::string getTrainName(const Train *T) {
  return T->name;
} // note: Retuning without changing the ownership of or deallocating memory
// Umm... I mean duh? Nor would I expect this function to do anything like that...

void foo() {
  Train *T = new Train("Land Plane");
  print(getTrainName(T)); // note: calling getTrainName / returning from getTrainName
} // warn: Memory leak

This patch adds a heuristic that guesses that any function that has an explicit
operator delete call could have be responsible for deallocating the memory that
ended up leaking. This is waaaay too conservative (see the TODOs in the new
function), but it safer to err on the side of too little than too much, and
would allow us to enable the option by default *now*, and add refinements
one-by-one.

Differential Revision: https://reviews.llvm.org/D108753
The file was modifiedclang/include/clang/StaticAnalyzer/Checkers/Checkers.td
The file was modifiedclang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
The file was modifiedclang/test/Analysis/analyzer-config.c
The file was modifiedclang/test/Analysis/NewDeleteLeaks.cpp
Commit b4e787d8f4e4b18f977888c1ece31b0852ace010 by anna
[InstCombining] Refactor checks for TryToSinkInstruction. NFC

Moved out the checks for profitability of TryToSinkInstructions
into a lambda function.
This will also allow us to easily add checks for bailing out if the
transform is not profitable.

Tests-Run: instCombine tests.
The file was modifiedllvm/lib/Transforms/InstCombine/InstructionCombining.cpp
Commit c82dbc2924bd37fc497cdfe581a21810aace608d by pavel
[lldb] Skip TestGuiBasicDebug due to pr51833
The file was modifiedlldb/test/API/commands/gui/basicdebug/TestGuiBasicDebug.py
Commit 4b342268c0af583d0879440849a33f790f04f76f by flo
[VPlan] Add test that requires duplicating recipe for sinking.
The file was modifiedllvm/test/Transforms/LoopVectorize/vplan-sink-scalars-and-merge.ll
Commit 7c9b6a3355ee8226a880edcf88302bc0360f33b5 by springerm
[mlir][linalg] ComprehensiveBufferize: Do not copy InitTensorOps

Do not copy InitTensorOps or casts thereof.

Differential Revision: https://reviews.llvm.org/D109656
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
Commit 4247381e26dd6ec476ef9873f5b7db1e01aad2b6 by muiez
[SystemZ][z/OS] Missing wchar functions libc++

The aim is to add the missing z/OS specific implementations for mbsnrtowcs and wcsnrtombs, as part of libc++.

Differential Revision: https://reviews.llvm.org/D98207
The file was addedlibcxx/src/support/ibm/mbsnrtowcs.cpp
The file was modifiedlibcxx/include/wchar.h
The file was modifiedlibcxx/src/CMakeLists.txt
The file was addedlibcxx/src/support/ibm/wcsnrtombs.cpp
Commit dd5808330484ad3b82ba92ae1a249127b0e0bbb4 by mgorny
[lldb] [test] Remove parent output checks from follow-child tests

Remove the parent output checks, as they make the test flaky while
serving no real purpose.  If the parent crashed/hanged, it will never
resume the child and the test would fail anyway.
The file was modifiedlldb/test/Shell/Subprocess/vfork-follow-child.test
The file was modifiedlldb/test/Shell/Subprocess/fork-follow-child-wp.test
The file was modifiedlldb/test/Shell/Subprocess/vfork-follow-child-softbp.test
The file was modifiedlldb/test/Shell/Subprocess/clone-follow-child-wp.test
The file was modifiedlldb/test/Shell/Subprocess/clone-follow-child.test
The file was modifiedlldb/test/Shell/Subprocess/fork-follow-child.test
The file was modifiedlldb/test/Shell/Subprocess/fork-follow-child-softbp.test
The file was modifiedlldb/test/Shell/Subprocess/vfork-follow-child-wp.test
Commit 80b60580dfb6192ac3105e127a82254880b81305 by thakis
[gn build] (semi-manually) port 4247381e26dd
The file was modifiedllvm/utils/gn/secondary/libcxx/src/BUILD.gn