git: 83e37ae556b2 - stable/13 - Merge llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Sat, 20 Apr 2024 10:34:37 UTC
The branch stable/13 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=83e37ae556b23e8e91169c618618d28d83ddb61b

commit 83e37ae556b23e8e91169c618618d28d83ddb61b
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-02-07 14:58:02 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-04-19 21:24:46 +0000

    Merge llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967
    
    This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
    openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967.
    
    PR:             276104
    MFC after:      1 month
    
    (cherry picked from commit b3edf4467982447620505a28fc82e38a414c07dc)
---
 .../llvm-project/clang/include/clang/AST/Type.h    |   3 +
 .../clang/include/clang/Basic/AttrDocs.td          |   5 +-
 .../clang/include/clang/Basic/BuiltinsAMDGPU.def   |  62 +++
 .../clang/include/clang/Basic/CodeGenOptions.def   |   3 +
 .../include/clang/Basic/DiagnosticCommonKinds.td   |   2 +-
 .../clang/include/clang/Basic/DiagnosticDocs.td    |   9 +
 .../include/clang/Basic/DiagnosticSemaKinds.td     |   6 +
 .../clang/include/clang/Basic/LangOptions.def      |   1 +
 .../clang/include/clang/Driver/Options.td          |  13 +
 .../clang/include/clang/Format/Format.h            |  43 +-
 .../clang/include/clang/Lex/Preprocessor.h         |  11 +-
 .../llvm-project/clang/include/clang/Sema/Lookup.h |   3 +-
 .../clang/include/clang/Serialization/ASTReader.h  |   6 +
 contrib/llvm-project/clang/lib/AST/ASTContext.cpp  |  20 +-
 .../llvm-project/clang/lib/AST/ExprConstant.cpp    |   9 +-
 .../llvm-project/clang/lib/AST/ItaniumMangle.cpp   |  25 +-
 .../llvm-project/clang/lib/AST/JSONNodeDumper.cpp  |   3 +
 contrib/llvm-project/clang/lib/AST/ODRHash.cpp     |  49 +-
 .../llvm-project/clang/lib/AST/TemplateBase.cpp    |   3 +-
 .../llvm-project/clang/lib/AST/TextNodeDumper.cpp  |   3 +
 contrib/llvm-project/clang/lib/AST/Type.cpp        |  15 +-
 contrib/llvm-project/clang/lib/AST/TypePrinter.cpp |   2 +
 .../clang/lib/Basic/Targets/AArch64.cpp            |  23 +
 .../llvm-project/clang/lib/Basic/Targets/AArch64.h |   1 +
 .../llvm-project/clang/lib/CodeGen/BackendUtil.cpp |   1 +
 .../llvm-project/clang/lib/CodeGen/CGBuiltin.cpp   | 177 +++++++-
 contrib/llvm-project/clang/lib/CodeGen/CGExpr.cpp  |  17 +-
 .../clang/lib/CodeGen/CoverageMappingGen.cpp       |   6 +-
 .../clang/lib/CodeGen/Targets/RISCV.cpp            |  21 +-
 contrib/llvm-project/clang/lib/Driver/Driver.cpp   |   6 +-
 .../clang/lib/Driver/ToolChains/Clang.cpp          |  15 +
 .../clang/lib/Driver/ToolChains/CommonArgs.cpp     |  52 +++
 .../clang/lib/Driver/ToolChains/CommonArgs.h       |   3 +
 contrib/llvm-project/clang/lib/Format/Format.cpp   |  23 +-
 .../clang/lib/Format/TokenAnnotator.cpp            |  11 +-
 .../llvm-project/clang/lib/Lex/PPDirectives.cpp    |   2 +-
 .../llvm-project/clang/lib/Lex/PPExpressions.cpp   |   4 +-
 .../llvm-project/clang/lib/Sema/SemaChecking.cpp   |  55 ++-
 .../llvm-project/clang/lib/Sema/SemaConcept.cpp    |   8 +-
 contrib/llvm-project/clang/lib/Sema/SemaDecl.cpp   |   3 +-
 contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp   |   6 +-
 .../llvm-project/clang/lib/Sema/SemaOverload.cpp   |  44 +-
 .../llvm-project/clang/lib/Sema/SemaTemplate.cpp   |  44 +-
 contrib/llvm-project/clang/lib/Sema/SemaType.cpp   |  21 +-
 .../clang/lib/Serialization/ASTReader.cpp          |   3 +
 .../clang/lib/Serialization/ASTReaderDecl.cpp      |  38 +-
 .../clang/lib/Serialization/ASTWriter.cpp          |   8 +-
 .../clang/lib/Serialization/ASTWriterDecl.cpp      |  13 +-
 .../clang/lib/StaticAnalyzer/Core/Environment.cpp  |   8 +-
 .../compiler-rt/lib/builtins/i386/chkstk.S         |   2 -
 .../compiler-rt/lib/builtins/x86_64/chkstk.S       |   2 -
 .../lib/profile/InstrProfilingPlatformWindows.c    |   2 +-
 .../sanitizer_symbolizer_report.cpp                |   4 +-
 .../libcxx/include/__algorithm/copy_move_common.h  |   5 +
 .../libcxx/include/__algorithm/equal.h             |   5 +
 .../libcxx/include/__algorithm/equal_range.h       |   5 +
 .../llvm-project/libcxx/include/__algorithm/fold.h |   5 +
 .../libcxx/include/__algorithm/in_found_result.h   |   5 +
 .../libcxx/include/__algorithm/in_fun_result.h     |   5 +
 .../libcxx/include/__algorithm/in_in_out_result.h  |   5 +
 .../libcxx/include/__algorithm/in_in_result.h      |   5 +
 .../libcxx/include/__algorithm/in_out_out_result.h |   5 +
 .../libcxx/include/__algorithm/includes.h          |   5 +
 .../libcxx/include/__algorithm/next_permutation.h  |   5 +
 .../libcxx/include/__algorithm/nth_element.h       |   5 +
 .../libcxx/include/__algorithm/partial_sort.h      |   5 +
 .../libcxx/include/__algorithm/partial_sort_copy.h |   5 +
 .../libcxx/include/__algorithm/partition.h         |   5 +
 .../libcxx/include/__algorithm/prev_permutation.h  |   5 +
 .../include/__algorithm/pstl_any_all_none_of.h     |   5 +
 .../pstl_backends/cpu_backends/transform_reduce.h  |   5 +
 .../libcxx/include/__algorithm/pstl_copy.h         |   5 +
 .../libcxx/include/__algorithm/pstl_count.h        |   5 +
 .../libcxx/include/__algorithm/pstl_equal.h        |   5 +
 .../libcxx/include/__algorithm/pstl_fill.h         |   5 +
 .../libcxx/include/__algorithm/pstl_find.h         |   5 +
 .../libcxx/include/__algorithm/pstl_for_each.h     |   5 +
 .../libcxx/include/__algorithm/pstl_generate.h     |   5 +
 .../include/__algorithm/pstl_is_partitioned.h      |   5 +
 .../libcxx/include/__algorithm/pstl_merge.h        |   5 +
 .../libcxx/include/__algorithm/pstl_move.h         |   5 +
 .../libcxx/include/__algorithm/pstl_replace.h      |   5 +
 .../libcxx/include/__algorithm/pstl_rotate_copy.h  |   5 +
 .../libcxx/include/__algorithm/pstl_sort.h         |   5 +
 .../libcxx/include/__algorithm/pstl_stable_sort.h  |   5 +
 .../libcxx/include/__algorithm/pstl_transform.h    |   5 +
 .../libcxx/include/__algorithm/ranges_all_of.h     |   5 +
 .../libcxx/include/__algorithm/ranges_any_of.h     |   5 +
 .../include/__algorithm/ranges_binary_search.h     |   5 +
 .../libcxx/include/__algorithm/ranges_clamp.h      |   5 +
 .../libcxx/include/__algorithm/ranges_contains.h   |   5 +
 .../libcxx/include/__algorithm/ranges_copy.h       |   5 +
 .../include/__algorithm/ranges_copy_backward.h     |   5 +
 .../libcxx/include/__algorithm/ranges_copy_if.h    |   5 +
 .../libcxx/include/__algorithm/ranges_copy_n.h     |   5 +
 .../libcxx/include/__algorithm/ranges_count.h      |   5 +
 .../libcxx/include/__algorithm/ranges_count_if.h   |   5 +
 .../libcxx/include/__algorithm/ranges_ends_with.h  |   5 +
 .../libcxx/include/__algorithm/ranges_equal.h      |   5 +
 .../include/__algorithm/ranges_equal_range.h       |   5 +
 .../libcxx/include/__algorithm/ranges_fill.h       |   5 +
 .../libcxx/include/__algorithm/ranges_fill_n.h     |   5 +
 .../libcxx/include/__algorithm/ranges_find.h       |   5 +
 .../libcxx/include/__algorithm/ranges_find_end.h   |   5 +
 .../include/__algorithm/ranges_find_first_of.h     |   5 +
 .../libcxx/include/__algorithm/ranges_find_if.h    |   5 +
 .../include/__algorithm/ranges_find_if_not.h       |   5 +
 .../libcxx/include/__algorithm/ranges_for_each.h   |   5 +
 .../libcxx/include/__algorithm/ranges_for_each_n.h |   5 +
 .../libcxx/include/__algorithm/ranges_generate.h   |   5 +
 .../libcxx/include/__algorithm/ranges_generate_n.h |   5 +
 .../libcxx/include/__algorithm/ranges_includes.h   |   5 +
 .../include/__algorithm/ranges_inplace_merge.h     |   5 +
 .../libcxx/include/__algorithm/ranges_is_heap.h    |   5 +
 .../include/__algorithm/ranges_is_heap_until.h     |   5 +
 .../include/__algorithm/ranges_is_partitioned.h    |   5 +
 .../include/__algorithm/ranges_is_permutation.h    |   5 +
 .../libcxx/include/__algorithm/ranges_is_sorted.h  |   5 +
 .../include/__algorithm/ranges_is_sorted_until.h   |   5 +
 .../include/__algorithm/ranges_iterator_concept.h  |   5 +
 .../__algorithm/ranges_lexicographical_compare.h   |   5 +
 .../include/__algorithm/ranges_lower_bound.h       |   5 +
 .../libcxx/include/__algorithm/ranges_make_heap.h  |   5 +
 .../include/__algorithm/ranges_max_element.h       |   5 +
 .../libcxx/include/__algorithm/ranges_merge.h      |   5 +
 .../include/__algorithm/ranges_min_element.h       |   5 +
 .../include/__algorithm/ranges_minmax_element.h    |   5 +
 .../libcxx/include/__algorithm/ranges_mismatch.h   |   5 +
 .../libcxx/include/__algorithm/ranges_move.h       |   5 +
 .../include/__algorithm/ranges_move_backward.h     |   5 +
 .../include/__algorithm/ranges_next_permutation.h  |   5 +
 .../libcxx/include/__algorithm/ranges_none_of.h    |   5 +
 .../include/__algorithm/ranges_nth_element.h       |   5 +
 .../include/__algorithm/ranges_partial_sort.h      |   5 +
 .../include/__algorithm/ranges_partial_sort_copy.h |   5 +
 .../libcxx/include/__algorithm/ranges_partition.h  |   5 +
 .../include/__algorithm/ranges_partition_copy.h    |   5 +
 .../include/__algorithm/ranges_partition_point.h   |   5 +
 .../libcxx/include/__algorithm/ranges_pop_heap.h   |   5 +
 .../include/__algorithm/ranges_prev_permutation.h  |   5 +
 .../libcxx/include/__algorithm/ranges_push_heap.h  |   5 +
 .../libcxx/include/__algorithm/ranges_remove.h     |   5 +
 .../include/__algorithm/ranges_remove_copy.h       |   5 +
 .../include/__algorithm/ranges_remove_copy_if.h    |   5 +
 .../libcxx/include/__algorithm/ranges_remove_if.h  |   5 +
 .../libcxx/include/__algorithm/ranges_replace.h    |   5 +
 .../include/__algorithm/ranges_replace_copy.h      |   5 +
 .../include/__algorithm/ranges_replace_copy_if.h   |   5 +
 .../libcxx/include/__algorithm/ranges_replace_if.h |   5 +
 .../include/__algorithm/ranges_reverse_copy.h      |   5 +
 .../libcxx/include/__algorithm/ranges_rotate.h     |   5 +
 .../include/__algorithm/ranges_rotate_copy.h       |   5 +
 .../libcxx/include/__algorithm/ranges_sample.h     |   5 +
 .../libcxx/include/__algorithm/ranges_search_n.h   |   5 +
 .../include/__algorithm/ranges_set_difference.h    |   6 +
 .../include/__algorithm/ranges_set_intersection.h  |   6 +
 .../__algorithm/ranges_set_symmetric_difference.h  |   6 +
 .../libcxx/include/__algorithm/ranges_set_union.h  |   5 +
 .../libcxx/include/__algorithm/ranges_shuffle.h    |   5 +
 .../libcxx/include/__algorithm/ranges_sort.h       |   5 +
 .../libcxx/include/__algorithm/ranges_sort_heap.h  |   5 +
 .../include/__algorithm/ranges_stable_partition.h  |   5 +
 .../include/__algorithm/ranges_stable_sort.h       |   5 +
 .../include/__algorithm/ranges_starts_with.h       |   5 +
 .../include/__algorithm/ranges_swap_ranges.h       |   5 +
 .../libcxx/include/__algorithm/ranges_transform.h  |   5 +
 .../libcxx/include/__algorithm/ranges_unique.h     |   5 +
 .../include/__algorithm/ranges_unique_copy.h       |   5 +
 .../libcxx/include/__algorithm/remove.h            |   5 +
 .../libcxx/include/__algorithm/remove_if.h         |   5 +
 .../libcxx/include/__algorithm/reverse.h           |   5 +
 .../libcxx/include/__algorithm/rotate.h            |   5 +
 .../libcxx/include/__algorithm/set_difference.h    |   5 +
 .../libcxx/include/__algorithm/set_intersection.h  |   5 +
 .../include/__algorithm/set_symmetric_difference.h |   5 +
 .../libcxx/include/__algorithm/set_union.h         |   5 +
 .../libcxx/include/__algorithm/shift_left.h        |   5 +
 .../libcxx/include/__algorithm/shift_right.h       |   5 +
 .../llvm-project/libcxx/include/__algorithm/sort.h |   5 +
 .../libcxx/include/__algorithm/sort_heap.h         |   5 +
 .../libcxx/include/__algorithm/stable_partition.h  |   5 +
 .../libcxx/include/__algorithm/stable_sort.h       |   5 +
 .../libcxx/include/__algorithm/swap_ranges.h       |   5 +
 .../libcxx/include/__algorithm/unique.h            |   5 +
 .../libcxx/include/__algorithm/unique_copy.h       |   5 +
 .../libcxx/include/__algorithm/unwrap_iter.h       |   2 +-
 .../libcxx/include/__algorithm/unwrap_range.h      |   5 +
 contrib/llvm-project/libcxx/include/__config       |   9 +-
 .../include/__filesystem/directory_iterator.h      |   5 +
 .../libcxx/include/__filesystem/path.h             |   5 +
 .../__filesystem/recursive_directory_iterator.h    |   5 +
 .../libcxx/include/__format/format_arg.h           |   5 +
 .../libcxx/include/__format/format_context.h       |   5 +
 .../libcxx/include/__format/format_functions.h     |   5 +
 .../libcxx/include/__format/formatter_output.h     |   5 +
 .../libcxx/include/__format/write_escaped.h        |   5 +
 .../libcxx/include/__functional/function.h         |   5 +
 .../include/__iterator/cpp17_iterator_concepts.h   |   5 +
 .../libcxx/include/__iterator/iterator_with_data.h |   5 +
 .../__memory/ranges_uninitialized_algorithms.h     |   5 +
 .../libcxx/include/__memory/raw_storage_iterator.h |   5 +
 .../libcxx/include/__memory/shared_ptr.h           |   5 +
 .../include/__memory/uninitialized_algorithms.h    |   5 +
 .../libcxx/include/__mutex/once_flag.h             |   5 +
 .../libcxx/include/__numeric/pstl_reduce.h         |   5 +
 .../include/__numeric/pstl_transform_reduce.h      |   5 +
 .../llvm-project/libcxx/include/__numeric/reduce.h |   5 +
 .../include/__numeric/saturation_arithmetic.h      |   5 +
 .../libcxx/include/__numeric/transform_reduce.h    |   5 +
 .../llvm-project/libcxx/include/__ranges/counted.h |   5 +
 .../libcxx/include/__ranges/drop_while_view.h      |   5 +
 .../libcxx/include/__ranges/elements_view.h        |   5 +
 .../libcxx/include/__ranges/filter_view.h          |   5 +
 .../libcxx/include/__ranges/iota_view.h            |   5 +
 .../libcxx/include/__ranges/join_view.h            |   5 +
 .../libcxx/include/__ranges/lazy_split_view.h      |   5 +
 .../libcxx/include/__ranges/repeat_view.h          |   5 +
 .../libcxx/include/__ranges/reverse_view.h         |   5 +
 .../libcxx/include/__ranges/single_view.h          |   5 +
 .../libcxx/include/__ranges/split_view.h           |   5 +
 .../libcxx/include/__ranges/take_while_view.h      |   5 +
 .../libcxx/include/__ranges/transform_view.h       |   5 +
 .../llvm-project/libcxx/include/__thread/jthread.h |   5 +
 .../llvm-project/libcxx/include/__thread/thread.h  |   5 +
 contrib/llvm-project/libcxx/include/array          |   5 +
 .../llvm-project/libcxx/include/condition_variable |   5 +
 .../libcxx/include/experimental/iterator           |   5 +
 contrib/llvm-project/libcxx/include/future         |   5 +
 contrib/llvm-project/libcxx/include/ios            |   5 +
 contrib/llvm-project/libcxx/include/map            |   5 +
 contrib/llvm-project/libcxx/include/ostream        |   5 +
 contrib/llvm-project/libcxx/include/queue          |   5 +
 contrib/llvm-project/libcxx/include/set            |   5 +
 contrib/llvm-project/libcxx/include/stack          |   5 +
 contrib/llvm-project/libcxx/include/string         |   7 +-
 contrib/llvm-project/libcxx/include/strstream      |   5 +
 contrib/llvm-project/libcxx/include/unordered_map  |   5 +
 contrib/llvm-project/libcxx/include/unordered_set  |   5 +
 contrib/llvm-project/libcxx/include/version        |  14 +-
 contrib/llvm-project/libcxx/modules/std/atomic.inc |   2 +
 contrib/llvm-project/libcxx/modules/std/iosfwd.inc |   2 +
 contrib/llvm-project/libcxx/modules/std/string.inc |   4 +
 .../libcxx/modules/std/string_view.inc             |   2 +
 contrib/llvm-project/lld/ELF/Arch/RISCV.cpp        | 199 ++++++--
 contrib/llvm-project/lld/ELF/InputFiles.cpp        |   7 +-
 contrib/llvm-project/lld/ELF/InputSection.cpp      |  13 +-
 contrib/llvm-project/lld/ELF/Relocations.cpp       |  50 ++-
 contrib/llvm-project/lld/ELF/Writer.cpp            |  12 +-
 contrib/llvm-project/lld/docs/ReleaseNotes.rst     |  62 +++
 .../llvm/include/llvm/Analysis/AliasAnalysis.h     |   7 +
 .../include/llvm/Analysis/BasicAliasAnalysis.h     |  14 +-
 .../include/llvm/Analysis/BranchProbabilityInfo.h  |  13 +-
 .../llvm/include/llvm/Analysis/Loads.h             |  12 +-
 .../llvm/include/llvm/Analysis/VecFuncs.def        |  18 +-
 .../llvm/include/llvm/CodeGen/LivePhysRegs.h       |  11 +-
 .../llvm/include/llvm/CodeGen/MachineBasicBlock.h  |   6 +
 .../llvm/include/llvm/IR/IntrinsicsAMDGPU.td       | 119 +++--
 .../llvm/include/llvm/Support/X86FoldTablesUtils.h |  11 +-
 .../include/llvm/Target/TargetInstrPredicate.td    |  34 ++
 .../llvm/TargetParser/AArch64TargetParser.h        |   3 +-
 .../llvm/include/llvm/TargetParser/Triple.h        |   6 +-
 .../llvm/lib/Analysis/BasicAliasAnalysis.cpp       |   6 +-
 contrib/llvm-project/llvm/lib/Analysis/Lint.cpp    |   3 +-
 contrib/llvm-project/llvm/lib/Analysis/Loads.cpp   |   9 +-
 .../llvm/lib/Analysis/LoopAccessAnalysis.cpp       |  53 ++-
 .../llvm/lib/Analysis/MemorySSAUpdater.cpp         |  22 +-
 .../llvm/lib/CodeGen/BranchFolding.cpp             |   6 +-
 .../lib/ProfileData/Coverage/CoverageMapping.cpp   | 240 ++++++++--
 .../ProfileData/Coverage/CoverageMappingWriter.cpp |  10 +-
 .../llvm-project/llvm/lib/Support/RISCVISAInfo.cpp |   3 +-
 .../Target/AArch64/AArch64ExpandPseudoInsts.cpp    |   6 +
 .../lib/Target/AArch64/AArch64FrameLowering.cpp    |   6 +-
 .../lib/Target/AArch64/AArch64ISelLowering.cpp     |  28 +-
 .../llvm/lib/Target/AArch64/AArch64ISelLowering.h  |   4 +-
 .../llvm/lib/Target/AArch64/AArch64InstrInfo.cpp   |  20 +-
 .../llvm/lib/Target/AArch64/AArch64InstrInfo.h     |   3 -
 .../Target/AArch64/AArch64LoadStoreOptimizer.cpp   | 229 ----------
 .../lib/Target/AArch64/AArch64RegisterInfo.cpp     |  35 ++
 .../llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td |  22 +
 .../Target/AArch64/AArch64TargetTransformInfo.cpp  |  17 +-
 .../llvm-project/llvm/lib/Target/AMDGPU/AMDGPU.td  |   1 +
 .../llvm/lib/Target/AMDGPU/AMDGPUGISel.td          |  24 +
 .../llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp  | 330 ++++++++++++++
 .../llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.h    |  10 +
 .../llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp  |   1 +
 .../Target/AMDGPU/AMDGPUInstructionSelector.cpp    | 213 +++++++++
 .../lib/Target/AMDGPU/AMDGPUInstructionSelector.h  |  13 +
 .../llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp |  79 +++-
 .../llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h   |   1 +
 .../llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp |  16 +-
 .../lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp   |  16 +
 .../lib/Target/AMDGPU/AMDGPUSearchableTables.td    |  16 +
 .../Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp    | 142 +++++-
 .../AMDGPU/Disassembler/AMDGPUDisassembler.cpp     |  34 ++
 .../llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp |  19 +-
 .../AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp      |  47 ++
 .../Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h |   4 +
 .../llvm/lib/Target/AMDGPU/SIDefines.h             |   3 +
 .../llvm/lib/Target/AMDGPU/SIFoldOperands.cpp      |   1 +
 .../llvm/lib/Target/AMDGPU/SIISelLowering.cpp      | 111 ++++-
 .../llvm/lib/Target/AMDGPU/SIISelLowering.h        |   1 +
 .../llvm/lib/Target/AMDGPU/SIInstrFormats.td       |   5 +
 .../llvm/lib/Target/AMDGPU/SIInstrInfo.h           |   8 +
 .../llvm/lib/Target/AMDGPU/SIInstrInfo.td          |  18 +-
 .../llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h |  32 +-
 .../llvm/lib/Target/AMDGPU/SIRegisterInfo.td       |   5 +
 .../lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp     |  11 +
 .../llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h  |   3 +
 .../llvm/lib/Target/AMDGPU/VOP1Instructions.td     |  93 +++-
 .../llvm/lib/Target/AMDGPU/VOP3Instructions.td     |  53 ++-
 .../llvm/lib/Target/AMDGPU/VOP3PInstructions.td    | 500 ++++++++++++++++++++-
 .../llvm/lib/Target/AMDGPU/VOPInstructions.td      |  32 +-
 .../llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp    |  13 +-
 .../LoongArch/LoongArchTargetTransformInfo.cpp     |  11 +-
 .../llvm/lib/Target/Mips/MipsAsmPrinter.cpp        |  39 --
 .../llvm/lib/Target/Mips/MipsAsmPrinter.h          |   2 -
 .../Target/PowerPC/PPCExpandAtomicPseudoInsts.cpp  |  14 +-
 .../llvm/lib/Target/PowerPC/PPCFrameLowering.cpp   |  13 +-
 .../llvm-project/llvm/lib/Target/RISCV/RISCV.td    |   6 +
 .../llvm/lib/Target/RISCV/RISCVFeatures.td         |  26 +-
 .../llvm/lib/Target/RISCV/RISCVISelLowering.cpp    |   2 +-
 .../llvm/lib/Target/RISCV/RISCVInstrInfoZicond.td  |   2 -
 .../llvm/lib/Target/RISCV/RISCVMacroFusion.cpp     | 210 ---------
 .../llvm/lib/Target/RISCV/RISCVMacroFusion.h       |  28 --
 .../llvm/lib/Target/RISCV/RISCVMacroFusion.td      |  93 ++++
 .../llvm/lib/Target/RISCV/RISCVSubtarget.cpp       |   8 +-
 .../llvm/lib/Target/RISCV/RISCVSubtarget.h         |   8 +-
 .../llvm/lib/Target/RISCV/RISCVTargetMachine.cpp   |  13 +-
 .../lib/Target/SystemZ/SystemZFrameLowering.cpp    |  12 +-
 .../llvm/lib/Target/X86/X86AsmPrinter.cpp          |   1 -
 .../llvm/lib/Target/X86/X86FrameLowering.cpp       |  15 +-
 .../llvm/lib/Target/X86/X86InstrAVX512.td          |   2 +-
 .../llvm/lib/Target/X86/X86InstrFoldTables.cpp     |  11 +-
 .../llvm/lib/Target/X86/X86InstrInfo.cpp           |  35 +-
 .../llvm/lib/TargetParser/TargetParser.cpp         |   1 +
 .../InstCombine/InstCombineLoadStoreAlloca.cpp     |   3 +-
 .../InstCombine/InstCombineSimplifyDemanded.cpp    |   3 +
 .../Transforms/Scalar/ConstraintElimination.cpp    |   7 +-
 .../llvm/lib/Transforms/Scalar/JumpThreading.cpp   |  13 +-
 .../lib/Transforms/Vectorize/LoopVectorize.cpp     |  62 ++-
 .../llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp |  12 +-
 .../llvm/utils/TableGen/DAGISelMatcherEmitter.cpp  |   3 +-
 .../llvm/utils/TableGen/PredicateExpander.cpp      |  34 ++
 .../llvm/utils/TableGen/PredicateExpander.h        |   4 +
 .../llvm/utils/TableGen/X86FoldTablesEmitter.cpp   |  58 +--
 lib/clang/include/VCSVersion.inc                   |   6 +-
 lib/clang/include/lld/Common/Version.inc           |   2 +-
 lib/clang/include/llvm/Support/VCSRevision.h       |   2 +-
 lib/clang/libllvm/Makefile                         |   3 +-
 usr.bin/clang/clang/clang-driver.cpp               |   2 +
 usr.bin/clang/lld/lld-driver.cpp                   |   2 +
 usr.bin/clang/llvm-ar/llvm-ar-driver.cpp           |   2 +
 usr.bin/clang/llvm-cxxfilt/llvm-cxxfilt-driver.cpp |   2 +
 usr.bin/clang/llvm-dwp/llvm-dwp-driver.cpp         |   2 +
 usr.bin/clang/llvm-nm/llvm-nm-driver.cpp           |   2 +
 usr.bin/clang/llvm-objcopy/llvm-objcopy-driver.cpp |   2 +
 usr.bin/clang/llvm-objdump/llvm-objdump-driver.cpp |   2 +
 .../clang/llvm-profdata/llvm-profdata-driver.cpp   |   2 +
 usr.bin/clang/llvm-readobj/llvm-readobj-driver.cpp |   2 +
 usr.bin/clang/llvm-size/llvm-size-driver.cpp       |   2 +
 .../llvm-symbolizer/llvm-symbolizer-driver.cpp     |   2 +
 361 files changed, 4552 insertions(+), 1284 deletions(-)

