Changes

Summary

  1. [IRBuilder] Migrate select-folding to value-based FoldSelect. (details)
  2. [SelectionDAG][VP] Add splitting/widening for VP_LOAD and VP_STORE (details)
  3. [BOLT][CMAKE] Accept BOLT_CLANG_EXE and BOLT_LLD_EXE (details)
  4. [libc++] Adds tests for LWG-3373. (details)
  5. [X86] LowerFunnelShift - enable vXi32 handling (details)
  6. [LoopUtils] Use InstSimplifyFolder in addRuntimeChecks. (details)
  7. [AttrBuilder] Remove empty() / td_empty() methods (details)
  8. [compiler-rt][cmake] Fix clang-cl warnings introduced in ae4c643bcdf2 (details)
  9. Silence warning with MSVC. (details)
  10. [AttrBuilder] Remove non-const td_attrs() (details)
  11. [libc++] Normalize some whitespace in preparation for D116570. NFC. (details)
  12. [flang] Fold SCALE() (details)
  13. [lldb] Remove PlatformDarwin::GetCompatibleArch helper (details)
  14. [lldb] Remove anon struct from frame-var-anon-unions test (details)
  15. [lldb] Correctly display the number of types found (details)
  16. [CMake][LLDB] Resolve install conflict when `LLDB_BUILD_FRAMEWORK=ON` (details)
  17. [ELF] Make some diagnostics follow the convention (details)
  18. [libc++] Add _LIBCPP_HIDE_FROM_ABI to in_in_result (details)
  19. Disable the MLIR ExecutionEngine library when the native target is not configured (details)
  20. [lldb] Use PlatformMacOSX for Mac Catalyst (details)
  21. [AArch64] clang support for Armv8.8/9.3 MOPS (details)
  22. [AttrBuilder] Remove ctor accepting AttributeList and Index (details)
  23. [lldb] Set result error state in 'frame variable' (details)
  24. [RISCV] Add RISCVISD::BFPW to ComputeNumSignBitsForTargetNode. (details)
  25. [SelectionDAG] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D117235 (details)
  26. [ELF] Simplify elf::link exit. NFC (details)
Commit ba3198cfd11443b214eec43a03f292a66040fbca by flo
[IRBuilder] Migrate select-folding to value-based FoldSelect.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D117228
The file was modifiedllvm/lib/IR/IRBuilder.cpp
The file was modifiedllvm/include/llvm/Analysis/TargetFolder.h
The file was modifiedllvm/include/llvm/IR/ConstantFolder.h
The file was modifiedllvm/include/llvm/IR/IRBuilderFolder.h
The file was modifiedllvm/include/llvm/Analysis/InstSimplifyFolder.h
The file was modifiedllvm/test/Transforms/LoopVectorize/pr34681.ll
The file was modifiedllvm/include/llvm/IR/NoFolder.h
Commit 877d1b3d0770d7ce26791224088025993f89721c by fraser
[SelectionDAG][VP] Add splitting/widening for VP_LOAD and VP_STORE

Original patch by @hussainjk.

This patch was split off from D109377 to keep vector legalization
(widening/splitting) separate from vector element legalization
(promoting).

While the original patch added a third overload of
SelectionDAG::getVPStore, this patch takes the liberty of collapsing
those all down to 1, as three overloads seems excessive for a
little-used node.

The original patch also used ModifyToType in places, but that method
still crashes on scalable vector types. Seeing as the other VP
legalization methods only work when all operands need identical
widening, this patch follows in that vein.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D117235
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpstore.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/vpload.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpload.ll
The file was modifiedllvm/test/CodeGen/RISCV/rvv/vpstore.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
The file was modifiedllvm/include/llvm/CodeGen/SelectionDAG.h
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
Commit de3e3fcfa3bb0c2585a0395a2f42ab0ec755690b by aaupov
[BOLT][CMAKE] Accept BOLT_CLANG_EXE and BOLT_LLD_EXE

