Changes

Summary

  1. [lldb] [Process/gdb-remote] Alias sp to x31 on AArch64 for gdbserver (details)
  2. [AArch64][SVE] NFC: Remove unnecessary if (details)
  3. [lldb/win] Fix TestIRMemoryMapWindows.test when running tests in git bash (details)
  4. [clang-cl] Add a /diasdkdir flag and make /winsysroot imply it (details)
  5. [OpenCL] Supports optional program scope global variables in C++ for OpenCL 2021 (details)
  6. [ARM][CMSE] Clear the secure fp-registers when using softfp abi. (details)
  7. [ARM] Mitigate the cve-2021-35465 security vulnurability. (details)
  8. [hwasan] print globals in symbolizer-friendly format. (details)
  9. [SLP] Add additional memory versioning tests. (details)
  10. [clang-cl] Fix test after 951f362e256 on systems where default target isn't x86_64 (details)
  11. [NewPM] Use a separate struct for ModuleMemorySanitizerPass (details)
  12. [NewPM] Use a separate struct for ModuleThreadSanitizerPass (details)
  13. [NewPM] Replace 'kasan-module' by 'asan-module<kernel>' (details)
  14. [PowerPC][AIX] Add support for varargs for complex types on AIX (details)
  15. Add a new API seek for the Cursor class in the DataExtractor.cpp (details)
  16. Add a command-line flag to control the Swift extended async  frame info. (details)
  17. Increase expected line number for ExtDebugInfo.cpp (details)
  18. [clangd] Dont work on diags if we are not going to emit (details)
  19. Fix vtbl field addr space (details)
  20. [clangd] PreamblePatch should be no-op if includes arent patched (details)
Commit 47d57547f43c6cf9404268b8a4c2f75c402615c2 by mgorny
[lldb] [Process/gdb-remote] Alias sp to x31 on AArch64 for gdbserver

Alias the "sp" register to "x31" on AArch64 if one is present and does
not have the alt_name.  This is the case when connecting to gdbserver.

Differential Revision: https://reviews.llvm.org/D109695
The file was modifiedlldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABIAArch64.h
Commit 17f1ccc7590872a4fba6b2194f5fa1203b893ba4 by cullen.rhodes
[AArch64][SVE] NFC: Remove unnecessary if
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
Commit 99ece01a0f571f0df129a55bf679f7fbd0b01b75 by thakis
[lldb/win] Fix TestIRMemoryMapWindows.test when running tests in git bash

lit.util.which('link') picks up the wrong link.exe in git bash, leading
to this error:

  # command stderr:
  /usr/bin/link: extra operand '/LIBPATH:C:\\Progra....'
  Try '/usr/bin/link --help' for more information.

Instead, assume that link.exe is next to cl.exe.

Differential Revision: https://reviews.llvm.org/D109832
The file was modifiedlldb/test/Shell/helper/toolchain.py
Commit 951f362e2560fe1c9c05f487107fd9882d45d867 by thakis
[clang-cl] Add a /diasdkdir flag and make /winsysroot imply it

D109708 added "DIA SDK" to our win sysroot for hermetic builds
that use LLVM_ENABLE_DIA_SDK. But the build system still has to
manually pass flags pointing to it.

Since we have a /winsysroot flag, make it look at DIA SDK in
the sysroot.

With this, the following is enough to compile the DIA2Dump example:

out\gn\bin\clang-cl ^
  "sysroot\DIA SDK\Samples\DIA2Dump\DIA2Dump.cpp" ^
  "sysroot\DIA SDK\Samples\DIA2Dump\PrintSymbol.cpp" ^
  "sysroot\DIA SDK\Samples\DIA2Dump\regs.cpp" ^
  /diasdkdir "sysroot\DIA SDK" ^
  ole32.lib oleaut32.lib diaguids.lib

Differential Revision: https://reviews.llvm.org/D109828
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedclang/test/Driver/cl-sysroot.cpp
The file was modifiedclang/lib/Driver/ToolChains/MSVC.cpp
Commit 054e331d9dbd3ce98b19625b75ba38dd9ebc34cc by Justas.Janickas
[OpenCL] Supports optional program scope global variables in C++ for OpenCL 2021

Adds support for macro `__opencl_c_program_scope_global_variables`
in C++ for OpenCL 2021 enabling a respective optional core feature
from OpenCL 3.0.

This change aims to achieve compatibility between C++ for OpenCL
2021 and OpenCL 3.0.

Differential Revision: https://reviews.llvm.org/D109305
The file was modifiedclang/test/SemaOpenCL/storageclass.cl
The file was modifiedclang/include/clang/Basic/OpenCLOptions.h
Commit 61f25daa8d1b69dd5138facd5d57a8e3dfa0c5cc by alexandros.lamprineas
[ARM][CMSE] Clear the secure fp-registers when using softfp abi.