diff --git a/contrib/llvm-project/clang/include/clang/AST/Type.h b/contrib/llvm-project/clang/include/clang/AST/Type.h
index ea425791fc97..6384cf9420b8 100644
--- a/contrib/llvm-project/clang/include/clang/AST/Type.h
+++ b/contrib/llvm-project/clang/include/clang/AST/Type.h
@@ -3495,6 +3495,9 @@ enum class VectorKind {
 
   /// is RISC-V RVV fixed-length data vector
   RVVFixedLengthData,
+
+  /// is RISC-V RVV fixed-length mask vector
+  RVVFixedLengthMask,
 };
 
 /// Represents a GCC generic vector type. This type is created using
diff --git a/contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td b/contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td
index 7e633f8e2635..e02a1201e2ad 100644
--- a/contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td
+++ b/contrib/llvm-project/clang/include/clang/Basic/AttrDocs.td
@@ -2424,7 +2424,10 @@ only be a power of 2 between 64 and 65536.
 For types where LMUL!=1, ``__riscv_v_fixed_vlen`` needs to be scaled by the LMUL
 of the type before passing to the attribute.
 
-``vbool*_t`` types are not supported at this time.
+For ``vbool*_t`` types, ``__riscv_v_fixed_vlen`` needs to be divided by the
+number from the type name. For example, ``vbool8_t`` needs to use
+``__riscv_v_fixed_vlen`` / 8. If the resulting value is not a multiple of 8,
+the type is not supported for that value of ``__riscv_v_fixed_vlen``.
 }];
 }
 