Add CMake options to supply clang and lld binaries for use in check-bolt
instead of requiring the build of clang and lld projects.

Suggested by Mehdi Amini in https://lists.llvm.org/pipermail/llvm-dev/2021-December/154426.html

Test Plan:
```
cmake -G Ninja ~/local/llvm-project/llvm \
-DLLVM_TARGETS_TO_BUILD="X86"  \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_PROJECTS="bolt"  \
-DBOLT_CLANG_EXE=~/local/bin/clang \
-DBOLT_LLD_EXE=~/local/bin/lld

ninja check-bolt
...
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /home/aaupov/local/bin/clang
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using ld.lld: /home/aaupov/local/bin/ld.lld
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld-link: /home/aaupov/local/bin/lld-link
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using ld64.lld: /home/aaupov/local/bin/ld64.lld
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using wasm-ld: /home/aaupov/local/bin/wasm-ld
...
```

Tested all configurations:
- LLVM_ENABLE_PROJECTS="bolt;clang;lld" + no BOLT_*_EXE
- LLVM_ENABLE_PROJECTS="bolt;clang" + BOLT_LLD_EXE
- LLVM_ENABLE_PROJECTS="bolt;lld" + BOLT_CLANG_EXE
- LLVM_ENABLE_PROJECTS="bolt" + BOLT_CLANG_EXE + BOLT_LLD_EXE
- LLVM_ENABLE_PROJECTS="bolt;clang;lld" + BOLT_CLANG_EXE + BOLT_LLD_EXE

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D117061
The file was modifiedbolt/test/lit.cfg.py
The file was modifiedbolt/CMakeLists.txt
The file was modifiedbolt/test/CMakeLists.txt
The file was modifiedbolt/test/lit.site.cfg.py.in
Commit 3ba96cb2c94904ab68a59cfd2391846f1e9b9902 by koraq
[libc++] Adds tests for LWG-3373.

The code in libc++ already satisfy the requirements of LWG-3373. Since
the issue was written to specifically allow the types to be used in
structured bindings, tests have been added to validate the new
requirement.

Implements
LWG-3373 {to,from}_chars_result and format_to_n_result need the "we really mean what we say" wording

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D117337
The file was addedlibcxx/test/std/utilities/format/format.syn/format_to_n_result.pass.cpp
The file was modifiedlibcxx/test/std/utilities/charconv/charconv.syn/to_chars_result.pass.cpp
The file was modifiedlibcxx/docs/Status/Cxx20Issues.csv
The file was modifiedlibcxx/test/std/utilities/charconv/charconv.syn/from_chars_result.pass.cpp
Commit c41ca1be7dbb38cee0284620ce1d60b71e8e04f7 by llvm-dev
[X86] LowerFunnelShift - enable vXi32 handling
The file was modifiedllvm/test/CodeGen/X86/vector-fshr-512.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/vector-fshl-512.ll
The file was modifiedllvm/test/CodeGen/X86/vector-fshr-128.ll
The file was modifiedllvm/test/CodeGen/X86/vector-fshr-256.ll
The file was modifiedllvm/test/CodeGen/X86/vector-fshl-128.ll
The file was modifiedllvm/test/CodeGen/X86/vector-fshl-256.ll
Commit e00158ed5c5dfd15497751941b740f814de065ac by flo
[LoopUtils] Use InstSimplifyFolder in addRuntimeChecks.

Use the InstSimplifyFolder introduced earlier to perform initial
simplification during runtime check construction.
The file was modifiedllvm/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedllvm/test/Transforms/LoopVersioning/bound-check-partially-known.ll
Commit d1675e494411050bd3b56ae55ff9c6fd93349c37 by nikita.ppv
[AttrBuilder] Remove empty() / td_empty() methods

The empty() method is a footgun: It only checks whether there are
non-string attributes, which is not at all obvious from its name,
and of dubious usefulness. td_empty() is entirely unused.

