Changes

Summary

  1. Don't set executable file in ObjectFileMachO::LoadCoreFileImages (details)
  2. [Test] Add test showing missing opportunity in range inference for SCEV (details)
  3. [GlobalISel] Add a combine for and(load , mask) -> zextload (details)
  4. Be more flexible on the storage type allowed for llvm::Any::TypeId::Id (details)
  5. [lldb] Make Platform::DebugProcess take a Target reference (details)
  6. [Analyzer] ConversionChecker: track back the cast expression (details)
  7. [lldb] [DynamicRegisterInfo] Pass name/alt_name via RegisterInfo (details)
  8. [PGO] Change ThinLTO test for targets with loop unrolling disabled (details)
  9. [X86] SimplifyDemandedVectorEltsForTargetNode - add PSADBW handling (details)
  10. [lldb] [Process/gdb-remote] Alias sp to x31 on AArch64 for gdbserver (details)
  11. [AArch64][SVE] NFC: Remove unnecessary if (details)
  12. [lldb/win] Fix TestIRMemoryMapWindows.test when running tests in git bash (details)
  13. [clang-cl] Add a /diasdkdir flag and make /winsysroot imply it (details)
  14. [OpenCL] Supports optional program scope global variables in C++ for OpenCL 2021 (details)
Commit ceded4153245322c45d28068860fb3d8d0a4884d by Jason Molenda
Don't set executable file in ObjectFileMachO::LoadCoreFileImages

When the corefile reader is adding binaries from the "all image
infos" LC_NOTE in a Mach-O corefile, it would detect if the binary
being added was an executable binary and set it as the Target's
executable binary.  This has the side effect of clearing the Target's
image list, so if the executable was in the middle of the all image
infos, the initial images would be dropped.  There's no need to set
the executable binary in the Target for these corefile processes,
so instead of doing multiple passes over the list to find the
executable, I'm dropping that.
The file was modifiedlldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
Commit e4da0f9657b475f62b68a7e7e6cc06855e2f4985 by mkazantsev
[Test] Add test showing missing opportunity in range inference for SCEV
The file was addedllvm/test/Analysis/ScalarEvolution/outer_phi.ll
Commit d2e66d7fa46b14a749ff8686ecccf66292b7bc6b by konstantin.schwarz
[GlobalISel] Add a combine for and(load , mask) -> zextload

This only handles simple masks, not shifted masks, for now.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D109357
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/prelegalizer-combiner-load-and-mask.mir
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/load-local.128.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/load-local.96.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-and.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/ctlz_zero_undef.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/load-constant.96.ll
The file was modifiedllvm/include/llvm/Target/GlobalISel/Combine.td
The file was modifiedllvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
The file was modifiedllvm/test/CodeGen/AMDGPU/ctlz.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/cttz_zero_undef.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/cvt_f32_ubyte.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/GlobalISel/load-unaligned.ll
The file was addedllvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-load-and-mask.mir
The file was modifiedllvm/test/CodeGen/AMDGPU/ds-alignment.ll
Commit 85f2ae57f713cec55f26b40efb82c4ee8845c27a by sguelton
Be more flexible on the storage type allowed for llvm::Any::TypeId::Id

This is a follow-up to 2c42a73d6c39af3833e697c0b306cb8cf8de5143.
The file was modifiedllvm/test/tools/llvm-shlib/typeids.test
Commit bd590a5f895f50ceb7669de1b4a69bbcc8adb38b by pavel
[lldb] Make Platform::DebugProcess take a Target reference

instead of a pointer. There are just two callers of this function, and
both of them have a valid target pointer, so there's no need for all
implementations to concern themselves with whether the pointer is null.
The file was modifiedlldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h
The file was modifiedlldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
The file was modifiedlldb/source/Target/Target.cpp
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
The file was modifiedlldb/source/Commands/CommandObjectPlatform.cpp
The file was modifiedlldb/source/Plugins/Platform/Windows/PlatformWindows.h
The file was modifiedlldb/source/Target/Platform.cpp
The file was modifiedlldb/include/lldb/Target/Platform.h
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
The file was modifiedlldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
The file was modifiedlldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
The file was modifiedlldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
Commit 96ec9b6ff2f0bb9078306e3857f09974603ccbe4 by gabor.marton
[Analyzer] ConversionChecker: track back the cast expression

Adding trackExpressionValue to the checker so it tracks the value of the
implicit cast's DeclRefExpression up to initialization/assignment. This
way the report becomes cleaner.

Differential Revision: https://reviews.llvm.org/D109836
The file was modifiedclang/lib/StaticAnalyzer/Checkers/ConversionChecker.cpp
The file was modifiedclang/test/Analysis/conversion.c
The file was addedclang/test/Analysis/conversion-tracking-notes.c
Commit 86a58f10284dea118703ecde0ef5b9a4f6e4d8be by mgorny
[lldb] [DynamicRegisterInfo] Pass name/alt_name via RegisterInfo

Remove the name and alt_name parameters from AddRegister() and instead
pass them via RegisterInfo.name and .alt_name fields.  This makes
the API simpler and removes some duplication.

Differential Revision: https://reviews.llvm.org/D109872
The file was modifiedlldb/source/Plugins/Process/Utility/DynamicRegisterInfo.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/source/Plugins/Process/Utility/DynamicRegisterInfo.h
Commit 005fc11ebdd6e1af29efee3d7c5da86f56138414 by thomasp
[PGO] Change ThinLTO test for targets with loop unrolling disabled

I am working on a target in a downstream LLVM repo, and it seems that if a target backend chooses to disable loop unrolling this test would fail. A solution would be to modify the test to search for a different string instead.

The specific test checks for `if.true.direct_targ` which appears in the output when thinlto is not used (ie samplepgo). The same is true for `if.false.orig_indirect`.

However, if a target disables loop unrolling in the backend, the test fails as  `if.true.direct_targ` no longer appears, though `if.false.orig_indirect` still does. This can be seen by using a clang pragma to disable loop unrolling in the `unroll()` function.

For reference, the following files are the outputs of the last 2 test functions being compiled as the test case does, with and without thinlto, and with and without loop unrolling on the latest x86 clang build. The loop unrolling pragma was used to simulate the loop unrolling being disabled in a backend.
```
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -o out.ll
// RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample-thinlto-summary.prof %s -emit-llvm -flto=thin -o out.ll
```

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D109234
The file was modifiedclang/test/CodeGen/pgo-sample-thinlto-summary.c
Commit 1ef62cb20028fb7b75c65badcafec8c4703cbda3 by llvm-dev
[X86] SimplifyDemandedVectorEltsForTargetNode - add PSADBW handling

Peek through PSADBW operands to handle non demanded elements.
The file was modifiedllvm/test/CodeGen/X86/sad_variations.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/psadbw.ll
The file was modifiedllvm/test/CodeGen/X86/sad.ll
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/source/Plugins/ABI/AArch64/ABIAArch64.h
The file was modifiedlldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
The file was modifiedlldb/test/API/functionalities/gdb_remote_client/TestGDBServerTargetXML.py
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