diff --git a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def
index d208342d9c51..74dfd1d214e8 100644
--- a/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def
+++ b/contrib/llvm-project/clang/include/clang/Basic/BuiltinsAMDGPU.def
@@ -436,5 +436,67 @@ TARGET_BUILTIN(__builtin_amdgcn_global_load_tr_i32, "ii*1", "nc", "gfx12-insts,w
 TARGET_BUILTIN(__builtin_amdgcn_global_load_tr_v4i16, "V4sV4s*1", "nc", "gfx12-insts,wavefrontsize64")
 TARGET_BUILTIN(__builtin_amdgcn_global_load_tr_v4f16, "V4hV4h*1", "nc", "gfx12-insts,wavefrontsize64")
 
+//===----------------------------------------------------------------------===//
+// WMMA builtins.
+// Postfix w32 indicates the builtin requires wavefront size of 32.
+// Postfix w64 indicates the builtin requires wavefront size of 64.
+//
+// Some of these are very similar to their GFX11 counterparts, but they don't
+// require replication of the A,B matrices, so they use fewer vector elements.
+// Therefore, we add an "_gfx12" suffix to distinguish them from the existing
+// builtins.
+//===----------------------------------------------------------------------===//
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_f16_w32_gfx12, "V8fV8hV8hV8f", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf16_w32_gfx12, "V8fV8sV8sV8f", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_w32_gfx12, "V8hV8hV8hV8h", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_w32_gfx12, "V8sV8sV8sV8s", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu8_w32_gfx12, "V8iIbV2iIbV2iV8iIb", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu4_w32_gfx12, "V8iIbiIbiV8iIb", "nc", "gfx12-insts,wavefrontsize32")
+// These are gfx12-only, but for consistency with the other WMMA variants we're
+// keeping the "_gfx12" suffix.
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_fp8_fp8_w32_gfx12, "V8fV2iV2iV8f", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_fp8_bf8_w32_gfx12, "V8fV2iV2iV8f", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf8_fp8_w32_gfx12, "V8fV2iV2iV8f", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf8_bf8_w32_gfx12, "V8fV2iV2iV8f", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x32_iu4_w32_gfx12, "V8iIbV2iIbV2iV8iIb", "nc", "gfx12-insts,wavefrontsize32")
+
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_f16_w64_gfx12, "V4fV4hV4hV4f", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf16_w64_gfx12, "V4fV4sV4sV4f", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_w64_gfx12, "V4hV4hV4hV4h", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_w64_gfx12, "V4sV4sV4sV4s", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu8_w64_gfx12, "V4iIbiIbiV4iIb", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu4_w64_gfx12, "V4iIbiIbiV4iIb", "nc", "gfx12-insts,wavefrontsize64")
+// These are gfx12-only, but for consistency with the other WMMA variants we're
+// keeping the "_gfx12" suffix.
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_fp8_fp8_w64_gfx12, "V4fiiV4f", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_fp8_bf8_w64_gfx12, "V4fiiV4f", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf8_fp8_w64_gfx12, "V4fiiV4f", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf8_bf8_w64_gfx12, "V4fiiV4f", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x32_iu4_w64_gfx12, "V4iIbiIbiV4iIb", "nc", "gfx12-insts,wavefrontsize64")
+
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_f16_w32, "V8fV8hV16hV8fs", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf16_w32, "V8fV8sV16sV8fs", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f16_16x16x32_f16_w32, "V8hV8hV16hV8hs", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_bf16_16x16x32_bf16_w32, "V8sV8sV16sV8ss", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x32_iu8_w32, "V8iIbV2iIbV4iV8isIb", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x32_iu4_w32, "V8iIbiIbV2iV8isIb", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x64_iu4_w32, "V8iIbV2iIbV4iV8isIb", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_fp8_fp8_w32, "V8fV2iV4iV8fs", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_fp8_bf8_w32, "V8fV2iV4iV8fs", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf8_fp8_w32, "V8fV2iV4iV8fs", "nc", "gfx12-insts,wavefrontsize32")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf8_bf8_w32, "V8fV2iV4iV8fs", "nc", "gfx12-insts,wavefrontsize32")
+
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_f16_w64, "V4fV4hV8hV4fs", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf16_w64, "V4fV4sV8sV4fs", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f16_16x16x32_f16_w64, "V4hV4hV8hV4hs", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_bf16_16x16x32_bf16_w64, "V4sV4sV8sV4ss", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x32_iu8_w64, "V4iIbiIbV2iV4isIb", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x32_iu4_w64, "V4iIbiIbiV4isIb", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_i32_16x16x64_iu4_w64, "V4iIbiIbV2iV4isIb", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_fp8_fp8_w64, "V4fiV2iV4fs", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_fp8_bf8_w64, "V4fiV2iV4fs", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf8_fp8_w64, "V4fiV2iV4fs", "nc", "gfx12-insts,wavefrontsize64")
+TARGET_BUILTIN(__builtin_amdgcn_swmmac_f32_16x16x32_bf8_bf8_w64, "V4fiV2iV4fs", "nc", "gfx12-insts,wavefrontsize64")
+
 #undef BUILTIN
 #undef TARGET_BUILTIN