Drop these methods in favor of hasAttributes(), which checks
whether there are any attributes, regardless of whether these are
string or enum attributes.
The file was modifiedllvm/lib/Transforms/Utils/InlineFunction.cpp
The file was modifiedllvm/include/llvm/IR/Attributes.h
Commit 7fcc44bca4b8d3326982692b30d8b6ea8a91db56 by alexandre.ganea
[compiler-rt][cmake] Fix clang-cl warnings introduced in ae4c643bcdf2

See report in https://reviews.llvm.org/D116872#3245667
The file was modifiedcompiler-rt/lib/asan/CMakeLists.txt
The file was modifiedcompiler-rt/lib/ubsan/CMakeLists.txt
The file was modifiedcompiler-rt/lib/interception/CMakeLists.txt
Commit 5d5d806e7b95d8a99d5628d113d8ecd33b2b289f by alexandre.ganea
Silence warning with MSVC.

Fixes:

[2587/4073] Building CXX object projects\compiler-rt\lib\sanitizer_common\CMakeFiles\RTSanitizerCommon.x86_64.dir\sanitizer_stoptheworld_win.cpp.obj
D:\git\llvm-project\compiler-rt\lib\sanitizer_common\sanitizer_stoptheworld_win.cpp(125,33): warning: comparison of integers of different signs: 'DWORD' (aka 'unsigned long') and 'int' [-Wsign-compare]
      if (SuspendThread(thread) == -1) {
          ~~~~~~~~~~~~~~~~~~~~~ ^  ~~
1 warning generated.
The file was modifiedcompiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_win.cpp
Commit 64590312d4b84e13345a98b9d7d7bbc4e2b0c166 by nikita.ppv
[AttrBuilder] Remove non-const td_attrs()

Mutations should happen through appropriate APIs that uphold the
sorting invariant. Exposing a mutable iterator is not necessary.
The file was modifiedllvm/include/llvm/IR/Attributes.h
Commit cba72e4ce215198dffc2b74c929e2faf664d0006 by arthur.j.odwyer
[libc++] Normalize some whitespace in preparation for D116570. NFC.
The file was modifiedlibcxx/include/__memory/ranges_uninitialized_algorithms.h
The file was modifiedlibcxx/include/__memory/ranges_construct_at.h
Commit 5c5bde1bb6e451e0014067802bc6a9d7b1314636 by pklausler
[flang] Fold SCALE()

Fold references to the intrinsic function SCALE().

(Also work around some MSVC headaches somehow exposed by
this patch: disable a bogus MSVC warning that began to appear
in unrelated source files, and avoid the otherwise-necessary
use of the "template" keyword in a call to a template member
function of a class template.)

Differential Revision: https://reviews.llvm.org/D117150
The file was modifiedflang/test/Evaluate/errors01.f90
The file was modifiedflang/lib/Evaluate/fold-integer.cpp
The file was modifiedflang/lib/Evaluate/formatting.cpp
The file was modifiedflang/lib/Evaluate/expression.cpp
The file was modifiedflang/lib/Evaluate/constant.cpp
The file was modifiedflang/lib/Evaluate/fold-real.cpp
The file was modifiedflang/lib/Evaluate/variable.cpp
The file was modifiedflang/lib/Evaluate/fold-character.cpp
The file was modifiedflang/lib/Evaluate/fold-logical.cpp
The file was modifiedflang/include/flang/Evaluate/real.h
The file was addedflang/test/Evaluate/fold-scale.f90
The file was modifiedflang/lib/Evaluate/fold-complex.cpp
Commit ff85dcb1c5b01411a6f9f2dc4c0e087467411f50 by Jonas Devlieghere
[lldb] Remove PlatformDarwin::GetCompatibleArch helper

This also removes the corresponding unit tests. I wrote them to sanity
check my original refactoring and checked them in because why not. The
current implementation, without the added complexity of indices, is
simple enough that we can do without it.
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
The file was modifiedlldb/unittests/Platform/PlatformDarwinTest.cpp
Commit a7e7f541c0813e9d3f6c641ad8ff89619ec749d8 by davelee.com
[lldb] Remove anon struct from frame-var-anon-unions test

This test for anonymous unions seems off. It tests the following:

```
union {
  // fields
};

struct {
  // fields
} var{...};
```

Both are anonymous types, but the first does not declare a variable and the
second one does. The test then checks that `frame var` can directly access the
fields of the anonymous union, but can't directly access the fields of the
anonymous struct variable.

The second test, to directly access the members of the struct variable, seems
pointless as similar code would not compile. A demonstration:

```
struct {
  int a;
  int z;
} a_z{23, 45};

printf("%d\n", a_z.a); // fine
printf("%d\n", a); // this does not compile
```

Since we can't directly access the fields in code, I'm not sure there's a
reason to test that lldb also can't directly access them (other than perhaps as
a regression test).

