SuccessChanges

Summary

  1. [libc] add back math.h #include utils/FPUtil/ManipulationFunctions.h (details)
  2. [X86] Add X86ISD::SUBV_BROADCAST_LOAD and begin removing X86ISD::SUBV_BROADCAST (PR38969) (details)
  3. Make LLVM build in C++20 mode (details)
  4. [lldb] Add std::array to the supported template list of the CxxModuleHandler (details)
  5. fix a -Wunused-variable warning in release build (details)
  6. [X86] Remove extract_subvector(subv_broadcast_load()) fold. (details)
  7. [NFC] Reduce include files dependency and AA header cleanup (part 2). (details)
  8. [SVE][CodeGen] Add bfloat16 support to scalable masked gather (details)
  9. [mlir] partially update LLVM dialect documentation (details)
  10. [mlir] Move LLVM Dialect Op documentation to ODS (details)
  11. [libcxx] Remove ifdefs in the message to static_assert. NFC. (details)
  12. [AArch64] Renamed sve-masked-scatter-legalise.ll. NFC. (details)
  13. [clangd] Add llvm:: qualifier to work around GCC bug. NFC (details)
  14. [DebugInfo] Fix MSVC build by adding back necessary reverse_iterator != operator (details)
Commit 352cba2441c6c4e00f067c9c68358cc0a6a5fffb by krasimir
[libc] add back math.h #include utils/FPUtil/ManipulationFunctions.h

This partially reverts cee1e7d14f4628d6174b33640d502bff3b54ae45:
  [libc][NFC][Obvious] Remove few unnecessary #include directives in tests.

That commit causes a test failure in our configuration:
[ RUN      ] ILogbTest.SpecialNumbers_ilogb
third_party/llvm/llvm-project/libc/test/src/math/ILogbTest.h:28: FAILURE
      Expected: FP_ILOGBNAN
      Which is: 2147483647
To be equal to: func(__llvm_libc::fputil::FPBits<T>::buildNaN(1))
      Which is: -2147483648
The file was modifiedlibc/utils/FPUtil/ManipulationFunctions.h
Commit cdb692ee0c6745ea008ee6cc00fe1e65021516bb by llvm-dev
[X86] Add X86ISD::SUBV_BROADCAST_LOAD and begin removing X86ISD::SUBV_BROADCAST (PR38969)

Subvector broadcasts are only load instructions, yet X86ISD::SUBV_BROADCAST treats them more generally, requiring a lot of fallback tablegen patterns.

This initial patch replaces constant vector lowering inside lowerBuildVectorAsBroadcast with direct X86ISD::SUBV_BROADCAST_LOAD loads which helps us merge a number of equivalent loads/broadcasts.

As well as general plumbing/analysis additions for SUBV_BROADCAST_LOAD, I needed to wrap SelectionDAG::makeEquivalentMemoryOrdering so it can handle result chains from non generic LoadSDNode nodes.

Later patches will continue to replace X86ISD::SUBV_BROADCAST usage.

Differential Revision: https://reviews.llvm.org/D92645
The file was modifiedllvm/include/llvm/CodeGen/SelectionDAG.h
The file was modifiedllvm/lib/Target/X86/X86InstrAVX512.td
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.h
The file was modifiedllvm/lib/Target/X86/X86InstrSSE.td
The file was modifiedllvm/test/CodeGen/X86/subvector-broadcast.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
The file was modifiedllvm/test/CodeGen/X86/broadcast-elm-cross-splat-vec.ll
The file was modifiedllvm/lib/Target/X86/X86InstrFragmentsSIMD.td
Commit 92310454bf0f1f9686f38afd11756c7d046495c9 by nunoplopes
Make LLVM build in C++20 mode

Part of the <=> changes in C++20 make certain patterns of writing equality
operators ambiguous with themselves (sorry!).
This patch goes through and adjusts all the comparison operators such that
they should work in both C++17 and C++20 modes. It also makes two other small
C++20-specific changes (adding a constructor to a type that cases to be an
aggregate, and adding casts from u8 literals which no longer have type
const char*).

There were four categories of errors that this review fixes.
Here are canonical examples of them, ordered from most to least common:

// 1) Missing const
namespace missing_const {
    struct A {
    #ifndef FIXED
        bool operator==(A const&);
    #else
        bool operator==(A const&) const;
    #endif
    };

    bool a = A{} == A{}; // error
}

// 2) Type mismatch on CRTP
namespace crtp_mismatch {
    template <typename Derived>
    struct Base {
    #ifndef FIXED
        bool operator==(Derived const&) const;
    #else
        // in one case changed to taking Base const&
        friend bool operator==(Derived const&, Derived const&);
    #endif
    };