diff --git a/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def b/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def
index 2f2e45d5cf63..7c0bfe328496 100644
--- a/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def
+++ b/contrib/llvm-project/clang/include/clang/Basic/CodeGenOptions.def
@@ -369,6 +369,9 @@ ENUM_CODEGENOPT(VecLib, llvm::driver::VectorLibrary, 3, llvm::driver::VectorLibr
 /// The default TLS model to use.
 ENUM_CODEGENOPT(DefaultTLSModel, TLSModel, 2, GeneralDynamicTLSModel)
 
+/// Whether to enable TLSDESC. AArch64 enables TLSDESC regardless of this value.
+CODEGENOPT(EnableTLSDESC, 1, 0)
+
 /// Bit size of immediate TLS offsets (0 == use the default).
 VALUE_CODEGENOPT(TLSSize, 8, 0)
 
diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td
index b1bada65cb6b..08bb1d81ba29 100644
--- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticCommonKinds.td
@@ -73,7 +73,7 @@ def warn_pragma_debug_unexpected_argument : Warning<
 def warn_fp_nan_inf_when_disabled : Warning<
   "use of %select{infinity|NaN}0%select{| via a macro}1 is undefined behavior "
   "due to the currently enabled floating-point options">,
-  InGroup<DiagGroup<"nan-infinity-disabled">>;
+  InGroup<DiagGroup<"nan-infinity-disabled", [], NanInfDisabledDocs>>;
 }
 
 // Parse && Sema
diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticDocs.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticDocs.td
index e9862422b499..8c024b5cad74 100644
--- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticDocs.td
+++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticDocs.td
@@ -87,3 +87,12 @@ program by treating all string literals as having type ``const char *``
 instead of ``char *``. This can cause unexpected behaviors with type-sensitive
 constructs like ``_Generic``.
 }];
+
+defvar NanInfDisabledDocs = [{
+This warning is enabled when source code using the macros ``INFINITY`` or ``NAN``
+is compiled with floating-point options preventing these two values. This can
+lead to undefined behavior. Check the order of command line arguments that modify
+this behavior, such as ``-ffast-math``, ``-fhonor-infinities``, and
+``-fhonor-nans`` (etc), as well as ``#pragma`` directives if this diagnostic is
+generated unexpectedly.
+}];
diff --git a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td
index c5f1b67c4aa1..07ba4ecf7e12 100644
--- a/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/contrib/llvm-project/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -3711,6 +3711,12 @@ def err_sme_za_call_no_za_state : Error<
   "call to a shared ZA function requires the caller to have ZA state">;
 def err_sme_zt0_call_no_zt0_state : Error<
   "call to a shared ZT0 function requires the caller to have ZT0 state">;
+def err_sme_unimplemented_za_save_restore : Error<
+  "call to a function that shares state other than 'za' from a "
+  "function that has live 'za' state requires a spill/fill of ZA, which is not yet "
+  "implemented">;
+def note_sme_use_preserves_za : Note<
+  "add '__arm_preserves(\"za\")' to the callee if it preserves ZA">;
 def err_sme_definition_using_sm_in_non_sme_target : Error<
   "function executed in streaming-SVE mode requires 'sme'">;
 def err_sme_definition_using_za_in_non_sme_target : Error<