Differential Revision: https://reviews.llvm.org/D116863
The file was modifiedlldb/test/API/lang/cpp/frame-var-anon-unions/main.cpp
The file was modifiedlldb/test/API/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
Commit a6469cdbc426437dcb8442ae398f0a863336de37 by Jonas Devlieghere
[lldb] Correctly display the number of types found

Correctly display the number of types found for `target modules lookup
--type` and add a test.

Fixes #53219
The file was modifiedlldb/source/Commands/CommandObjectTarget.cpp
The file was modifiedlldb/test/API/commands/target/basic/TestTargetCommand.py
Commit 62af3eb2599d91c6d6f4f02ccae2d47d106be64e by Jonas Devlieghere
[CMake][LLDB] Resolve install conflict when `LLDB_BUILD_FRAMEWORK=ON`

Try to fix https://github.com/llvm/llvm-project/issues/108

Install python scripts into canonical resource path

Differential revision: https://reviews.llvm.org/D116853
The file was modifiedlldb/bindings/python/CMakeLists.txt
Commit 8b2f33231c2a9f774481aae57298420f7ade989f by i
[ELF] Make some diagnostics follow the convention
The file was modifiedlld/test/ELF/x86-64-split-stack-prologue-adjust-fail.s
The file was modifiedlld/ELF/InputSection.cpp
The file was modifiedlld/ELF/Arch/X86_64.cpp
Commit d3e49a41b19792c32578fcade2adae39e187fc98 by nikolasklauser
[libc++] Add _LIBCPP_HIDE_FROM_ABI to in_in_result

Add `_LIBCPP_HIDE_FROM_ABI` to `in_in_result` conversion operators

Reviewed By: Quuxplusone, Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D117399
The file was modifiedlibcxx/include/__algorithm/in_in_result.h
Commit 772f7b87f8cc040203476e3cc6e6164473349a26 by joker.eph
Disable the MLIR ExecutionEngine library when the native target is not configured

The execution engine would not be functional anyway, we're already
disabling the tests, this also disable the rest of the code.

Anecdotally this reduces the number of static library built when the
builtin target is disabled goes from 236 to 218.

Here is the complete list of LLVM targets built when running
`ninja check-mlir`:

libLLVMAggressiveInstCombine.a
libLLVMAnalysis.a
libLLVMAsmParser.a
libLLVMBinaryFormat.a
libLLVMBitReader.a
libLLVMBitstreamReader.a
libLLVMBitWriter.a
libLLVMCore.a
libLLVMDebugInfoCodeView.a
libLLVMDebugInfoDWARF.a
libLLVMDemangle.a
libLLVMFileCheck.a
libLLVMFrontendOpenMP.a
libLLVMInstCombine.a
libLLVMIRReader.a
libLLVMMC.a
libLLVMMCParser.a
libLLVMObject.a
libLLVMProfileData.a
libLLVMRemarks.a
libLLVMScalarOpts.a
libLLVMSupport.a
libLLVMTableGen.a
libLLVMTableGenGlobalISel.a
libLLVMTextAPI.a
libLLVMTransformUtils.a