    struct D : Base<D> { };

    bool b = D{} == D{}; // error
}

// 3) iterator/const_iterator with only mixed comparison
namespace iter_const_iter {
    template <bool Const>
    struct iterator {
        using const_iterator = iterator<true>;

        iterator();

        template <bool B, std::enable_if_t<(Const && !B), int> = 0>
        iterator(iterator<B> const&);

    #ifndef FIXED
        bool operator==(const_iterator const&) const;
    #else
        friend bool operator==(iterator const&, iterator const&);
    #endif
    };

    bool c = iterator<false>{} == iterator<false>{} // error
          || iterator<false>{} == iterator<true>{}
          || iterator<true>{} == iterator<false>{}
          || iterator<true>{} == iterator<true>{};
}

// 4) Same-type comparison but only have mixed-type operator
namespace ambiguous_choice {
    enum Color { Red };

    struct C {
        C();
        C(Color);
        operator Color() const;
        bool operator==(Color) const;
        friend bool operator==(C, C);
    };

    bool c = C{} == C{}; // error
    bool d = C{} == Red;
}

Differential revision: https://reviews.llvm.org/D78938
The file was modifiedllvm/tools/llvm-objdump/llvm-objdump.cpp
The file was modifiedllvm/include/llvm/ADT/StringMap.h
The file was modifiedllvm/include/llvm/CodeGen/DIE.h
The file was modifiedllvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h
The file was modifiedllvm/include/llvm/Support/BinaryStreamRef.h
The file was modifiedllvm/lib/IR/Attributes.cpp
The file was modifiedllvm/include/llvm/ADT/AllocatorList.h
The file was modifiedllvm/include/llvm/ADT/DenseSet.h
The file was modifiedllvm/lib/Transforms/Scalar/GVNHoist.cpp
The file was modifiedllvm/include/llvm/IR/BasicBlock.h
The file was modifiedllvm/unittests/ADT/STLExtrasTest.cpp
The file was modifiedllvm/include/llvm/ADT/DirectedGraph.h
The file was modifiedllvm/include/llvm/ADT/STLExtras.h
The file was modifiedclang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp
The file was modifiedclang/include/clang/AST/StmtIterator.h
The file was modifiedllvm/include/llvm/ADT/DenseMap.h
The file was modifiedllvm/lib/CodeGen/PeepholeOptimizer.cpp
The file was modifiedllvm/include/llvm/Object/StackMapParser.h
The file was modifiedllvm/include/llvm/ADT/iterator.h
The file was modifiedllvm/include/llvm/Support/SuffixTree.h
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFExpression.h
The file was modifiedllvm/include/llvm/ProfileData/InstrProfReader.h
The file was modifiedllvm/include/llvm/CodeGen/LiveInterval.h
The file was modifiedllvm/lib/ObjectYAML/DWARFEmitter.cpp
The file was modifiedclang/lib/Parse/ParseOpenMP.cpp
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFDie.h
The file was modifiedllvm/include/llvm/IR/Attributes.h
Commit b8338983e6f6ec6ebd48a7fc640b5d859e653b27 by Raphael Isemann
[lldb] Add std::array to the supported template list of the CxxModuleHandler

Identical to the other patches that add STL containers to the supported
templated list.
The file was addedlldb/test/API/commands/expression/import-std-module/array/main.cpp
The file was addedlldb/test/API/commands/expression/import-std-module/array/Makefile
The file was addedlldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
The file was modifiedlldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp
Commit e71a4cc20789f66470d69cbe32626761da642130 by krasimir
fix a -Wunused-variable warning in release build
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Commit 931e66bd899cbc10822fd80e7447eb3df0db1176 by llvm-dev
[X86] Remove extract_subvector(subv_broadcast_load()) fold.

This was needed in an earlier version of D92645, but isn't now - and I've just noticed that it was potentially flawed depending on the relevant widths of the broadcasted and extracted subvectors.
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit 9ed8e0caab9b6f638e82979f6fdf60d67ce65b92 by dfukalov
[NFC] Reduce include files dependency and AA header cleanup (part 2).

Continuing work started in https://reviews.llvm.org/D92489:

Removed a bunch of includes from "AliasAnalysis.h" and "LoopPassManager.h".

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D92852
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.cpp
The file was modifiedllvm/lib/Transforms/Scalar/Float2Int.cpp
The file was modifiedllvm/lib/Transforms/ObjCARC/ProvenanceAnalysisEvaluator.cpp
The file was modifiedllvm/lib/Transforms/IPO/HotColdSplitting.cpp
The file was modifiedllvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
The file was modifiedllvm/include/llvm/Analysis/BasicAliasAnalysis.h
The file was modifiedllvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
The file was modifiedllvm/lib/Transforms/Utils/LoopRotationUtils.cpp
The file was modifiedllvm/lib/Analysis/MemorySSA.cpp
The file was modifiedllvm/include/llvm/Analysis/MemorySSA.h
The file was modifiedllvm/lib/Target/AMDGPU/SIInstrInfo.cpp
The file was modifiedllvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
The file was modifiedllvm/lib/CodeGen/LiveIntervals.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LoopDistribute.cpp
The file was modifiedllvm/lib/LTO/Caching.cpp
The file was modifiedllvm/lib/Transforms/IPO/FunctionAttrs.cpp
The file was modifiedllvm/include/llvm/Analysis/AliasAnalysis.h
The file was modifiedllvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
The file was modifiedllvm/lib/Transforms/IPO/ArgumentPromotion.cpp
The file was modifiedllvm/tools/opt/NewPMDriver.cpp
The file was modifiedllvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
The file was modifiedllvm/lib/Analysis/ScopedNoAliasAA.cpp
The file was modifiedllvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
The file was modifiedllvm/lib/Passes/PassBuilder.cpp
The file was modifiedllvm/lib/Analysis/AliasAnalysis.cpp
The file was modifiedllvm/examples/Bye/Bye.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LoopPassManager.cpp
The file was modifiedllvm/lib/Transforms/IPO/Inliner.cpp
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp
The file was modifiedllvm/lib/Transforms/Utils/LoopVersioning.cpp
The file was modifiedllvm/include/llvm/Transforms/Scalar/LoopPassManager.h
The file was modifiedllvm/lib/Analysis/MemDepPrinter.cpp
The file was modifiedllvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
The file was modifiedllvm/lib/LTO/LTOBackend.cpp
Commit 6d2a78996bee74611dad55b6c42b828ce1ee0953 by kerry.mclaughlin
[SVE][CodeGen] Add bfloat16 support to scalable masked gather

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D93307
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-gather-32b-unsigned-unscaled.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-gather-64b-unscaled.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-gather-32b-unsigned-scaled.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-gather-64b-scaled.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-scatter-legalise.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-gather-32b-signed-unscaled.ll
The file was modifiedllvm/test/CodeGen/AArch64/sve-masked-gather-32b-signed-scaled.ll
Commit c2751250f33f61e95e5d9feec95e5b063c601806 by zinenko
[mlir] partially update LLVM dialect documentation

Rewrite the parts of the documentation that became stale: context/module
handling and type system. Expand the type system description.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D93315
The file was modifiedmlir/docs/Dialects/LLVM.md
Commit ccdd8c7759459ef4b9b09820d241081d387be779 by zinenko
[mlir] Move LLVM Dialect Op documentation to ODS

This was long overdue. The initial documentation for the LLVM dialect was
introduced before ODS had support for long descriptions. This is now possible,
so the documentation is moved to ODS, which can serve as a single source of
truth. The high-level description of the dialect structure is updated to
reflect that.

Depends On: D93315

Reviewed By: rriddle, mehdi_amini

Differential Revision: https://reviews.llvm.org/D93425
The file was modifiedmlir/docs/Dialects/LLVM.md
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
Commit 08a00c6f43c187f8fb3b08dd98e269fb1fcff836 by martin
[libcxx] Remove ifdefs in the message to static_assert. NFC.

Differential Revision: https://reviews.llvm.org/D93283
The file was modifiedlibcxx/include/filesystem
Commit 7c504b6dd0638c4bad40440060fdebc726dc0c07 by kerry.mclaughlin
[AArch64] Renamed sve-masked-scatter-legalise.ll. NFC.
The file was removedllvm/test/CodeGen/AArch64/sve-masked-scatter-legalise.ll
The file was addedllvm/test/CodeGen/AArch64/sve-masked-scatter-legalize.ll
Commit 894c4761c67ac850e156a26aa427035a811d7aed by sam.mccall
[clangd] Add llvm:: qualifier to work around GCC bug. NFC

Some old GCC versions seem to miss the default template parameter when
using the clang/Basic/LLVM.h forward declarations of SmallVector.

See D92788
The file was modifiedclang-tools-extra/clangd/Headers.h
Commit 2d6b1e9b5f3b6c49c0a7732583c984d8dcbc8a9d by llvm-dev
[DebugInfo] Fix MSVC build by adding back necessary reverse_iterator != operator

Put back the std::reverse_iterator<DWARFDie::iterator> != operator that was removed in D78938 to fix VS2019 builds
The file was modifiedllvm/include/llvm/DebugInfo/DWARF/DWARFDie.h