diff --git a/contrib/llvm-project/clang/include/clang/Basic/LangOptions.def b/contrib/llvm-project/clang/include/clang/Basic/LangOptions.def
index 8fc75e1cca03..4942dcaa086e 100644
--- a/contrib/llvm-project/clang/include/clang/Basic/LangOptions.def
+++ b/contrib/llvm-project/clang/include/clang/Basic/LangOptions.def
@@ -174,6 +174,7 @@ LANGOPT(MathErrno         , 1, 1, "errno in math functions")
 BENIGN_LANGOPT(HeinousExtensions , 1, 0, "extensions that we really don't like and may be ripped out at any time")
 LANGOPT(Modules           , 1, 0, "modules semantics")
 COMPATIBLE_LANGOPT(CPlusPlusModules, 1, 0, "C++ modules syntax")
+LANGOPT(SkipODRCheckInGMF, 1, 0, "Skip ODR checks for decls in the global module fragment")
 LANGOPT(BuiltinHeadersInSystemModules, 1, 0, "builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers")
 BENIGN_ENUM_LANGOPT(CompilingModule, CompilingModuleKind, 3, CMK_None,
                     "compiling a module interface")
diff --git a/contrib/llvm-project/clang/include/clang/Driver/Options.td b/contrib/llvm-project/clang/include/clang/Driver/Options.td
index 7f4fa33748fa..e8d03fc26902 100644
--- a/contrib/llvm-project/clang/include/clang/Driver/Options.td
+++ b/contrib/llvm-project/clang/include/clang/Driver/Options.td
@@ -2985,6 +2985,14 @@ def fmodule_output : Flag<["-"], "fmodule-output">, Flags<[NoXarchOption]>,
   Visibility<[ClangOption, CC1Option]>,
   HelpText<"Save intermediate module file results when compiling a standard C++ module unit.">;
 
+defm skip_odr_check_in_gmf : BoolOption<"f", "skip-odr-check-in-gmf",
+  LangOpts<"SkipODRCheckInGMF">, DefaultFalse,
+  PosFlag<SetTrue, [], [CC1Option],
+          "Skip ODR checks for decls in the global module fragment.">,
+  NegFlag<SetFalse, [], [CC1Option],
+          "Perform ODR checks for decls in the global module fragment.">>,
+  Group<f_Group>;
+
 def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group<i_Group>,
   Visibility<[ClangOption, CC1Option]>, MetaVarName<"<seconds>">,
   HelpText<"Specify the interval (in seconds) between attempts to prune the module cache">,
@@ -4419,6 +4427,8 @@ def mtls_size_EQ : Joined<["-"], "mtls-size=">, Group<m_Group>,
   HelpText<"Specify bit size of immediate TLS offsets (AArch64 ELF only): "
            "12 (for 4KB) | 24 (for 16MB, default) | 32 (for 4GB) | 48 (for 256TB, needs -mcmodel=large)">,
   MarshallingInfoInt<CodeGenOpts<"TLSSize">>;
+def mtls_dialect_EQ : Joined<["-"], "mtls-dialect=">, Group<m_Group>,
+  Flags<[TargetSpecific]>, HelpText<"Which thread-local storage dialect to use for dynamic accesses of TLS variables">;
 def mimplicit_it_EQ : Joined<["-"], "mimplicit-it=">, Group<m_Group>;
 def mdefault_build_attributes : Joined<["-"], "mdefault-build-attributes">, Group<m_Group>;
 def mno_default_build_attributes : Joined<["-"], "mno-default-build-attributes">, Group<m_Group>;
@@ -7066,6 +7076,9 @@ def fexperimental_assignment_tracking_EQ : Joined<["-"], "fexperimental-assignme
   Values<"disabled,enabled,forced">, NormalizedValues<["Disabled","Enabled","Forced"]>,
   MarshallingInfoEnum<CodeGenOpts<"AssignmentTrackingMode">, "Enabled">;
 
+def enable_tlsdesc : Flag<["-"], "enable-tlsdesc">,
+  MarshallingInfoFlag<CodeGenOpts<"EnableTLSDESC">>;
+
 } // let Visibility = [CC1Option]
 
 //===----------------------------------------------------------------------===//