Differential Revision: https://reviews.llvm.org/D117287
The file was modifiedmlir/lib/CMakeLists.txt
The file was modifiedmlir/lib/CAPI/CMakeLists.txt
The file was modifiedmlir/test/CAPI/CMakeLists.txt
The file was modifiedmlir/test/CMakeLists.txt
The file was modifiedmlir/python/CMakeLists.txt
Commit 0b010ef7b653bbc9f4beef6b03e877911d206de6 by Jonas Devlieghere
[lldb] Use PlatformMacOSX for Mac Catalyst

Use PlatformMacOSX for Mac Catalyst apps on both Intel (x86) and Apple
Silicon (arm64).
The file was modifiedlldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
Commit c84b8be516bcc4d021ff804169d58a7b3104e050 by sontuan.vu
[AArch64] clang support for Armv8.8/9.3 MOPS

This introduces clang command line support for the new Armv8.8-A and
Armv9.3-A instructions for standardising memcpy, memset and memmove
operations, which was previously introduced into LLVM in
https://reviews.llvm.org/D116157.

Patch by Lucas Prates, Tomas Matheson and Son Tuan Vu.

Differential Revision: https://reviews.llvm.org/D117271
The file was modifiedllvm/include/llvm/Support/AArch64TargetParser.def
The file was modifiedllvm/unittests/Support/TargetParserTest.cpp
The file was modifiedllvm/lib/Support/AArch64TargetParser.cpp
The file was addedclang/test/Driver/aarch64-mops.c
The file was modifiedclang/lib/Basic/Targets/AArch64.cpp
The file was modifiedclang/lib/Basic/Targets/AArch64.h
The file was modifiedllvm/include/llvm/Support/AArch64TargetParser.h
Commit c63a3175c2947e8c1a2d3bbe16a8586600705c54 by nikita.ppv
[AttrBuilder] Remove ctor accepting AttributeList and Index

Use the AttributeSet constructor instead. There's no good reason
why AttrBuilder itself should exact the AttributeSet from the
AttributeList. Moving this out of the AttrBuilder generally results
in cleaner code.
The file was modifiedllvm/lib/Transforms/Utils/InlineFunction.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
The file was modifiedllvm/lib/CodeGen/Analysis.cpp
The file was modifiedllvm/lib/IR/Attributes.cpp
The file was modifiedllvm/lib/Transforms/Utils/CallPromotionUtils.cpp
The file was modifiedllvm/include/llvm/IR/Attributes.h
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedllvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
Commit 696f9706f34d76bca8f8d496eabe1a67b60e8a54 by davelee.com
[lldb] Set result error state in 'frame variable'

Ensure that errors in `frame variable` are reflected in result object.

The statistics for `frame variable` show invocations as being successful, even
when executing one of the error paths.

This change replaces `result.GetErrorStream()` with `result.AppendError()`,
which also sets the status to `eReturnStatusFailed`.

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

Recommitting after D116901 and D116863.

(cherry picked from commit 2c7d10c41278181e3e45c68f28b501cd95193a8a)
The file was modifiedlldb/source/Commands/CommandObjectFrame.cpp
Commit 4c1e1e05cb901a2ed9055e5d6ac6ce60b826a288 by craig.topper
[RISCV] Add RISCVISD::BFPW to ComputeNumSignBitsForTargetNode.
The file was modifiedllvm/lib/Target/RISCV/RISCVISelLowering.cpp
The file was modifiedllvm/test/CodeGen/RISCV/rv64zbf-intrinsic.ll
Commit 545624973628dfca1b7f86b039e0d81afc397eb8 by i
[SelectionDAG] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after D117235
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
Commit 102d0a2bafc76f1e8d1754ce55dad0faefb5e030 by i
[ELF] Simplify elf::link exit. NFC
The file was modifiedlld/ELF/Driver.cpp