When expanding the non-secure call instruction we are emiting code
to clear the secure floating-point registers only if the targeted
architecture has floating-point support. The potential problem is
when the source code containing non-secure calls are built with
-mfloat-abi=soft but some other part of the system has been built
with -mfloat-abi=softfp (soft and softfp are compatible as they use
the same procedure calling standard). In this case floating-point
registers could leak to non-secure state as the non-secure won't
have cleared them assuming no floating point has been used.

Differential Revision: https://reviews.llvm.org/D109153
The file was modifiedllvm/test/CodeGen/ARM/cmse-clear.ll
The file was modifiedllvm/test/CodeGen/ARM/cmse.ll
The file was modifiedllvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
Commit 1bd5ea968e9262a09512a64bca1624818640bc5b by alexandros.lamprineas
[ARM] Mitigate the cve-2021-35465 security vulnurability.

Recently a vulnerability issue is found in the implementation of VLLDM
instruction in the Arm Cortex-M33, Cortex-M35P and Cortex-M55. If the
VLLDM instruction is abandoned due to an exception when it is partially
completed, it is possible for subsequent non-secure handler to access
and modify the partial restored register values. This vulnerability is
identified as CVE-2021-35465.

The mitigation sequence varies between v8-m and v8.1-m as follows:

v8-m.main
---------
mrs        r5, control
tst        r5, #8       /* CONTROL_S.SFPA */
it         ne
.inst.w    0xeeb00a40   /* vmovne s0, s0 */
1:
vlldm      sp           /* Lazy restore of d0-d16 and FPSCR. */

v8.1-m.main
-----------
vscclrm    {vpr}        /* Clear VPR. */
vlldm      sp           /* Lazy restore of d0-d16 and FPSCR. */

More details on
developer.arm.com/support/arm-security-updates/vlldm-instruction-security-vulnerability

Differential Revision: https://reviews.llvm.org/D109157
The file was modifiedclang/docs/ClangCommandLineReference.rst
The file was addedllvm/test/CodeGen/ARM/cmse-cve-2021-35465-return.ll
The file was modifiedclang/lib/Driver/ToolChains/Arch/ARM.cpp
The file was modifiedllvm/test/CodeGen/ARM/cmse-vlldm-no-reorder.mir
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedllvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp
The file was modifiedllvm/lib/Target/ARM/ARM.td
The file was addedllvm/test/CodeGen/ARM/cmse-cve-2021-35465.ll
The file was addedclang/test/Driver/arm-cmse-cve-2021-35465.c
The file was modifiedllvm/lib/Target/ARM/ARMSubtarget.h
Commit 95ba9f957aa9887c0c1d41948529cfe1fc74d889 by fmayer
[hwasan] print globals in symbolizer-friendly format.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D109698
The file was modifiedcompiler-rt/test/hwasan/TestCases/global.c
The file was modifiedcompiler-rt/lib/hwasan/hwasan_report.cpp
Commit 2f97ff8e7bcf35595682b53fce8ecb7b4aabee6d by flo
[SLP] Add additional memory versioning tests.
The file was modifiedllvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks.ll
The file was addedllvm/test/Transforms/SLPVectorizer/AArch64/memory-runtime-checks-in-loops.ll
Commit 05ea321f716390abda1632cca71dc9441662cf62 by thakis
[clang-cl] Fix test after 951f362e256 on systems where default target isn't x86_64
The file was modifiedclang/test/Driver/cl-sysroot.cpp
Commit ab41eef9aca3ad5e9321e045a57d36e288a75d17 by bjorn.a.pettersson
[NewPM] Use a separate struct for ModuleMemorySanitizerPass

Split MemorySanitizerPass into MemorySanitizerPass (as a function
pass) and ModuleMemorySanitizerPass (as a module pass).
Main reason is to make sure that we have a unique mapping from
ClassName to PassName in the new passmanager framework, making it
possible to correctly identify the passes when dealing with options
such as -print-after and -print-pipeline-passes.

This is a follow-up to D105006 and D105007.
The file was modifiedllvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
The file was modifiedllvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h
The file was modifiedllvm/lib/Passes/PassRegistry.def
The file was modifiedllvm/test/Other/new-pm-print-pipeline.ll
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
Commit 8f8616655c4d643d73601c6bf4b492fb9d3b52c8 by bjorn.a.pettersson
[NewPM] Use a separate struct for ModuleThreadSanitizerPass

Split ThreadSanitizerPass into ThreadSanitizerPass (as a function
pass) and ModuleThreadSanitizerPass (as a module pass).
Main reason is to make sure that we have a unique mapping from
ClassName to PassName in the new passmanager framework, making it
possible to correctly identify the passes when dealing with options
such as -print-after and -print-pipeline-passes.

This is a follow-up to D105006 and D105007.
The file was modifiedllvm/lib/Passes/PassRegistry.def
The file was modifiedllvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h
The file was modifiedllvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
Commit d9fc3d879e6da153f9b892642e2fe28bed6254a7 by bjorn.a.pettersson
[NewPM] Replace 'kasan-module' by 'asan-module<kernel>'