diff --git a/contrib/llvm-project/clang/include/clang/Format/Format.h b/contrib/llvm-project/clang/include/clang/Format/Format.h
index bc9eecd42f9e..efcb4e1d87ea 100755
--- a/contrib/llvm-project/clang/include/clang/Format/Format.h
+++ b/contrib/llvm-project/clang/include/clang/Format/Format.h
@@ -4157,14 +4157,9 @@ struct FormatStyle {
 
   /// Different ways to put a space before opening parentheses.
   enum SpaceBeforeParensStyle : int8_t {
-    /// Never put a space before opening parentheses.
-    /// \code
-    ///    void f() {
-    ///      if(true) {
-    ///        f();
-    ///      }
-    ///    }
-    /// \endcode
+    /// This is **deprecated** and replaced by ``Custom`` below, with all
+    /// ``SpaceBeforeParensOptions`` but ``AfterPlacementOperator`` set to
+    /// ``false``.
     SBPO_Never,
     /// Put a space before opening parentheses only after control statement
     /// keywords (``for/if/while...``).
@@ -4273,28 +4268,14 @@ struct FormatStyle {
     ///    object.operator++ (10);                object.operator++(10);
     /// \endcode
     bool AfterOverloadedOperator;
-    /// Styles for adding spacing between ``new/delete`` operators and opening
-    /// parentheses.
-    enum AfterPlacementOperatorStyle : int8_t {
-      /// Remove space after ``new/delete`` operators and before ``(``.
-      /// \code
-      ///    new(buf) T;
-      ///    delete(buf) T;
-      /// \endcode
-      APO_Never,
-      /// Always add space after ``new/delete`` operators and before ``(``.
-      /// \code
-      ///    new (buf) T;
-      ///    delete (buf) T;
-      /// \endcode
-      APO_Always,
-      /// Leave placement ``new/delete`` expressions as they are.
-      APO_Leave,
-    };
-    /// Defines in which cases to put a space between ``new/delete`` operators
-    /// and opening parentheses.
-    /// \version 18
-    AfterPlacementOperatorStyle AfterPlacementOperator;
+    /// If ``true``, put a space between operator ``new``/``delete`` and opening
+    /// parenthesis.
+    /// \code
+    ///    true:                                  false:
+    ///    new (buf) T;                    vs.    new(buf) T;
+    ///    delete (buf) T;                        delete(buf) T;
+    /// \endcode
+    bool AfterPlacementOperator;
     /// If ``true``, put space between requires keyword in a requires clause and
     /// opening parentheses, if there is one.
     /// \code
@@ -4327,7 +4308,7 @@ struct FormatStyle {
         : AfterControlStatements(false), AfterForeachMacros(false),
           AfterFunctionDeclarationName(false),
           AfterFunctionDefinitionName(false), AfterIfMacros(false),
-          AfterOverloadedOperator(false), AfterPlacementOperator(APO_Leave),
+          AfterOverloadedOperator(false), AfterPlacementOperator(true),
           AfterRequiresInClause(false), AfterRequiresInExpression(false),
           BeforeNonEmptyParentheses(false) {}
 
diff --git a/contrib/llvm-project/clang/include/clang/Lex/Preprocessor.h b/contrib/llvm-project/clang/include/clang/Lex/Preprocessor.h
index 2d9c53cdf5bd..b0a8ec0fec5e 100644
--- a/contrib/llvm-project/clang/include/clang/Lex/Preprocessor.h
+++ b/contrib/llvm-project/clang/include/clang/Lex/Preprocessor.h
@@ -2828,7 +2828,8 @@ public:
     return AnnotationInfos.find(II)->second;
   }
 
-  void emitMacroExpansionWarnings(const Token &Identifier) const {
+  void emitMacroExpansionWarnings(const Token &Identifier,
+                                  bool IsIfnDef = false) const {
     IdentifierInfo *Info = Identifier.getIdentifierInfo();
     if (Info->isDeprecatedMacro())
       emitMacroDeprecationWarning(Identifier);
@@ -2837,12 +2838,12 @@ public:
         !SourceMgr.isInMainFile(Identifier.getLocation()))
       emitRestrictExpansionWarning(Identifier);
 
-    if (Info->getName() == "INFINITY")
-      if (getLangOpts().NoHonorInfs)
+    if (!IsIfnDef) {
+      if (Info->getName() == "INFINITY" && getLangOpts().NoHonorInfs)
         emitRestrictInfNaNWarning(Identifier, 0);
-    if (Info->getName() == "NAN")
-      if (getLangOpts().NoHonorNaNs)
+      if (Info->getName() == "NAN" && getLangOpts().NoHonorNaNs)
         emitRestrictInfNaNWarning(Identifier, 1);
+    }
   }
 
   static void processPathForFileMacro(SmallVectorImpl<char> &Path,
diff --git a/contrib/llvm-project/clang/include/clang/Sema/Lookup.h b/contrib/llvm-project/clang/include/clang/Sema/Lookup.h
index 9c93bf1e6fb4..2f2f2607a937 100644
--- a/contrib/llvm-project/clang/include/clang/Sema/Lookup.h
+++ b/contrib/llvm-project/clang/include/clang/Sema/Lookup.h
@@ -754,7 +754,8 @@ public:
 
 private:
   void diagnoseAccess() {
-    if (isClassLookup() && getSema().getLangOpts().AccessControl)
+    if (!isAmbiguous() && isClassLookup() &&
+        getSema().getLangOpts().AccessControl)
       getSema().CheckLookupAccess(*this);
   }
 
diff --git a/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h b/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h
index dd1451bbf2d2..cd28226c295b 100644
--- a/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h
+++ b/contrib/llvm-project/clang/include/clang/Serialization/ASTReader.h
@@ -2452,6 +2452,12 @@ private:
   uint32_t CurrentBitsIndex = ~0;
 };
 
+inline bool shouldSkipCheckingODR(const Decl *D) {
+  return D->getOwningModule() &&
+         D->getASTContext().getLangOpts().SkipODRCheckInGMF &&
+         D->getOwningModule()->isExplicitGlobalModule();
+}
+
 } // namespace clang
 
 #endif // LLVM_CLANG_SERIALIZATION_ASTREADER_H
diff --git a/contrib/llvm-project/clang/lib/AST/ASTContext.cpp b/contrib/llvm-project/clang/lib/AST/ASTContext.cpp
index 9a0ede201059..cc5de9a6295e 100644
--- a/contrib/llvm-project/clang/lib/AST/ASTContext.cpp
+++ b/contrib/llvm-project/clang/lib/AST/ASTContext.cpp
@@ -1949,7 +1949,8 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const {
     else if (VT->getVectorKind() == VectorKind::SveFixedLengthPredicate)
       // Adjust the alignment for fixed-length SVE predicates.
       Align = 16;
-    else if (VT->getVectorKind() == VectorKind::RVVFixedLengthData)
+    else if (VT->getVectorKind() == VectorKind::RVVFixedLengthData ||
+             VT->getVectorKind() == VectorKind::RVVFixedLengthMask)
       // Adjust the alignment for fixed-length RVV vectors.
       Align = std::min<unsigned>(64, Width);
     break;
@@ -9420,7 +9421,9 @@ bool ASTContext::areCompatibleVectorTypes(QualType FirstVec,
       Second->getVectorKind() != VectorKind::SveFixedLengthData &&
       Second->getVectorKind() != VectorKind::SveFixedLengthPredicate &&
       First->getVectorKind() != VectorKind::RVVFixedLengthData &&
-      Second->getVectorKind() != VectorKind::RVVFixedLengthData)
+      Second->getVectorKind() != VectorKind::RVVFixedLengthData &&
+      First->getVectorKind() != VectorKind::RVVFixedLengthMask &&
+      Second->getVectorKind() != VectorKind::RVVFixedLengthMask)
     return true;
 
   return false;
@@ -9526,8 +9529,11 @@ static uint64_t getRVVTypeSize(ASTContext &Context, const BuiltinType *Ty) {
 
   ASTContext::BuiltinVectorTypeInfo Info = Context.getBuiltinVectorTypeInfo(Ty);
 
-  uint64_t EltSize = Context.getTypeSize(Info.ElementType);
-  uint64_t MinElts = Info.EC.getKnownMinValue();
+  unsigned EltSize = Context.getTypeSize(Info.ElementType);
+  if (Info.ElementType == Context.BoolTy)
+    EltSize = 1;
+
+  unsigned MinElts = Info.EC.getKnownMinValue();
   return VScale->first * MinElts * EltSize;
 }
 
@@ -9541,6 +9547,12 @@ bool ASTContext::areCompatibleRVVTypes(QualType FirstType,
   auto IsValidCast = [this](QualType FirstType, QualType SecondType) {
     if (const auto *BT = FirstType->getAs<BuiltinType>()) {
       if (const auto *VT = SecondType->getAs<VectorType>()) {
+        if (VT->getVectorKind() == VectorKind::RVVFixedLengthMask) {
+          BuiltinVectorTypeInfo Info = getBuiltinVectorTypeInfo(BT);
+          return FirstType->isRVVVLSBuiltinType() &&
+                 Info.ElementType == BoolTy &&
+                 getTypeSize(SecondType) == getRVVTypeSize(*this, BT);
+        }
         if (VT->getVectorKind() == VectorKind::RVVFixedLengthData ||
             VT->getVectorKind() == VectorKind::Generic)
           return FirstType->isRVVVLSBuiltinType() &&
diff --git a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp
index f1d07d022b25..edf9b5e2d52b 100644
--- a/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp
+++ b/contrib/llvm-project/clang/lib/AST/ExprConstant.cpp
@@ -7951,7 +7951,8 @@ public:
       // Overloaded operator calls to member functions are represented as normal
       // calls with '*this' as the first argument.
       const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD);
-      if (MD && MD->isImplicitObjectMemberFunction()) {
+      if (MD &&
+          (MD->isImplicitObjectMemberFunction() || (OCE && MD->isStatic()))) {
         // FIXME: When selecting an implicit conversion for an overloaded
         // operator delete, we sometimes try to evaluate calls to conversion
         // operators without a 'this' parameter!
@@ -7960,7 +7961,11 @@ public:
 
         if (!EvaluateObjectArgument(Info, Args[0], ThisVal))
           return false;
-        This = &ThisVal;
+
+        // If we are calling a static operator, the 'this' argument needs to be
+        // ignored after being evaluated.
+        if (MD->isInstance())
+          This = &ThisVal;
 
         // If this is syntactically a simple assignment using a trivial
         // assignment operator, start the lifetimes of union members as needed,
diff --git a/contrib/llvm-project/clang/lib/AST/ItaniumMangle.cpp b/contrib/llvm-project/clang/lib/AST/ItaniumMangle.cpp
index 40b1e086ddd0..688141b30441 100644
--- a/contrib/llvm-project/clang/lib/AST/ItaniumMangle.cpp
+++ b/contrib/llvm-project/clang/lib/AST/ItaniumMangle.cpp
@@ -3994,7 +3994,8 @@ void CXXNameMangler::mangleAArch64FixedSveVectorType(
 }
 
 void CXXNameMangler::mangleRISCVFixedRVVVectorType(const VectorType *T) {
-  assert(T->getVectorKind() == VectorKind::RVVFixedLengthData &&
+  assert((T->getVectorKind() == VectorKind::RVVFixedLengthData ||
+          T->getVectorKind() == VectorKind::RVVFixedLengthMask) &&
          "expected fixed-length RVV vector!");
 
   QualType EltType = T->getElementType();
@@ -4009,7 +4010,10 @@ void CXXNameMangler::mangleRISCVFixedRVVVectorType(const VectorType *T) {
     TypeNameOS << "int8";
     break;
   case BuiltinType::UChar:
-    TypeNameOS << "uint8";
+    if (T->getVectorKind() == VectorKind::RVVFixedLengthData)
+      TypeNameOS << "uint8";
+    else
+      TypeNameOS << "bool";
     break;
   case BuiltinType::Short:
     TypeNameOS << "int16";
@@ -4048,12 +4052,16 @@ void CXXNameMangler::mangleRISCVFixedRVVVectorType(const VectorType *T) {
   auto VScale = getASTContext().getTargetInfo().getVScaleRange(
       getASTContext().getLangOpts());
   unsigned VLen = VScale->first * llvm::RISCV::RVVBitsPerBlock;
-  TypeNameOS << 'm';
-  if (VecSizeInBits >= VLen)
-    TypeNameOS << (VecSizeInBits / VLen);
-  else
-    TypeNameOS << 'f' << (VLen / VecSizeInBits);
 
+  if (T->getVectorKind() == VectorKind::RVVFixedLengthData) {
+    TypeNameOS << 'm';
+    if (VecSizeInBits >= VLen)
+      TypeNameOS << (VecSizeInBits / VLen);
+    else
+      TypeNameOS << 'f' << (VLen / VecSizeInBits);
+  } else {
+    TypeNameOS << (VLen / VecSizeInBits);
+  }
   TypeNameOS << "_t";
 
   Out << "9__RVV_VLSI" << 'u' << TypeNameStr.size() << TypeNameStr << "Lj"
@@ -4093,7 +4101,8 @@ void CXXNameMangler::mangleType(const VectorType *T) {
              T->getVectorKind() == VectorKind::SveFixedLengthPredicate) {
     mangleAArch64FixedSveVectorType(T);
     return;
-  } else if (T->getVectorKind() == VectorKind::RVVFixedLengthData) {
+  } else if (T->getVectorKind() == VectorKind::RVVFixedLengthData ||
+             T->getVectorKind() == VectorKind::RVVFixedLengthMask) {
     mangleRISCVFixedRVVVectorType(T);
     return;
   }
diff --git a/contrib/llvm-project/clang/lib/AST/JSONNodeDumper.cpp b/contrib/llvm-project/clang/lib/AST/JSONNodeDumper.cpp
index 3daba13d0fce..3c11b75d7472 100644
--- a/contrib/llvm-project/clang/lib/AST/JSONNodeDumper.cpp
+++ b/contrib/llvm-project/clang/lib/AST/JSONNodeDumper.cpp
@@ -703,6 +703,9 @@ void JSONNodeDumper::VisitVectorType(const VectorType *VT) {
   case VectorKind::RVVFixedLengthData:
     JOS.attribute("vectorKind", "fixed-length rvv data vector");
     break;
+  case VectorKind::RVVFixedLengthMask:
+    JOS.attribute("vectorKind", "fixed-length rvv mask vector");
+    break;
   }
 }
 
diff --git a/contrib/llvm-project/clang/lib/AST/ODRHash.cpp b/contrib/llvm-project/clang/lib/AST/ODRHash.cpp
index 5b98646a1e8d..2dbc259138a8 100644
--- a/contrib/llvm-project/clang/lib/AST/ODRHash.cpp
+++ b/contrib/llvm-project/clang/lib/AST/ODRHash.cpp
@@ -745,55 +745,8 @@ void ODRHash::AddEnumDecl(const EnumDecl *Enum) {
   if (Enum->isScoped())
     AddBoolean(Enum->isScopedUsingClassTag());
 
-  if (Enum->getIntegerTypeSourceInfo()) {
-    // FIMXE: This allows two enums with different spellings to have the same
-    // hash.
-    //
-    //  // mod1.cppm
-    //  module;
-    //  extern "C" {
-    //      typedef unsigned __int64 size_t;
-    //  }
-    //  namespace std {
-    //      using :: size_t;
-    //  }
-    //
-    //  extern "C++" {
-    //      namespace std {
-    //          enum class align_val_t : std::size_t {};
-    //      }
-    //  }
-    //
-    //  export module mod1;
-    //  export using std::align_val_t;
-    //
-    //  // mod2.cppm
-    //  module;
-    //  extern "C" {
-    //      typedef unsigned __int64 size_t;
-    //  }
-    //
-    //  extern "C++" {
-    //      namespace std {
-    //          enum class align_val_t : size_t {};
-    //      }
-    //  }
-    //
-    //  export module mod2;
-    //  import mod1;
-    //  export using std::align_val_t;
-    //
-    // The above example should be disallowed since it violates
-    // [basic.def.odr]p14:
-    //
-    //    Each such definition shall consist of the same sequence of tokens
-    //
-    // The definitions of `std::align_val_t` in two module units have different
-    // spellings but we failed to give an error here.
-    //
-    // See https://github.com/llvm/llvm-project/issues/76638 for details.
+  if (Enum->getIntegerTypeSourceInfo())
     AddQualType(Enum->getIntegerType().getCanonicalType());
-  }
 
   // Filter out sub-Decls which will not be processed in order to get an
   // accurate count of Decl's.
diff --git a/contrib/llvm-project/clang/lib/AST/TemplateBase.cpp b/contrib/llvm-project/clang/lib/AST/TemplateBase.cpp
index 2bdbeb08ef20..3310d7dc24c5 100644
--- a/contrib/llvm-project/clang/lib/AST/TemplateBase.cpp
+++ b/contrib/llvm-project/clang/lib/AST/TemplateBase.cpp
@@ -450,7 +450,8 @@ bool TemplateArgument::structurallyEquals(const TemplateArgument &Other) const {
            getAsIntegral() == Other.getAsIntegral();
 
   case StructuralValue: {
-    if (getStructuralValueType() != Other.getStructuralValueType())
+    if (getStructuralValueType().getCanonicalType() !=
+        Other.getStructuralValueType().getCanonicalType())
       return false;
 
     llvm::FoldingSetNodeID A, B;
diff --git a/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp b/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp
index 48c6729a6738..ecf5de0be543 100644
--- a/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp
+++ b/contrib/llvm-project/clang/lib/AST/TextNodeDumper.cpp
@@ -1623,6 +1623,9 @@ void TextNodeDumper::VisitVectorType(const VectorType *T) {
   case VectorKind::RVVFixedLengthData:
     OS << " fixed-length rvv data vector";
     break;
+  case VectorKind::RVVFixedLengthMask:
+    OS << " fixed-length rvv mask vector";
+    break;
   }
   OS << " " << T->getNumElements();
 }
diff --git a/contrib/llvm-project/clang/lib/AST/Type.cpp b/contrib/llvm-project/clang/lib/AST/Type.cpp
index 3db5ae182f32..d4103025591e 100644
--- a/contrib/llvm-project/clang/lib/AST/Type.cpp
+++ b/contrib/llvm-project/clang/lib/AST/Type.cpp
@@ -2479,6 +2479,9 @@ bool Type::isRVVVLSBuiltinType() const {
                         IsFP, IsBF)                                            \
   case BuiltinType::Id:                                                        \
     return NF == 1;
+#define RVV_PREDICATE_TYPE(Name, Id, SingletonId, NumEls)                      \
+  case BuiltinType::Id:                                                        \
+    return true;
 #include "clang/Basic/RISCVVTypes.def"
     default:
       return false;
@@ -2491,7 +2494,17 @@ QualType Type::getRVVEltType(const ASTContext &Ctx) const {
   assert(isRVVVLSBuiltinType() && "unsupported type!");
 
   const BuiltinType *BTy = castAs<BuiltinType>();
-  return Ctx.getBuiltinVectorTypeInfo(BTy).ElementType;
+
*** 11829 LINES SKIPPED ***