Change the asan-module pass into a MODULE_PASS_WITH_PARAMS in the
pass registry, and add a single parameter called 'kernel' that
can be set instead of having a special pass name 'kasan-module'
to trigger that special pass config.

Main reason is to make sure that we have a unique mapping from
ClassName to PassName in the new passmanager framework, making it
possible to correctly identify the passes when dealing with options
such as -print-after and -print-pipeline-passes.

This is a follow-up to D105006 and D105007.
The file was modifiedllvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was modifiedllvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h
The file was modifiedllvm/lib/Passes/PassRegistry.def
Commit 1b0a71c5fc052322a45a8cb9a9fcaa2c36105b89 by zarko
[PowerPC][AIX] Add support for varargs for complex types on AIX

Remove the previous error and add support for special handling of small
complex types as in PPC64 ELF ABI. As in, generate code to load from
varargs location and pack it in a temp variable, then return a pointer to
the struct.

Reviewed By: sfertile

Differential Revision: https://reviews.llvm.org/D106393
The file was modifiedclang/test/CodeGen/ppc64-varargs-complex.c
The file was addedclang/test/CodeGen/aix32-complex-varargs.c
The file was modifiedclang/lib/CodeGen/TargetInfo.cpp
Commit baa18ee63e83ee534a5844e6219665ce42b57707 by zhijian
Add a new API seek for the Cursor class in the DataExtractor.cpp

Summary:

add a new API seek for the Cursor class in the DataExtractor.cpp

Reviewers: James Henderson, Fangrui Song

Differential Revision: https://reviews.llvm.org/D109603
The file was modifiedllvm/include/llvm/Support/DataExtractor.h
The file was modifiedllvm/unittests/Support/DataExtractorTest.cpp
Commit a773db7d76222ccf4365979e01dd582fd2b5b3df by aschwaighofer
Add a command-line flag to control the Swift extended async  frame info.

Introduce a new command-line flag `-swift-async-fp={auto|always|never}`
that controls how code generation sets the Swift extended async frame
info bit. There are three possibilities:

* `auto`: which determines how to set the bit based on deployment target, either
statically or dynamically via `swift_async_extendedFramePointerFlags`.
* `always`: the default, always set the bit statically, regardless of deployment
target.
* `never`: never set the bit, regardless of deployment target.

Patch by Doug Gregor <dgregor@apple.com>

Reviewed By: doug.gregor

Differential Revision: https://reviews.llvm.org/D109392
The file was modifiedllvm/test/CodeGen/AArch64/swift-dynamic-async-frame.ll
The file was modifiedllvm/include/llvm/CodeGen/CommandFlags.h
The file was modifiedllvm/lib/CodeGen/CommandFlags.cpp
The file was modifiedllvm/test/CodeGen/X86/swift-dynamic-async-frame.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64FrameLowering.cpp
The file was modifiedllvm/include/llvm/Target/TargetOptions.h
The file was modifiedllvm/lib/Target/X86/X86FrameLowering.cpp
Commit 45a738363ee39754a0e93d9f779bda2cad83fa18 by Jake.Egan
Increase expected line number for ExtDebugInfo.cpp

This patch increases the expected line number for one of the checks so that it doesn't have to be updated for any added/removed lines in the RUN section.

This change is in preparation for the following patch: https://reviews.llvm.org/D109060

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D109541
The file was modifiedclang/test/Modules/ExtDebugInfo.cpp
Commit ea79b77da3eeba926e16c3dd8a4f6626c139e185 by kadircet
[clangd] Dont work on diags if we are not going to emit

Don't install clang-tidy checks and IncludeFixer or process clang diags
when they're going to be dropped. Also disables analysis for some
warnings completely.

Differential Revision: https://reviews.llvm.org/D109884
The file was modifiedclang-tools-extra/clangd/unittests/ParsedASTTests.cpp
The file was modifiedclang-tools-extra/clangd/ParsedAST.cpp
Commit abe8b354e37d8d6a163a6402d8e68ddcfc462dfc by Yaxun.Liu
Fix vtbl field addr space

Storing the vtable field of an object should use the same address space as
the this pointer. Currently it is assumed to be addr space 0 but this may not
be true.

This assumption (added in 054cc3b1b469de4b0cb25d1dc3af43c679c5dc44) caused
issues for the out-of-tree CHERI targets.

Reviewed by: John McCall, Alexander Richardson

Differential Revision: https://reviews.llvm.org/D109841
The file was modifiedclang/lib/CodeGen/CGClass.cpp
Commit 64fe0458866d7bcadacb776a1fa7d827ba8ab916 by kadircet
[clangd] PreamblePatch should be no-op if includes arent patched

Don't create a useless functional patch with only filename in it when
there is only include directives to be patched but they're not
requested.

Differential Revision: https://reviews.llvm.org/D109880
The file was modifiedclang-tools-extra/clangd/Preamble.cpp
The file was modifiedclang-tools-extra/clangd/unittests/PreambleTests.cpp