From ecbca9f5fb7d7613d2b94982c4825eb0d33d6842 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 5 Feb 2022 19:04:23 +0100 Subject: [PATCH] Vendor import of llvm-project main llvmorg-14-init-18294-gdb01b123d012, the last commit before the upstream release/14.x branch was created. --- clang/include/clang/AST/ASTContext.h | 35 +- .../clang/Analysis/Analyses/Dominators.h | 2 +- clang/include/clang/Analysis/CFG.h | 12 - .../Analysis/FlowSensitive/DataflowAnalysis.h | 15 +- .../FlowSensitive/DataflowEnvironment.h | 55 +- .../clang/Analysis/FlowSensitive/MapLattice.h | 4 +- .../TypeErasedDataflowAnalysis.h | 8 +- clang/include/clang/Basic/AttrDocs.td | 54 +- clang/include/clang/Basic/BuiltinsAArch64.def | 3 + clang/include/clang/Basic/CodeGenOptions.h | 5 + .../clang/Basic/DiagnosticCommonKinds.td | 7 + .../clang/Basic/DiagnosticDriverKinds.td | 8 +- clang/include/clang/Basic/LangOptions.h | 4 + clang/include/clang/Basic/TargetInfo.h | 19 +- clang/include/clang/CodeGen/BackendUtil.h | 3 + clang/include/clang/Driver/Action.h | 12 + clang/include/clang/Driver/Driver.h | 51 +- clang/include/clang/Driver/Job.h | 2 + clang/include/clang/Driver/Options.td | 20 +- clang/include/clang/Driver/ToolChain.h | 18 + .../clang/StaticAnalyzer/Checkers/Checkers.td | 2 +- clang/lib/AST/ASTContext.cpp | 37 +- clang/lib/AST/ExprConstant.cpp | 17 +- clang/lib/AST/RecordLayoutBuilder.cpp | 7 +- .../FlowSensitive/DataflowEnvironment.cpp | 73 ++- .../TypeErasedDataflowAnalysis.cpp | 11 +- clang/lib/Basic/Targets/AArch64.cpp | 2 +- clang/lib/Basic/Targets/AArch64.h | 5 +- clang/lib/Basic/Targets/ARM.cpp | 23 +- clang/lib/Basic/Targets/ARM.h | 6 +- clang/lib/Basic/Targets/WebAssembly.cpp | 1 + clang/lib/CodeGen/BackendUtil.cpp | 31 +- clang/lib/CodeGen/CGBuiltin.cpp | 12 + clang/lib/CodeGen/CGClass.cpp | 3 +- clang/lib/CodeGen/CGExpr.cpp | 2 +- clang/lib/CodeGen/CGExprAgg.cpp | 4 +- clang/lib/CodeGen/CGExprCXX.cpp | 8 +- clang/lib/CodeGen/CGExprConstant.cpp | 1 + clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 16 +- clang/lib/CodeGen/CGStmt.cpp | 2 +- clang/lib/CodeGen/CGStmtOpenMP.cpp | 55 ++ clang/lib/CodeGen/CodeGenAction.cpp | 1 + clang/lib/CodeGen/CodeGenFunction.h | 1 + clang/lib/CodeGen/CodeGenModule.cpp | 9 +- clang/lib/CodeGen/CodeGenModule.h | 7 - clang/lib/CodeGen/TargetInfo.cpp | 57 +- clang/lib/Driver/Action.cpp | 8 + clang/lib/Driver/Driver.cpp | 264 +++++--- clang/lib/Driver/ToolChain.cpp | 12 +- clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp | 4 + clang/lib/Driver/ToolChains/AVR.cpp | 5 + clang/lib/Driver/ToolChains/Clang.cpp | 159 ++++- clang/lib/Driver/ToolChains/Clang.h | 15 + clang/lib/Driver/ToolChains/CommonArgs.cpp | 27 +- clang/lib/Driver/ToolChains/CommonArgs.h | 3 + clang/lib/Driver/ToolChains/Cuda.cpp | 4 + clang/lib/Driver/ToolChains/XCore.cpp | 4 + clang/lib/Format/BreakableToken.cpp | 39 +- clang/lib/Format/ContinuationIndenter.cpp | 12 +- clang/lib/Format/Format.cpp | 57 +- clang/lib/Format/FormatToken.h | 28 + .../lib/Format/NamespaceEndCommentsFixer.cpp | 4 +- clang/lib/Format/SortJavaScriptImports.cpp | 7 +- clang/lib/Format/TokenAnalyzer.cpp | 10 +- clang/lib/Format/TokenAnnotator.h | 5 +- clang/lib/Format/UnwrappedLineFormatter.cpp | 25 +- clang/lib/Format/UnwrappedLineParser.cpp | 21 +- clang/lib/Format/UsingDeclarationsSorter.cpp | 10 +- clang/lib/Format/WhitespaceManager.cpp | 31 +- clang/lib/Frontend/CompilerInvocation.cpp | 4 + clang/lib/Frontend/InitPreprocessor.cpp | 8 + clang/lib/Headers/arm_acle.h | 6 + clang/lib/Headers/float.h | 21 +- clang/lib/Headers/limits.h | 2 + clang/lib/Headers/opencl-c-base.h | 6 + clang/lib/Headers/opencl-c.h | 86 ++- clang/lib/Lex/Lexer.cpp | 5 +- clang/lib/Sema/OpenCLBuiltins.td | 14 +- clang/lib/Sema/Sema.cpp | 55 +- clang/lib/Sema/SemaCUDA.cpp | 2 + clang/lib/Sema/SemaChecking.cpp | 2 +- clang/lib/Sema/SemaCoroutine.cpp | 12 +- clang/lib/Sema/SemaDecl.cpp | 13 +- clang/lib/Sema/SemaDeclAttr.cpp | 3 +- clang/lib/Sema/SemaExpr.cpp | 23 +- clang/lib/Sema/SemaExprCXX.cpp | 7 +- clang/lib/Sema/SemaOpenMP.cpp | 19 +- clang/lib/Sema/SemaOverload.cpp | 7 +- clang/lib/Sema/SemaTemplateInstantiate.cpp | 3 + clang/lib/Sema/SemaType.cpp | 7 +- clang/lib/Sema/TreeTransform.h | 2 + compiler-rt/include/profile/InstrProfData.inc | 4 + compiler-rt/include/profile/MemProfData.inc | 99 ++- .../include/sanitizer/common_interface_defs.h | 9 + compiler-rt/lib/builtins/floatsisf.c | 4 +- compiler-rt/lib/builtins/floatsitf.c | 8 +- compiler-rt/lib/builtins/floatunsisf.c | 4 +- compiler-rt/lib/builtins/floatunsitf.c | 4 +- compiler-rt/lib/builtins/fp_extend.h | 4 +- compiler-rt/lib/builtins/udivmoddi4.c | 4 +- .../lib/hwasan/hwasan_memintrinsics.cpp | 2 +- .../lib/interception/interception_win.cpp | 2 + compiler-rt/lib/memprof/memprof_allocator.cpp | 40 +- .../lib/memprof/memprof_meminfoblock.h | 116 ---- compiler-rt/lib/memprof/memprof_mibmap.cpp | 2 + compiler-rt/lib/memprof/memprof_mibmap.h | 9 +- .../lib/memprof/memprof_rawprofile.cpp | 9 +- compiler-rt/lib/memprof/tests/rawprofile.cpp | 50 +- compiler-rt/lib/msan/msan_interceptors.cpp | 8 +- compiler-rt/lib/profile/InstrProfiling.c | 4 +- .../lib/profile/InstrProfilingBuffer.c | 2 + compiler-rt/lib/profile/InstrProfilingMerge.c | 10 +- .../sanitizer_common/sanitizer_atomic_clang.h | 13 +- .../lib/tsan/rtl/tsan_interceptors_posix.cpp | 6 +- libcxx/include/__algorithm/in_in_out_result.h | 48 ++ libcxx/include/__algorithm/in_in_result.h | 4 +- libcxx/include/__algorithm/in_out_result.h | 4 +- .../compare_partial_order_fallback.h | 73 +++ .../__compare/compare_strong_order_fallback.h | 70 +++ .../__compare/compare_weak_order_fallback.h | 70 +++ libcxx/include/__concepts/swappable.h | 15 +- libcxx/include/__config | 15 +- .../include/__filesystem/directory_iterator.h | 2 +- .../recursive_directory_iterator.h | 2 +- libcxx/include/__format/format_arg.h | 7 +- libcxx/include/__format/format_context.h | 8 +- libcxx/include/__functional/function.h | 2 +- .../include/__functional/ranges_operations.h | 4 +- libcxx/include/__iterator/advance.h | 4 +- libcxx/include/__iterator/common_iterator.h | 4 +- libcxx/include/__iterator/concepts.h | 4 +- libcxx/include/__iterator/counted_iterator.h | 4 +- libcxx/include/__iterator/default_sentinel.h | 4 +- libcxx/include/__iterator/distance.h | 56 ++ .../include/__iterator/incrementable_traits.h | 4 +- .../__iterator/indirectly_comparable.h | 4 +- libcxx/include/__iterator/insert_iterator.h | 2 +- libcxx/include/__iterator/iter_move.h | 29 +- libcxx/include/__iterator/iter_swap.h | 17 +- libcxx/include/__iterator/iterator_traits.h | 12 +- libcxx/include/__iterator/next.h | 4 +- libcxx/include/__iterator/prev.h | 4 +- libcxx/include/__iterator/projected.h | 4 +- libcxx/include/__iterator/readable_traits.h | 4 +- .../include/__iterator/unreachable_sentinel.h | 4 +- libcxx/include/__locale | 8 +- libcxx/include/__memory/concepts.h | 4 +- libcxx/include/__memory/ranges_construct_at.h | 4 +- .../ranges_uninitialized_algorithms.h | 4 +- libcxx/include/__ranges/access.h | 12 +- libcxx/include/__ranges/all.h | 6 +- libcxx/include/__ranges/common_view.h | 8 +- libcxx/include/__ranges/concepts.h | 4 +- libcxx/include/__ranges/copyable_box.h | 4 +- libcxx/include/__ranges/counted.h | 4 +- libcxx/include/__ranges/dangling.h | 4 +- libcxx/include/__ranges/data.h | 8 +- libcxx/include/__ranges/drop_view.h | 4 +- libcxx/include/__ranges/empty.h | 6 +- libcxx/include/__ranges/empty_view.h | 4 +- .../include/__ranges/enable_borrowed_range.h | 4 +- libcxx/include/__ranges/enable_view.h | 6 +- libcxx/include/__ranges/iota_view.h | 6 +- libcxx/include/__ranges/join_view.h | 4 +- .../include/__ranges/non_propagating_cache.h | 4 +- libcxx/include/__ranges/owning_view.h | 4 +- libcxx/include/__ranges/range_adaptor.h | 4 +- libcxx/include/__ranges/ref_view.h | 4 +- libcxx/include/__ranges/reverse_view.h | 8 +- libcxx/include/__ranges/single_view.h | 4 +- libcxx/include/__ranges/size.h | 10 +- libcxx/include/__ranges/subrange.h | 6 +- libcxx/include/__ranges/take_view.h | 4 +- libcxx/include/__ranges/transform_view.h | 9 +- libcxx/include/__ranges/view_interface.h | 6 +- libcxx/include/algorithm | 6 +- libcxx/include/atomic | 3 + libcxx/include/compare | 14 +- libcxx/include/cstddef | 3 +- libcxx/include/module.modulemap | 24 +- libcxx/include/ranges | 4 +- libcxx/include/span | 18 +- libcxx/include/string_view | 12 +- libcxx/include/variant | 2 +- libcxx/src/filesystem/operations.cpp | 107 +++- libunwind/include/__libunwind_config.h | 2 +- libunwind/src/UnwindRegistersRestore.S | 2 +- libunwind/src/UnwindRegistersSave.S | 2 +- libunwind/src/assembly.h | 2 +- libunwind/src/config.h | 2 +- libunwind/src/libunwind.cpp | 2 +- lld/Common/ErrorHandler.cpp | 7 + lld/ELF/Arch/AArch64.cpp | 50 ++ lld/ELF/Config.h | 7 +- lld/ELF/Driver.cpp | 59 +- lld/ELF/Driver.h | 2 +- lld/ELF/ICF.cpp | 2 +- lld/ELF/InputFiles.cpp | 67 +-- lld/ELF/InputFiles.h | 35 +- lld/ELF/InputSection.cpp | 73 +-- lld/ELF/InputSection.h | 21 +- lld/ELF/LTO.cpp | 2 +- lld/ELF/LinkerScript.cpp | 16 +- lld/ELF/LinkerScript.h | 2 +- lld/ELF/MarkLive.cpp | 6 +- lld/ELF/OutputSections.cpp | 38 +- lld/ELF/SyntheticSections.cpp | 138 +++-- lld/ELF/SyntheticSections.h | 35 +- lld/ELF/Target.cpp | 17 +- lld/ELF/Target.h | 23 + lld/ELF/Writer.cpp | 52 +- lld/MachO/Driver.cpp | 6 + lld/MachO/Driver.h | 5 +- lld/MachO/InputFiles.h | 9 +- lld/MachO/MapFile.cpp | 59 +- lld/MachO/Options.td | 4 + lld/MachO/OutputSection.h | 18 +- lld/MachO/SyntheticSections.h | 2 + lld/MachO/UnwindInfoSection.cpp | 2 +- lld/MachO/Writer.cpp | 11 +- lld/docs/ReleaseNotes.rst | 21 +- lld/docs/conf.py | 9 - lldb/bindings/interface/SBThread.i | 2 +- lldb/docs/design/reproducers.rst | 205 ------- lldb/include/lldb/API/SBPlatform.h | 1 - lldb/include/lldb/API/SBTarget.h | 1 - lldb/include/lldb/API/SBThread.h | 2 +- lldb/include/lldb/API/SBType.h | 1 - lldb/include/lldb/Target/Target.h | 5 +- lldb/include/lldb/Target/Thread.h | 10 +- lldb/source/API/SBThread.cpp | 48 +- .../Disassembler/LLVMC/DisassemblerLLVMC.cpp | 16 +- .../Clang/ClangFunctionCaller.h | 1 - .../Clang/ClangUserExpression.h | 2 + .../gdb-remote/GDBRemoteClientBase.cpp | 14 +- .../gdb-remote/GDBRemoteCommunication.cpp | 16 +- .../GDBRemoteCommunicationClient.cpp | 31 +- .../GDBRemoteCommunicationServer.cpp | 2 +- .../gdb-remote/GDBRemoteRegisterContext.cpp | 12 +- .../Process/gdb-remote/ProcessGDBRemote.cpp | 76 +-- .../Process/gdb-remote/ProcessGDBRemoteLog.h | 19 - .../Process/gdb-remote/ThreadGDBRemote.h | 6 +- .../SymbolFile/DWARF/AppleDWARFIndex.cpp | 3 +- .../SymbolFile/DWARF/DWARFASTParserClang.cpp | 155 +---- .../SymbolFile/DWARF/DWARFDebugArangeSet.cpp | 2 +- .../SymbolFile/DWARF/DWARFDebugAranges.cpp | 2 +- .../SymbolFile/DWARF/DebugNamesDWARFIndex.cpp | 2 +- .../SymbolFile/DWARF/LogChannelDWARF.h | 8 - .../SymbolFile/DWARF/ManualDWARFIndex.cpp | 2 +- .../SymbolFile/DWARF/SymbolFileDWARF.cpp | 32 +- .../DWARF/SymbolFileDWARFDebugMap.cpp | 4 +- .../TypeSystem/Clang/TypeSystemClang.cpp | 32 +- lldb/source/Target/Target.cpp | 12 +- lldb/source/Target/Thread.cpp | 24 + llvm/include/llvm-c/Core.h | 1 + llvm/include/llvm-c/DebugInfo.h | 2 +- llvm/include/llvm/ADT/APFixedPoint.h | 4 +- llvm/include/llvm/ADT/APFloat.h | 1 - llvm/include/llvm/ADT/APSInt.h | 9 +- llvm/include/llvm/ADT/Any.h | 11 +- llvm/include/llvm/ADT/BitVector.h | 7 +- llvm/include/llvm/ADT/BreadthFirstIterator.h | 15 +- llvm/include/llvm/ADT/CachedHashString.h | 19 +- llvm/include/llvm/ADT/CoalescingBitVector.h | 3 +- llvm/include/llvm/ADT/DenseMap.h | 7 +- llvm/include/llvm/ADT/DenseMapInfo.h | 7 +- llvm/include/llvm/ADT/DenseSet.h | 7 +- llvm/include/llvm/ADT/DepthFirstIterator.h | 46 +- llvm/include/llvm/ADT/DirectedGraph.h | 9 +- llvm/include/llvm/ADT/EnumeratedArray.h | 8 +- llvm/include/llvm/ADT/EpochTracker.h | 11 +- llvm/include/llvm/ADT/EquivalenceClasses.h | 9 +- llvm/include/llvm/ADT/FloatingPointMode.h | 7 +- llvm/include/llvm/ADT/FoldingSet.h | 11 +- llvm/include/llvm/ADT/GenericCycleImpl.h | 27 +- llvm/include/llvm/ADT/GenericCycleInfo.h | 4 +- llvm/include/llvm/ADT/GraphTraits.h | 16 +- llvm/include/llvm/ADT/ImmutableList.h | 7 +- llvm/include/llvm/ADT/ImmutableMap.h | 7 +- llvm/include/llvm/ADT/ImmutableSet.h | 7 +- llvm/include/llvm/ADT/IndexedMap.h | 19 +- llvm/include/llvm/ADT/IntEqClasses.h | 21 +- llvm/include/llvm/ADT/IntervalMap.h | 49 +- llvm/include/llvm/ADT/IntrusiveRefCntPtr.h | 95 +-- llvm/include/llvm/ADT/MapVector.h | 13 +- llvm/include/llvm/ADT/None.h | 11 +- llvm/include/llvm/ADT/Optional.h | 13 +- llvm/include/llvm/ADT/PackedVector.h | 7 +- llvm/include/llvm/ADT/PointerIntPair.h | 7 +- llvm/include/llvm/ADT/PointerUnion.h | 9 +- llvm/include/llvm/ADT/PostOrderIterator.h | 11 +- llvm/include/llvm/ADT/PriorityQueue.h | 7 +- llvm/include/llvm/ADT/STLArrayExtras.h | 35 ++ llvm/include/llvm/ADT/STLExtras.h | 28 +- llvm/include/llvm/ADT/STLForwardCompat.h | 13 +- llvm/include/llvm/ADT/ScopeExit.h | 9 +- llvm/include/llvm/ADT/SetOperations.h | 9 +- llvm/include/llvm/ADT/SetVector.h | 19 +- llvm/include/llvm/ADT/SmallBitVector.h | 7 +- llvm/include/llvm/ADT/SmallPtrSet.h | 7 +- llvm/include/llvm/ADT/SmallSet.h | 7 +- llvm/include/llvm/ADT/SmallString.h | 7 +- llvm/include/llvm/ADT/SmallVector.h | 39 +- llvm/include/llvm/ADT/SparseBitVector.h | 9 +- llvm/include/llvm/ADT/SparseMultiSet.h | 21 +- llvm/include/llvm/ADT/SparseSet.h | 19 +- llvm/include/llvm/ADT/Statistic.h | 31 +- llvm/include/llvm/ADT/StringExtras.h | 12 +- llvm/include/llvm/ADT/StringMap.h | 7 +- llvm/include/llvm/ADT/StringMapEntry.h | 11 +- llvm/include/llvm/ADT/StringSet.h | 7 +- llvm/include/llvm/ADT/StringSwitch.h | 9 +- llvm/include/llvm/ADT/Triple.h | 35 ++ llvm/include/llvm/ADT/TypeSwitch.h | 9 +- llvm/include/llvm/ADT/Waymarking.h | 322 ---------- llvm/include/llvm/ADT/bit.h | 7 +- llvm/include/llvm/ADT/edit_distance.h | 11 +- llvm/include/llvm/ADT/ilist.h | 27 +- llvm/include/llvm/ADT/ilist_node.h | 9 +- .../llvm/Analysis/AliasAnalysisEvaluator.h | 1 + llvm/include/llvm/Analysis/CycleAnalysis.h | 1 + llvm/include/llvm/Analysis/DDG.h | 24 +- .../llvm/Analysis/DependenceAnalysis.h | 2 +- .../llvm/Analysis/DependenceGraphBuilder.h | 2 +- .../llvm/Analysis/IRSimilarityIdentifier.h | 45 +- .../llvm/Analysis/IndirectCallVisitor.h | 2 +- llvm/include/llvm/Analysis/InlineOrder.h | 2 +- llvm/include/llvm/Analysis/LazyCallGraph.h | 2 +- llvm/include/llvm/Analysis/LazyValueInfo.h | 2 +- llvm/include/llvm/Analysis/Loads.h | 3 +- llvm/include/llvm/Analysis/LoopInfo.h | 10 +- llvm/include/llvm/Analysis/MLInlineAdvisor.h | 1 + .../llvm/Analysis/MemoryDependenceAnalysis.h | 1 + llvm/include/llvm/Analysis/MustExecute.h | 6 +- llvm/include/llvm/Analysis/ObjCARCUtil.h | 2 +- llvm/include/llvm/Analysis/ScalarEvolution.h | 6 +- .../include/llvm/Analysis/SparsePropagation.h | 1 + .../include/llvm/Analysis/TargetLibraryInfo.h | 11 +- .../llvm/Analysis/TargetTransformInfo.h | 2 +- .../llvm/Analysis/TargetTransformInfoImpl.h | 3 +- llvm/include/llvm/BinaryFormat/ELF.h | 3 +- .../llvm/BinaryFormat/MsgPackDocument.h | 4 +- llvm/include/llvm/BinaryFormat/Swift.def | 26 + llvm/include/llvm/BinaryFormat/Swift.h | 24 + llvm/include/llvm/Bitcode/BitcodeWriter.h | 6 +- llvm/include/llvm/Bitstream/BitstreamReader.h | 3 +- llvm/include/llvm/CodeGen/DIE.h | 4 +- llvm/include/llvm/CodeGen/FastISel.h | 4 +- .../llvm/CodeGen/GlobalISel/CallLowering.h | 2 +- .../CodeGen/GlobalISel/GISelChangeObserver.h | 2 +- .../CodeGen/GlobalISel/LegacyLegalizerInfo.h | 2 +- .../llvm/CodeGen/GlobalISel/LegalizerInfo.h | 37 +- llvm/include/llvm/CodeGen/IntrinsicLowering.h | 4 +- llvm/include/llvm/CodeGen/LoopTraversal.h | 2 +- llvm/include/llvm/CodeGen/MIRFormatter.h | 2 +- llvm/include/llvm/CodeGen/MIRYamlMapping.h | 4 +- llvm/include/llvm/CodeGen/MachineFrameInfo.h | 11 +- .../llvm/CodeGen/MachineModuleSlotTracker.h | 2 +- llvm/include/llvm/CodeGen/MachineOperand.h | 4 +- llvm/include/llvm/CodeGen/MachineOutliner.h | 4 +- .../llvm/CodeGen/MachineRegisterInfo.h | 2 +- llvm/include/llvm/CodeGen/ReplaceWithVeclib.h | 1 + llvm/include/llvm/CodeGen/SelectionDAGISel.h | 6 +- llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 6 +- llvm/include/llvm/CodeGen/SlotIndexes.h | 2 +- .../llvm/CodeGen/SwitchLoweringUtils.h | 8 +- llvm/include/llvm/CodeGen/TargetCallingConv.h | 7 +- llvm/include/llvm/CodeGen/TargetLowering.h | 12 +- llvm/include/llvm/CodeGen/VirtRegMap.h | 11 +- llvm/include/llvm/DWARFLinker/DWARFStreamer.h | 8 +- .../llvm/DebugInfo/DWARF/DWARFDebugFrame.h | 2 +- .../include/llvm/DebugInfo/GSYM/StringTable.h | 2 +- .../llvm/DebugInfo/Symbolize/DIPrinter.h | 4 +- llvm/include/llvm/Demangle/ItaniumDemangle.h | 12 +- llvm/include/llvm/Demangle/README.txt | 63 +- llvm/include/llvm/Demangle/StringView.h | 9 +- llvm/include/llvm/Demangle/Utility.h | 11 +- .../llvm/ExecutionEngine/JITLink/JITLink.h | 2 +- llvm/include/llvm/ExecutionEngine/Orc/Core.h | 2 +- .../Orc/DebuggerSupportPlugin.h | 2 +- .../Orc/EPCDebugObjectRegistrar.h | 2 +- .../llvm/ExecutionEngine/Orc/TaskDispatch.h | 2 +- .../llvm/Frontend/OpenMP/OMPConstants.h | 3 + .../llvm/Frontend/OpenMP/OMPIRBuilder.h | 62 +- .../include/llvm/Frontend/OpenMP/OMPKinds.def | 7 + llvm/include/llvm/IR/AbstractCallSite.h | 4 +- llvm/include/llvm/IR/Attributes.h | 1 - llvm/include/llvm/IR/CFG.h | 2 +- llvm/include/llvm/IR/DIBuilder.h | 1 - llvm/include/llvm/IR/DebugInfoMetadata.h | 1 - llvm/include/llvm/IR/DiagnosticInfo.h | 16 +- llvm/include/llvm/IR/Dominators.h | 13 +- llvm/include/llvm/IR/IRBuilder.h | 5 +- llvm/include/llvm/IR/IRPrintingPasses.h | 5 + llvm/include/llvm/IR/InstrTypes.h | 9 +- llvm/include/llvm/IR/Instruction.h | 2 - llvm/include/llvm/IR/Instructions.h | 3 - llvm/include/llvm/IR/IntrinsicInst.h | 11 + llvm/include/llvm/IR/Intrinsics.td | 4 + llvm/include/llvm/IR/IntrinsicsAArch64.td | 8 + llvm/include/llvm/IR/LLVMContext.h | 1 - llvm/include/llvm/IR/LLVMRemarkStreamer.h | 12 +- llvm/include/llvm/IR/LegacyPassManager.h | 2 +- llvm/include/llvm/IR/MDBuilder.h | 2 +- llvm/include/llvm/IR/Metadata.h | 23 +- llvm/include/llvm/IR/ModuleSummaryIndex.h | 1 - llvm/include/llvm/IR/PassInstrumentation.h | 2 +- llvm/include/llvm/IR/PassManager.h | 5 +- llvm/include/llvm/IR/PassManagerImpl.h | 2 +- llvm/include/llvm/IR/PassTimingInfo.h | 2 - llvm/include/llvm/IR/ReplaceConstant.h | 7 +- llvm/include/llvm/IR/SSAContext.h | 5 +- llvm/include/llvm/IR/SafepointIRVerifier.h | 2 +- llvm/include/llvm/IR/Statepoint.h | 20 +- llvm/include/llvm/IR/Type.h | 2 +- llvm/include/llvm/IR/Use.h | 1 - llvm/include/llvm/InterfaceStub/IFSStub.h | 4 +- llvm/include/llvm/LineEditor/LineEditor.h | 2 +- llvm/include/llvm/MC/MCContext.h | 10 +- llvm/include/llvm/MC/MCObjectFileInfo.h | 14 + llvm/include/llvm/MC/MCPseudoProbe.h | 2 +- llvm/include/llvm/MCA/CustomBehaviour.h | 2 +- llvm/include/llvm/MCA/HWEventListener.h | 2 +- .../llvm/MCA/HardwareUnits/ResourceManager.h | 2 +- llvm/include/llvm/Object/Archive.h | 2 +- llvm/include/llvm/Object/ELFTypes.h | 2 +- llvm/include/llvm/Object/MachO.h | 4 + llvm/include/llvm/Object/ObjectFile.h | 6 + .../llvm/Passes/StandardInstrumentations.h | 2 +- llvm/include/llvm/ProfileData/InstrProf.h | 19 +- .../llvm/ProfileData/InstrProfCorrelator.h | 2 +- .../llvm/ProfileData/InstrProfData.inc | 4 + .../llvm/ProfileData/InstrProfReader.h | 79 ++- .../llvm/ProfileData/InstrProfWriter.h | 51 +- llvm/include/llvm/ProfileData/MemProfData.inc | 99 ++- .../llvm/Remarks/BitstreamRemarkSerializer.h | 3 +- llvm/include/llvm/Remarks/RemarkLinker.h | 6 +- llvm/include/llvm/Remarks/RemarkParser.h | 6 +- llvm/include/llvm/Remarks/RemarkSerializer.h | 6 +- llvm/include/llvm/Remarks/RemarkStreamer.h | 4 +- .../llvm/Support/AArch64TargetParser.def | 3 + llvm/include/llvm/Support/AMDGPUMetadata.h | 5 + llvm/include/llvm/Support/ARMTargetParser.def | 2 + .../include/llvm/Support/BinaryStreamReader.h | 11 +- .../include/llvm/Support/BinaryStreamWriter.h | 11 +- llvm/include/llvm/Support/CommandLine.h | 2 +- llvm/include/llvm/Support/Compiler.h | 21 +- llvm/include/llvm/Support/FileOutputBuffer.h | 2 +- .../llvm/Support/FormatVariadicDetails.h | 2 +- llvm/include/llvm/Support/GenericDomTree.h | 2 +- .../GenericIteratedDominanceFrontier.h | 2 +- llvm/include/llvm/Support/KnownBits.h | 2 +- llvm/include/llvm/Support/RISCVISAInfo.h | 3 + llvm/include/llvm/Support/ScopedPrinter.h | 8 +- llvm/include/llvm/Support/SuffixTree.h | 2 +- llvm/include/llvm/Support/Timer.h | 2 +- llvm/include/llvm/TableGen/Record.h | 2 +- .../AggressiveInstCombine.h | 1 + .../llvm/Transforms/IPO/AlwaysInliner.h | 1 + .../llvm/Transforms/IPO/ArgumentPromotion.h | 8 - llvm/include/llvm/Transforms/IPO/Attributor.h | 170 ++++-- .../llvm/Transforms/IPO/ForceFunctionAttrs.h | 1 + llvm/include/llvm/Transforms/IPO/IROutliner.h | 12 +- .../llvm/Transforms/IPO/InferFunctionAttrs.h | 1 + .../llvm/Transforms/IPO/SampleProfile.h | 1 + .../llvm/Transforms/IPO/SampleProfileProbe.h | 2 +- .../Transforms/InstCombine/InstCombiner.h | 2 +- .../Instrumentation/AddressSanitizer.h | 1 + .../Instrumentation/AddressSanitizerCommon.h | 4 +- .../Instrumentation/BoundsChecking.h | 1 + .../Instrumentation/HWAddressSanitizer.h | 1 + .../Instrumentation/InstrProfiling.h | 15 +- .../Transforms/Instrumentation/MemProfiler.h | 1 + .../llvm/Transforms/Scalar/LoopPassManager.h | 2 +- .../Scalar/LowerConstantIntrinsics.h | 2 +- .../llvm/Transforms/Scalar/Scalarizer.h | 1 + .../Transforms/Scalar/WarnMissedTransforms.h | 3 +- .../Transforms/Utils/AssumeBundleBuilder.h | 1 + .../llvm/Transforms/Utils/BasicBlockUtils.h | 6 +- .../llvm/Transforms/Utils/CallGraphUpdater.h | 2 +- llvm/include/llvm/Transforms/Utils/Debugify.h | 1 + .../llvm/Transforms/Utils/InjectTLIMappings.h | 1 + llvm/include/llvm/Transforms/Utils/LoopPeel.h | 2 +- .../llvm/Transforms/Utils/ModuleUtils.h | 5 + .../llvm/Transforms/Utils/SSAUpdaterBulk.h | 6 +- .../Vectorize/LoadStoreVectorizer.h | 1 + llvm/include/llvm/module.modulemap | 1 + llvm/lib/Analysis/BasicAliasAnalysis.cpp | 11 +- llvm/lib/Analysis/IRSimilarityIdentifier.cpp | 31 +- llvm/lib/Analysis/InstructionSimplify.cpp | 6 +- llvm/lib/Analysis/Loads.cpp | 4 +- llvm/lib/Analysis/LoopInfo.cpp | 4 + llvm/lib/Analysis/MemDerefPrinter.cpp | 8 +- llvm/lib/Analysis/ScalarEvolution.cpp | 41 +- llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp | 33 + llvm/lib/Analysis/ValueTracking.cpp | 4 +- .../BinaryFormat/AMDGPUMetadataVerifier.cpp | 13 + llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 6 +- llvm/lib/CodeGen/Analysis.cpp | 2 +- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 12 +- llvm/lib/CodeGen/AsmPrinter/DIE.cpp | 3 +- .../CodeGen/AsmPrinter/DwarfCFIException.cpp | 6 +- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 12 +- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 3 - llvm/lib/CodeGen/AsmPrinter/DwarfException.h | 10 +- .../CodeGen/AsmPrinter/DwarfExpression.cpp | 8 + llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 25 +- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h | 2 +- llvm/lib/CodeGen/CodeGenPrepare.cpp | 4 +- llvm/lib/CodeGen/EarlyIfConversion.cpp | 7 +- llvm/lib/CodeGen/ExpandMemCmp.cpp | 7 +- .../GlobalISel/LegacyLegalizerInfo.cpp | 2 +- llvm/lib/CodeGen/IfConversion.cpp | 4 +- .../CodeGen/InterleavedLoadCombinePass.cpp | 9 +- .../LiveDebugValues/InstrRefBasedImpl.cpp | 351 +++++------ .../LiveDebugValues/InstrRefBasedImpl.h | 41 +- .../LiveDebugValues/VarLocBasedImpl.cpp | 5 +- llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp | 135 +++-- llvm/lib/CodeGen/MachineModuleInfo.cpp | 8 +- llvm/lib/CodeGen/MachineModuleSlotTracker.cpp | 3 +- llvm/lib/CodeGen/MachineRegisterInfo.cpp | 3 +- llvm/lib/CodeGen/MachineVerifier.cpp | 2 +- llvm/lib/CodeGen/PostRASchedulerList.cpp | 4 +- llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp | 181 +++++- llvm/lib/CodeGen/RegAllocEvictionAdvisor.h | 6 +- llvm/lib/CodeGen/RegAllocGreedy.cpp | 183 +----- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 76 +-- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 3 +- .../SelectionDAG/ScheduleDAGSDNodes.cpp | 5 +- .../CodeGen/SelectionDAG/ScheduleDAGSDNodes.h | 8 +- .../lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 7 +- .../SelectionDAG/SelectionDAGBuilder.cpp | 16 +- .../CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 +- .../SelectionDAG/StatepointLowering.cpp | 30 +- .../CodeGen/SelectionDAG/TargetLowering.cpp | 57 +- llvm/lib/CodeGen/SlotIndexes.cpp | 2 +- llvm/lib/DWARFLinker/DWARFStreamer.cpp | 20 +- llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 110 +++- llvm/lib/IR/Attributes.cpp | 50 +- llvm/lib/IR/AutoUpgrade.cpp | 1 - llvm/lib/IR/BasicBlock.cpp | 3 +- llvm/lib/IR/Comdat.cpp | 4 +- llvm/lib/IR/ConstantFold.cpp | 2 - llvm/lib/IR/Constants.cpp | 7 +- llvm/lib/IR/Core.cpp | 2 + llvm/lib/IR/DIBuilder.cpp | 2 - llvm/lib/IR/DataLayout.cpp | 3 +- llvm/lib/IR/DebugInfo.cpp | 5 +- llvm/lib/IR/DebugInfoMetadata.cpp | 4 +- llvm/lib/IR/DebugLoc.cpp | 1 - llvm/lib/IR/DiagnosticInfo.cpp | 6 +- llvm/lib/IR/Dominators.cpp | 18 +- llvm/lib/IR/Function.cpp | 2 - llvm/lib/IR/Globals.cpp | 2 - llvm/lib/IR/IRBuilder.cpp | 1 - llvm/lib/IR/InlineAsm.cpp | 1 - llvm/lib/IR/Instruction.cpp | 1 - llvm/lib/IR/IntrinsicInst.cpp | 2 - llvm/lib/IR/LLVMContext.cpp | 2 - llvm/lib/IR/LLVMContextImpl.cpp | 12 + llvm/lib/IR/LLVMContextImpl.h | 24 +- llvm/lib/IR/LLVMRemarkStreamer.cpp | 2 + llvm/lib/IR/LegacyPassManager.cpp | 11 +- llvm/lib/IR/Metadata.cpp | 4 - llvm/lib/IR/Module.cpp | 2 - llvm/lib/IR/ModuleSummaryIndex.cpp | 1 - llvm/lib/IR/Operator.cpp | 1 - llvm/lib/IR/OptBisect.cpp | 1 - llvm/lib/IR/PassManager.cpp | 5 +- llvm/lib/IR/ProfileSummary.cpp | 3 +- llvm/lib/IR/PseudoProbe.cpp | 2 +- llvm/lib/IR/ReplaceConstant.cpp | 3 +- llvm/lib/IR/SSAContext.cpp | 3 +- llvm/lib/IR/SafepointIRVerifier.cpp | 4 +- llvm/lib/IR/Statepoint.cpp | 2 - llvm/lib/IR/Type.cpp | 2 - llvm/lib/IR/Use.cpp | 6 +- llvm/lib/IR/Value.cpp | 3 - llvm/lib/IR/Verifier.cpp | 12 +- llvm/lib/LTO/LTO.cpp | 3 +- llvm/lib/LTO/LTOBackend.cpp | 7 +- llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 2 +- llvm/lib/MC/MCAsmStreamer.cpp | 2 +- llvm/lib/MC/MCContext.cpp | 8 +- llvm/lib/MC/MCObjectFileInfo.cpp | 12 + llvm/lib/Object/MachOObjectFile.cpp | 13 + llvm/lib/ObjectYAML/ELFYAML.cpp | 1 + llvm/lib/ObjectYAML/WasmEmitter.cpp | 13 +- llvm/lib/Passes/PassBuilderPipelines.cpp | 7 + llvm/lib/ProfileData/InstrProf.cpp | 26 - llvm/lib/ProfileData/InstrProfReader.cpp | 62 +- llvm/lib/ProfileData/InstrProfWriter.cpp | 31 +- llvm/lib/Remarks/BitstreamRemarkParser.cpp | 1 + llvm/lib/Remarks/BitstreamRemarkParser.h | 4 +- llvm/lib/Remarks/RemarkLinker.cpp | 4 +- llvm/lib/Remarks/RemarkParser.cpp | 1 - llvm/lib/Remarks/YAMLRemarkParser.h | 2 - llvm/lib/Remarks/YAMLRemarkSerializer.cpp | 1 - llvm/lib/Support/ARMAttributeParser.cpp | 2 +- llvm/lib/Support/Host.cpp | 1 + llvm/lib/Support/RISCVISAInfo.cpp | 61 +- llvm/lib/Support/Signals.cpp | 2 +- llvm/lib/Support/Triple.cpp | 4 +- llvm/lib/Support/Valgrind.cpp | 2 +- llvm/lib/Support/Windows/Host.inc | 3 + llvm/lib/Support/raw_ostream.cpp | 2 +- llvm/lib/TableGen/DetailedRecordsBackend.cpp | 11 +- llvm/lib/TableGen/JSONBackend.cpp | 8 +- llvm/lib/TableGen/Main.cpp | 2 - llvm/lib/TableGen/Record.cpp | 8 +- llvm/lib/TableGen/SetTheory.cpp | 3 +- llvm/lib/TableGen/TGParser.cpp | 3 +- llvm/lib/TableGen/TableGenBackendSkeleton.cpp | 19 +- llvm/lib/Target/AArch64/AArch64.td | 6 + llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp | 46 ++ .../AArch64/AArch64ExpandPseudoInsts.cpp | 27 +- .../Target/AArch64/AArch64ISelLowering.cpp | 145 ++++- llvm/lib/Target/AArch64/AArch64ISelLowering.h | 8 +- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 31 +- llvm/lib/Target/AArch64/AArch64InstrInfo.td | 84 ++- .../lib/Target/AArch64/AArch64SVEInstrInfo.td | 16 +- .../AArch64/AArch64SelectionDAGInfo.cpp | 97 ++- .../Target/AArch64/AArch64SelectionDAGInfo.h | 19 + llvm/lib/Target/AArch64/AArch64Subtarget.cpp | 1 + llvm/lib/Target/AArch64/AArch64Subtarget.h | 3 +- .../AArch64/AArch64TargetTransformInfo.cpp | 21 +- .../GISel/AArch64InstructionSelector.cpp | 95 +++ .../AArch64/GISel/AArch64LegalizerInfo.cpp | 55 +- .../AArch64/GISel/AArch64LegalizerInfo.h | 1 + llvm/lib/Target/AArch64/SVEInstrFormats.td | 35 +- llvm/lib/Target/AMDGPU/AMDGPU.h | 1 + .../AMDGPU/AMDGPUAnnotateUniformValues.cpp | 88 ++- llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp | 8 +- .../AMDGPU/AMDGPUHSAMetadataStreamer.cpp | 106 +++- .../Target/AMDGPU/AMDGPUHSAMetadataStreamer.h | 41 +- .../lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp | 1 + llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp | 3 +- .../lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp | 3 +- .../AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 20 +- .../MCTargetDesc/AMDGPUTargetStreamer.cpp | 2 + llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 1 + .../Target/AMDGPU/SILoadStoreOptimizer.cpp | 14 +- .../Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 14 +- llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h | 5 +- llvm/lib/Target/ARM/ARM.td | 10 + llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 39 +- llvm/lib/Target/ARM/ARMISelLowering.cpp | 2 +- llvm/lib/Target/ARM/ARMInstrInfo.td | 19 +- llvm/lib/Target/ARM/ARMInstrThumb.td | 9 +- llvm/lib/Target/ARM/ARMInstrThumb2.td | 16 +- llvm/lib/Target/ARM/ARMSubtarget.cpp | 1 + llvm/lib/Target/ARM/ARMSubtarget.h | 1 + .../lib/Target/ARM/ARMTargetTransformInfo.cpp | 3 - .../lib/Target/Hexagon/HexagonOptAddrMode.cpp | 8 +- .../Target/M68k/GISel/M68kLegalizerInfo.cpp | 35 +- llvm/lib/Target/M68k/M68kInstrBits.td | 8 + llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 1 - llvm/lib/Target/NVPTX/NVPTXInstrInfo.td | 1 + llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 45 +- llvm/lib/Target/PowerPC/PPCInstrPrefix.td | 45 +- .../Target/RISCV/AsmParser/RISCVAsmParser.cpp | 4 +- .../RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp | 6 +- .../Target/RISCV/MCTargetDesc/RISCVMatInt.cpp | 11 +- llvm/lib/Target/RISCV/RISCV.td | 8 +- .../RISCV/RISCVExpandAtomicPseudoInsts.cpp | 6 +- .../Target/RISCV/RISCVExpandPseudoInsts.cpp | 6 +- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 28 +- llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 175 ++++-- llvm/lib/Target/RISCV/RISCVISelLowering.h | 1 + llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | 21 +- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 98 +-- llvm/lib/Target/RISCV/RISCVInstrInfo.td | 16 +- llvm/lib/Target/RISCV/RISCVInstrInfoA.td | 12 + .../Target/RISCV/RISCVInstrInfoVPseudos.td | 20 +- .../Target/RISCV/RISCVInstrInfoVSDPatterns.td | 2 +- .../Target/RISCV/RISCVInstrInfoVVLPatterns.td | 4 +- llvm/lib/Target/RISCV/RISCVInstrInfoZb.td | 517 ++++++++-------- llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td | 28 +- llvm/lib/Target/RISCV/RISCVInstrInfoZk.td | 2 +- llvm/lib/Target/RISCV/RISCVSExtWRemoval.cpp | 6 +- llvm/lib/Target/RISCV/RISCVSubtarget.h | 1 + .../Sparc/MCTargetDesc/SparcAsmBackend.cpp | 27 + .../MCTargetDesc/SparcELFObjectWriter.cpp | 4 + .../Target/SystemZ/SystemZFrameLowering.cpp | 82 +++ .../lib/Target/SystemZ/SystemZFrameLowering.h | 3 + llvm/lib/Target/SystemZ/SystemZISelLowering.h | 5 + llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp | 7 + llvm/lib/Target/SystemZ/SystemZInstrInfo.h | 3 + .../Utils/WebAssemblyTypeUtilities.cpp | 38 ++ .../Utils/WebAssemblyTypeUtilities.h | 43 ++ .../WebAssembly/Utils/WebAssemblyUtilities.h | 38 -- .../WebAssembly/WebAssemblyAsmPrinter.cpp | 16 +- .../WebAssembly/WebAssemblyFastISel.cpp | 1 + .../WebAssembly/WebAssemblyFrameLowering.cpp | 2 +- .../WebAssemblyLowerEmscriptenEHSjLj.cpp | 41 +- .../WebAssemblyLowerRefTypesIntPtrConv.cpp | 2 +- .../WebAssembly/WebAssemblyMCInstLower.cpp | 34 +- .../WebAssemblyMachineFunctionInfo.cpp | 24 +- .../WebAssemblyMachineFunctionInfo.h | 4 + llvm/lib/Target/X86/X86ISelLowering.cpp | 230 +++++-- llvm/lib/Target/X86/X86LowerAMXType.cpp | 2 + llvm/lib/Transforms/Coroutines/CoroFrame.cpp | 1 + llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 59 +- llvm/lib/Transforms/IPO/Attributor.cpp | 244 +++++++- .../Transforms/IPO/AttributorAttributes.cpp | 564 ++++++++++++------ .../Transforms/IPO/CalledValuePropagation.cpp | 1 + llvm/lib/Transforms/IPO/GlobalOpt.cpp | 27 +- llvm/lib/Transforms/IPO/IROutliner.cpp | 7 + llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 1 + llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 233 +++++++- .../lib/Transforms/IPO/SampleProfileProbe.cpp | 1 + .../Transforms/IPO/ThinLTOBitcodeWriter.cpp | 2 +- .../lib/Transforms/IPO/WholeProgramDevirt.cpp | 2 +- .../InstCombine/InstCombineCalls.cpp | 26 +- .../InstCombine/InstCombineCompares.cpp | 52 ++ .../Transforms/InstCombine/InstCombinePHI.cpp | 283 ++++----- .../InstCombineSimplifyDemanded.cpp | 15 +- .../InstCombine/InstructionCombining.cpp | 1 + .../Instrumentation/AddressSanitizer.cpp | 12 +- .../Instrumentation/HWAddressSanitizer.cpp | 26 +- .../Instrumentation/InstrProfiling.cpp | 123 ++-- .../Instrumentation/MemProfiler.cpp | 1 + .../Instrumentation/MemorySanitizer.cpp | 48 +- .../Instrumentation/PGOInstrumentation.cpp | 82 ++- llvm/lib/Transforms/ObjCARC/ObjCARC.cpp | 13 +- llvm/lib/Transforms/ObjCARC/ObjCARC.h | 6 +- .../Transforms/ObjCARC/ObjCARCContract.cpp | 25 +- llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp | 2 +- .../Transforms/Scalar/DFAJumpThreading.cpp | 20 +- llvm/lib/Transforms/Scalar/LoopFuse.cpp | 3 +- .../Transforms/Scalar/LoopIdiomRecognize.cpp | 33 +- .../lib/Transforms/Scalar/LoopSimplifyCFG.cpp | 2 +- llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 2 +- .../Scalar/LowerMatrixIntrinsics.cpp | 17 +- llvm/lib/Transforms/Scalar/NewGVN.cpp | 28 +- .../Scalar/RewriteStatepointsForGC.cpp | 147 +++-- llvm/lib/Transforms/Scalar/SROA.cpp | 1 + llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 25 + llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 4 +- llvm/lib/Transforms/Utils/CloneFunction.cpp | 53 +- llvm/lib/Transforms/Utils/CodeExtractor.cpp | 5 +- llvm/lib/Transforms/Utils/GlobalStatus.cpp | 25 +- llvm/lib/Transforms/Utils/InlineFunction.cpp | 8 +- llvm/lib/Transforms/Utils/Local.cpp | 1 + llvm/lib/Transforms/Utils/LoopPeel.cpp | 60 +- llvm/lib/Transforms/Utils/ModuleUtils.cpp | 13 + llvm/lib/Transforms/Utils/NameAnonGlobals.cpp | 1 + .../Utils/PromoteMemoryToRegister.cpp | 3 +- llvm/lib/Transforms/Utils/Utils.cpp | 1 + llvm/lib/Transforms/Utils/VNCoercion.cpp | 1 + .../Transforms/Vectorize/LoopVectorize.cpp | 161 ++--- .../Transforms/Vectorize/SLPVectorizer.cpp | 198 +++++- .../Transforms/Vectorize/VPRecipeBuilder.h | 3 +- llvm/lib/Transforms/Vectorize/VPlan.cpp | 6 + llvm/lib/Transforms/Vectorize/VPlan.h | 89 ++- .../Transforms/Vectorize/VPlanTransforms.cpp | 17 +- llvm/lib/Transforms/Vectorize/Vectorize.cpp | 1 + llvm/tools/llvm-ar/llvm-ar.cpp | 16 +- llvm/tools/llvm-as/llvm-as.cpp | 2 +- llvm/tools/llvm-extract/llvm-extract.cpp | 1 + llvm/tools/llvm-lto/llvm-lto.cpp | 6 +- .../llvm-objcopy/MachO/MachOLayoutBuilder.cpp | 1 + llvm/tools/llvm-profdata/llvm-profdata.cpp | 22 +- llvm/tools/llvm-readobj/ELFDumper.cpp | 1 + llvm/tools/llvm-readobj/WasmDumper.cpp | 5 +- llvm/tools/llvm-stress/llvm-stress.cpp | 3 +- llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 40 +- llvm/utils/TableGen/CodeGenSchedule.cpp | 13 +- llvm/utils/TableGen/CompressInstEmitter.cpp | 1 - llvm/utils/TableGen/GICombinerEmitter.cpp | 12 +- .../TableGen/GlobalISel/CodeExpander.cpp | 1 - llvm/utils/TableGen/GlobalISel/CodeExpander.h | 2 +- llvm/utils/TableGen/GlobalISel/GIMatchDag.h | 1 - .../TableGen/GlobalISel/GIMatchDagEdge.cpp | 1 + .../TableGen/GlobalISel/GIMatchDagInstr.h | 5 +- .../GlobalISel/GIMatchDagPredicate.cpp | 2 +- .../TableGen/GlobalISel/GIMatchDagPredicate.h | 6 +- .../GIMatchDagPredicateDependencyEdge.cpp | 1 + .../GIMatchDagPredicateDependencyEdge.h | 6 +- .../utils/TableGen/GlobalISel/GIMatchTree.cpp | 1 + llvm/utils/TableGen/GlobalISelEmitter.cpp | 2 - llvm/utils/TableGen/InfoByHwMode.cpp | 1 - llvm/utils/TableGen/InfoByHwMode.h | 2 - llvm/utils/TableGen/IntrinsicEmitter.cpp | 1 - llvm/utils/TableGen/OptParserEmitter.cpp | 1 - llvm/utils/TableGen/OptRSTEmitter.cpp | 7 - llvm/utils/TableGen/PredicateExpander.h | 4 +- llvm/utils/TableGen/RegisterBankEmitter.cpp | 1 - .../utils/TableGen/SearchableTableEmitter.cpp | 5 - llvm/utils/TableGen/TableGen.cpp | 3 +- .../WebAssemblyDisassemblerEmitter.cpp | 3 + .../TableGen/WebAssemblyDisassemblerEmitter.h | 5 +- llvm/utils/TableGen/X86DisassemblerTables.cpp | 5 +- llvm/utils/TableGen/X86DisassemblerTables.h | 7 +- llvm/utils/TableGen/X86FoldTablesEmitter.cpp | 2 - llvm/utils/TableGen/X86RecognizableInstr.cpp | 2 + llvm/utils/TableGen/X86RecognizableInstr.h | 11 +- openmp/runtime/src/dllexports | 3 + openmp/runtime/src/kmp_ftn_entry.h | 114 ++++ openmp/runtime/src/kmp_ftn_os.h | 32 + 800 files changed, 9700 insertions(+), 5583 deletions(-) delete mode 100644 compiler-rt/lib/memprof/memprof_meminfoblock.h create mode 100644 libcxx/include/__algorithm/in_in_out_result.h create mode 100644 libcxx/include/__compare/compare_partial_order_fallback.h create mode 100644 libcxx/include/__compare/compare_strong_order_fallback.h create mode 100644 libcxx/include/__compare/compare_weak_order_fallback.h delete mode 100644 lldb/docs/design/reproducers.rst create mode 100644 llvm/include/llvm/ADT/STLArrayExtras.h delete mode 100644 llvm/include/llvm/ADT/Waymarking.h create mode 100644 llvm/include/llvm/BinaryFormat/Swift.def create mode 100644 llvm/include/llvm/BinaryFormat/Swift.h diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index f39ce14bc82..63c11e237d6 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -653,6 +653,20 @@ public: /// Returns the clang bytecode interpreter context. interp::Context &getInterpContext(); + struct CUDAConstantEvalContext { + /// Do not allow wrong-sided variables in constant expressions. + bool NoWrongSidedVars = false; + } CUDAConstantEvalCtx; + struct CUDAConstantEvalContextRAII { + ASTContext &Ctx; + CUDAConstantEvalContext SavedCtx; + CUDAConstantEvalContextRAII(ASTContext &Ctx_, bool NoWrongSidedVars) + : Ctx(Ctx_), SavedCtx(Ctx_.CUDAConstantEvalCtx) { + Ctx_.CUDAConstantEvalCtx.NoWrongSidedVars = NoWrongSidedVars; + } + ~CUDAConstantEvalContextRAII() { Ctx.CUDAConstantEvalCtx = SavedCtx; } + }; + /// Returns the dynamic AST node parent map context. ParentMapContext &getParentMapContext(); @@ -2616,23 +2630,32 @@ public: /// template name uses the shortest form of the dependent /// nested-name-specifier, which itself contains all canonical /// types, values, and templates. - TemplateName getCanonicalTemplateName(TemplateName Name) const; + TemplateName getCanonicalTemplateName(const TemplateName &Name) const; /// Determine whether the given template names refer to the same /// template. - bool hasSameTemplateName(TemplateName X, TemplateName Y); + bool hasSameTemplateName(const TemplateName &X, const TemplateName &Y) const; /// Determine whether the two declarations refer to the same entity. - bool isSameEntity(NamedDecl *X, NamedDecl *Y); + /// + /// FIXME: isSameEntity is not const due to its implementation calls + /// hasSameFunctionTypeIgnoringExceptionSpec which may alter this. + bool isSameEntity(const NamedDecl *X, const NamedDecl *Y); /// Determine whether two template parameter lists are similar enough /// that they may be used in declarations of the same template. - bool isSameTemplateParameterList(TemplateParameterList *X, - TemplateParameterList *Y); + /// + /// FIXME: isSameTemplateParameterList is not const since it calls + /// isSameTemplateParameter. + bool isSameTemplateParameterList(const TemplateParameterList *X, + const TemplateParameterList *Y); /// Determine whether two template parameters are similar enough /// that they may be used in declarations of the same template. - bool isSameTemplateParameter(NamedDecl *X, NamedDecl *Y); + /// + /// FIXME: isSameTemplateParameterList is not const since it calls + /// isSameEntity. + bool isSameTemplateParameter(const NamedDecl *X, const NamedDecl *Y); /// Retrieve the "canonical" template argument. /// diff --git a/clang/include/clang/Analysis/Analyses/Dominators.h b/clang/include/clang/Analysis/Analyses/Dominators.h index f588a5c7d1d..9ac9cbe7d3e 100644 --- a/clang/include/clang/Analysis/Analyses/Dominators.h +++ b/clang/include/clang/Analysis/Analyses/Dominators.h @@ -193,7 +193,7 @@ namespace IDFCalculatorDetail { /// Specialize ChildrenGetterTy to skip nullpointer successors. template struct ChildrenGetterTy { - using NodeRef = typename GraphTraits::NodeRef; + using NodeRef = typename GraphTraits::NodeRef; using ChildrenTy = SmallVector; ChildrenTy get(const NodeRef &N) { diff --git a/clang/include/clang/Analysis/CFG.h b/clang/include/clang/Analysis/CFG.h index c5512a7e149..d8e7e1e43d8 100644 --- a/clang/include/clang/Analysis/CFG.h +++ b/clang/include/clang/Analysis/CFG.h @@ -1494,9 +1494,6 @@ template <> struct GraphTraits< ::clang::CFGBlock *> { static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); } }; -template <> struct GraphTraits - : GraphTraits {}; - template <> struct GraphTraits< const ::clang::CFGBlock *> { using NodeRef = const ::clang::CFGBlock *; using ChildIteratorType = ::clang::CFGBlock::const_succ_iterator; @@ -1506,9 +1503,6 @@ template <> struct GraphTraits< const ::clang::CFGBlock *> { static ChildIteratorType child_end(NodeRef N) { return N->succ_end(); } }; -template <> struct GraphTraits - : GraphTraits {}; - template <> struct GraphTraits> { using NodeRef = ::clang::CFGBlock *; using ChildIteratorType = ::clang::CFGBlock::const_pred_iterator; @@ -1521,9 +1515,6 @@ template <> struct GraphTraits> { static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); } }; -template <> struct GraphTraits> - : GraphTraits {}; - template <> struct GraphTraits> { using NodeRef = const ::clang::CFGBlock *; using ChildIteratorType = ::clang::CFGBlock::const_pred_iterator; @@ -1536,9 +1527,6 @@ template <> struct GraphTraits> { static ChildIteratorType child_end(NodeRef N) { return N->pred_end(); } }; -template <> struct GraphTraits> - : GraphTraits {}; - // Traits for: CFG template <> struct GraphTraits< ::clang::CFG* > diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h index f327abe6375..b5a7c061e17 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h @@ -27,6 +27,7 @@ #include "llvm/ADT/Any.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/Support/Error.h" namespace clang { namespace dataflow { @@ -106,18 +107,24 @@ template struct DataflowAnalysisState { /// Performs dataflow analysis and returns a mapping from basic block IDs to /// dataflow analysis states that model the respective basic blocks. Indices -/// of the returned vector correspond to basic block IDs. +/// of the returned vector correspond to basic block IDs. Returns an error if +/// the dataflow analysis cannot be performed successfully. template -std::vector>> +llvm::Expected>>> runDataflowAnalysis(const ControlFlowContext &CFCtx, AnalysisT &Analysis, const Environment &InitEnv) { auto TypeErasedBlockStates = runTypeErasedDataflowAnalysis(CFCtx, Analysis, InitEnv); + if (!TypeErasedBlockStates) + return TypeErasedBlockStates.takeError(); + std::vector< llvm::Optional>> BlockStates; - BlockStates.reserve(TypeErasedBlockStates.size()); - llvm::transform(std::move(TypeErasedBlockStates), + BlockStates.reserve(TypeErasedBlockStates->size()); + + llvm::transform(std::move(*TypeErasedBlockStates), std::back_inserter(BlockStates), [](auto &OptState) { return std::move(OptState).map([](auto &&State) { return DataflowAnalysisState{ diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h index e560305cf5c..cebfb66ef24 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h @@ -51,19 +51,36 @@ enum class SkipPast { /// Holds the state of the program (store and heap) at a given program point. class Environment { public: - /// Supplements `Environment` with non-standard join operations. - class Merger { + /// Supplements `Environment` with non-standard comparison and join + /// operations. + class ValueModel { public: - virtual ~Merger() = default; + virtual ~ValueModel() = default; - /// Given distinct `Val1` and `Val2`, modifies `MergedVal` to approximate - /// both `Val1` and `Val2`. This could be a strict lattice join or a more - /// general widening operation. If this function returns true, `MergedVal` - /// will be assigned to a storage location of type `Type` in `Env`. + /// Returns true if and only if `Val1` is equivalent to `Val2`. /// /// Requirements: /// /// `Val1` and `Val2` must be distinct. + /// + /// `Val1` and `Val2` must model values of type `Type`. + virtual bool compareEquivalent(QualType Type, const Value &Val1, + const Value &Val2) { + // FIXME: Consider adding QualType to StructValue and removing the Type + // argument here. + return false; + } + + /// Modifies `MergedVal` to approximate both `Val1` and `Val2`. This could + /// be a strict lattice join or a more general widening operation. If this + /// function returns true, `MergedVal` will be assigned to a storage + /// location of type `Type` in `Env`. + /// + /// Requirements: + /// + /// `Val1` and `Val2` must be distinct. + /// + /// `Val1`, `Val2`, and `MergedVal` must model values of type `Type`. virtual bool merge(QualType Type, const Value &Val1, const Value &Val2, Value &MergedVal, Environment &Env) { return false; @@ -84,9 +101,29 @@ public: /// with a symbolic representation of the `this` pointee. Environment(DataflowAnalysisContext &DACtx, const DeclContext &DeclCtx); - bool operator==(const Environment &) const; + /// Returns true if and only if the environment is equivalent to `Other`, i.e + /// the two environments: + /// - have the same mappings from declarations to storage locations, + /// - have the same mappings from expressions to storage locations, + /// - have the same or equivalent (according to `Model`) values assigned to + /// the same storage locations. + /// + /// Requirements: + /// + /// `Other` and `this` must use the same `DataflowAnalysisContext`. + bool equivalentTo(const Environment &Other, + Environment::ValueModel &Model) const; - LatticeJoinEffect join(const Environment &, Environment::Merger &); + /// Joins the environment with `Other` by taking the intersection of storage + /// locations and values that are stored in them. Distinct values that are + /// assigned to the same storage locations in the environment and `Other` are + /// merged using `Model`. + /// + /// Requirements: + /// + /// `Other` and `this` must use the same `DataflowAnalysisContext`. + LatticeJoinEffect join(const Environment &Other, + Environment::ValueModel &Model); // FIXME: Rename `createOrGetStorageLocation` to `getOrCreateStorageLocation`, // `getStableStorageLocation`, or something more appropriate. diff --git a/clang/include/clang/Analysis/FlowSensitive/MapLattice.h b/clang/include/clang/Analysis/FlowSensitive/MapLattice.h index ff403f68b7c..014cd60841e 100644 --- a/clang/include/clang/Analysis/FlowSensitive/MapLattice.h +++ b/clang/include/clang/Analysis/FlowSensitive/MapLattice.h @@ -112,7 +112,7 @@ template std::ostream & operator<<(std::ostream &Os, const clang::dataflow::MapLattice &M) { - std::string Separator = ""; + std::string Separator; Os << "{"; for (const auto &E : M) { Os << std::exchange(Separator, ", ") << E.first << " => " << E.second; @@ -125,7 +125,7 @@ template std::ostream & operator<<(std::ostream &Os, const clang::dataflow::VarMapLattice &M) { - std::string Separator = ""; + std::string Separator; Os << "{"; for (const auto &E : M) { Os << std::exchange(Separator, ", ") << E.first->getName().str() << " => " diff --git a/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h index 9f44475b14b..2d3a9e45637 100644 --- a/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h @@ -25,6 +25,7 @@ #include "clang/Analysis/FlowSensitive/DataflowLattice.h" #include "llvm/ADT/Any.h" #include "llvm/ADT/Optional.h" +#include "llvm/Support/Error.h" namespace clang { namespace dataflow { @@ -40,7 +41,7 @@ struct TypeErasedLattice { }; /// Type-erased base class for dataflow analyses built on a single lattice type. -class TypeErasedDataflowAnalysis : public Environment::Merger { +class TypeErasedDataflowAnalysis : public Environment::ValueModel { /// Determines whether to apply the built-in transfer functions. // FIXME: Remove this option once the framework supports composing analyses // (at which point the built-in transfer functions can be simply a standalone @@ -115,8 +116,9 @@ TypeErasedDataflowAnalysisState transferBlock( /// Performs dataflow analysis and returns a mapping from basic block IDs to /// dataflow analysis states that model the respective basic blocks. Indices -/// of the returned vector correspond to basic block IDs. -std::vector> +/// of the returned vector correspond to basic block IDs. Returns an error if +/// the dataflow analysis cannot be performed successfully. +llvm::Expected>> runTypeErasedDataflowAnalysis(const ControlFlowContext &CFCtx, TypeErasedDataflowAnalysis &Analysis, const Environment &InitEnv); diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index 18fac924b11..efd2af1ab1d 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -432,45 +432,45 @@ implementation detail and not intended to be used by external users. The syntax of the attribute is as follows: -.. code-block:: c++ +.. code-block:: text - class __attribute__((sycl_special_class)) accessor {}; - class [[clang::sycl_special_class]] accessor {}; + class __attribute__((sycl_special_class)) accessor {}; + class [[clang::sycl_special_class]] accessor {}; This is a code example that illustrates the use of the attribute: .. code-block:: c++ - class __attribute__((sycl_special_class)) SpecialType { - int F1; - int F2; - void __init(int f1) { - F1 = f1; - F2 = f1; - } - void __finalize() {} - public: - SpecialType() = default; - int getF2() const { return F2; } - }; + class __attribute__((sycl_special_class)) SpecialType { + int F1; + int F2; + void __init(int f1) { + F1 = f1; + F2 = f1; + } + void __finalize() {} + public: + SpecialType() = default; + int getF2() const { return F2; } + }; - int main () { - SpecialType T; - cgh.single_task([=] { - T.getF2(); - }); -} + int main () { + SpecialType T; + cgh.single_task([=] { + T.getF2(); + }); + } This would trigger the following kernel entry point in the AST: .. code-block:: c++ - void __sycl_kernel(int f1) { - SpecialType T; - T.__init(f1); - ... - T.__finalize() - } + void __sycl_kernel(int f1) { + SpecialType T; + T.__init(f1); + ... + T.__finalize() + } }]; } diff --git a/clang/include/clang/Basic/BuiltinsAArch64.def b/clang/include/clang/Basic/BuiltinsAArch64.def index 634bcaed20a..0869b87e32f 100644 --- a/clang/include/clang/Basic/BuiltinsAArch64.def +++ b/clang/include/clang/Basic/BuiltinsAArch64.def @@ -62,6 +62,9 @@ BUILTIN(__builtin_arm_ldg, "v*v*", "t") BUILTIN(__builtin_arm_stg, "vv*", "t") BUILTIN(__builtin_arm_subp, "Uiv*v*", "t") +// Memory Operations +BUILTIN(__builtin_arm_mops_memset_tag, "v*v*iz", "") + // Memory barrier BUILTIN(__builtin_arm_dmb, "vUi", "nc") BUILTIN(__builtin_arm_dsb, "vUi", "nc") diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h index 5a5c2689c68..128ca2f5df3 100644 --- a/clang/include/clang/Basic/CodeGenOptions.h +++ b/clang/include/clang/Basic/CodeGenOptions.h @@ -276,6 +276,11 @@ public: /// CUDA runtime back-end for incorporating them into host-side object file. std::string CudaGpuBinaryFileName; + /// List of filenames and section name pairs passed in using the + /// -fembed-offload-object option to embed device-side offloading objects into + /// the host as a named section. Input passed in as ',
' + std::vector OffloadObjects; + /// The name of the file to which the backend should save YAML optimization /// records. std::string OptRecordFile; diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td index fe4ac5ed6cb..5ea55b0fd31 100644 --- a/clang/include/clang/Basic/DiagnosticCommonKinds.td +++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -145,6 +145,13 @@ def warn_conflicting_nullability_attr_overriding_param_types : Warning< def err_nullability_conflicting : Error< "nullability specifier %0 conflicts with existing specifier %1">; +def warn_target_unsupported_branch_protection_option: Warning < + "ignoring '-mbranch-protection=' option because the '%0' architecture does not support it">, + InGroup; + +def warn_target_unsupported_branch_protection_attribute: Warning < + "ignoring the 'branch-protection' attribute because the '%0' architecture does not support it">, + InGroup; } // OpenCL Section 6.8.g diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index e635be6b6d1..3efedbe0f64 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -627,8 +627,10 @@ def err_cc1_unbounded_vscale_min : Error< def err_drv_ssp_missing_offset_argument : Error< "'%0' is used without '-mstack-protector-guard-offset', and there is no default">; -def err_drv_only_one_offload_target_supported_in : Error< - "Only one offload target is supported in %0.">; +def err_drv_only_one_offload_target_supported : Error< + "only one offload target is supported">; def err_drv_invalid_or_unsupported_offload_target : Error< - "Invalid or unsupported offload target: '%0'.">; + "invalid or unsupported offload target: '%0'">; +def err_drv_cuda_offload_only_emit_bc : Error< + "CUDA offload target is supported only along with --emit-llvm">; } diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index 09afa641acf..50c7f038fc6 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -181,6 +181,10 @@ public: /// global-scope inline variables incorrectly. Ver12, + /// Attempt to be ABI-compatible with code generated by Clang 13.0.x. + /// This causes clang to not pack non-POD members of packed structs. + Ver13, + /// Conform to the underlying platform's C and C++ ABIs as closely /// as we can. Latest diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h index 686a365b8c1..a49342a34f3 100644 --- a/clang/include/clang/Basic/TargetInfo.h +++ b/clang/include/clang/Basic/TargetInfo.h @@ -590,6 +590,17 @@ public: return false; } + // Different targets may support a different maximum width for the _BitInt + // type, depending on what operations are supported. + virtual size_t getMaxBitIntWidth() const { + // FIXME: this value should be llvm::IntegerType::MAX_INT_BITS, which is + // maximum bit width that LLVM claims its IR can support. However, most + // backends currently have a bug where they only support division + // operations on types that are <= 128 bits and crash otherwise. We're + // setting the max supported value to 128 to be conservative. + return 128; + } + /// Determine whether _Float16 is supported on this target. virtual bool hasLegalHalfType() const { return HasLegalHalfType; } @@ -1289,9 +1300,15 @@ public: bool BranchTargetEnforcement = false; }; + /// Determine if the Architecture in this TargetInfo supports branch + /// protection + virtual bool isBranchProtectionSupportedArch(StringRef Arch) const { + return false; + } + /// Determine if this TargetInfo supports the given branch protection /// specification - virtual bool validateBranchProtection(StringRef Spec, + virtual bool validateBranchProtection(StringRef Spec, StringRef Arch, BranchProtectionInfo &BPI, StringRef &Err) const { Err = ""; diff --git a/clang/include/clang/CodeGen/BackendUtil.h b/clang/include/clang/CodeGen/BackendUtil.h index 77d500079f0..d97af65a3d0 100644 --- a/clang/include/clang/CodeGen/BackendUtil.h +++ b/clang/include/clang/CodeGen/BackendUtil.h @@ -44,6 +44,9 @@ namespace clang { void EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts, llvm::MemoryBufferRef Buf); + + void EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts, + DiagnosticsEngine &Diags); } #endif diff --git a/clang/include/clang/Driver/Action.h b/clang/include/clang/Driver/Action.h index ba84d886a6c..3b6c9e31faa 100644 --- a/clang/include/clang/Driver/Action.h +++ b/clang/include/clang/Driver/Action.h @@ -73,6 +73,7 @@ public: OffloadBundlingJobClass, OffloadUnbundlingJobClass, OffloadWrapperJobClass, + LinkerWrapperJobClass, StaticLibJobClass, JobClassFirst = PreprocessJobClass, @@ -642,6 +643,17 @@ public: } }; +class LinkerWrapperJobAction : public JobAction { + void anchor() override; + +public: + LinkerWrapperJobAction(ActionList &Inputs, types::ID Type); + + static bool classof(const Action *A) { + return A->getKind() == LinkerWrapperJobClass; + } +}; + class StaticLibJobAction : public JobAction { void anchor() override; diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h index 9ae34a2eaf0..93e1eca6a98 100644 --- a/clang/include/clang/Driver/Driver.h +++ b/clang/include/clang/Driver/Driver.h @@ -12,6 +12,7 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Basic/LLVM.h" #include "clang/Driver/Action.h" +#include "clang/Driver/InputInfo.h" #include "clang/Driver/Options.h" #include "clang/Driver/Phases.h" #include "clang/Driver/ToolChain.h" @@ -38,13 +39,14 @@ namespace clang { namespace driver { - class Command; - class Compilation; - class InputInfo; - class JobList; - class JobAction; - class SanitizerArgs; - class ToolChain; +typedef SmallVector InputInfoList; + +class Command; +class Compilation; +class JobList; +class JobAction; +class SanitizerArgs; +class ToolChain; /// Describes the kind of LTO mode selected via -f(no-)?lto(=.*)? options. enum LTOKind { @@ -171,9 +173,11 @@ public: /// The file to log CC_LOG_DIAGNOSTICS output to, if enabled. std::string CCLogDiagnosticsFilename; + /// An input type and its arguments. + using InputTy = std::pair; + /// A list of inputs and their types for the given arguments. - typedef SmallVector, 16> - InputList; + using InputList = SmallVector; /// Whether the driver should follow g++ like behavior. bool CCCIsCXX() const { return Mode == GXXMode; } @@ -413,6 +417,18 @@ public: void BuildUniversalActions(Compilation &C, const ToolChain &TC, const InputList &BAInputs) const; + /// BuildOffloadingActions - Construct the list of actions to perform for the + /// offloading toolchain that will be embedded in the host. + /// + /// \param C - The compilation that is being built. + /// \param Args - The input arguments. + /// \param Input - The input type and arguments + /// \param HostAction - The host action used in the offloading toolchain. + Action *BuildOffloadingActions(Compilation &C, + llvm::opt::DerivedArgList &Args, + const InputTy &Input, + Action *HostAction) const; + /// Check that the file referenced by Value exists. If it doesn't, /// issue a diagnostic and return false. /// If TypoCorrect is true and the file does not exist, see if it looks @@ -503,13 +519,12 @@ public: /// BuildJobsForAction - Construct the jobs to perform for the action \p A and /// return an InputInfo for the result of running \p A. Will only construct /// jobs for a given (Action, ToolChain, BoundArch, DeviceKind) tuple once. - InputInfo - BuildJobsForAction(Compilation &C, const Action *A, const ToolChain *TC, - StringRef BoundArch, bool AtTopLevel, bool MultipleArchs, - const char *LinkingOutput, - std::map, InputInfo> - &CachedResults, - Action::OffloadKind TargetDeviceOffloadKind) const; + InputInfoList BuildJobsForAction( + Compilation &C, const Action *A, const ToolChain *TC, StringRef BoundArch, + bool AtTopLevel, bool MultipleArchs, const char *LinkingOutput, + std::map, InputInfoList> + &CachedResults, + Action::OffloadKind TargetDeviceOffloadKind) const; /// Returns the default name for linked images (e.g., "a.out"). const char *getDefaultImageName() const; @@ -617,10 +632,10 @@ private: /// Helper used in BuildJobsForAction. Doesn't use the cache when building /// jobs specifically for the given action, but will use the cache when /// building jobs for the Action's inputs. - InputInfo BuildJobsForActionNoCache( + InputInfoList BuildJobsForActionNoCache( Compilation &C, const Action *A, const ToolChain *TC, StringRef BoundArch, bool AtTopLevel, bool MultipleArchs, const char *LinkingOutput, - std::map, InputInfo> + std::map, InputInfoList> &CachedResults, Action::OffloadKind TargetDeviceOffloadKind) const; diff --git a/clang/include/clang/Driver/Job.h b/clang/include/clang/Driver/Job.h index 6e3b51f2a79..ae9337f3c2d 100644 --- a/clang/include/clang/Driver/Job.h +++ b/clang/include/clang/Driver/Job.h @@ -208,6 +208,8 @@ public: Arguments = std::move(List); } + void replaceExecutable(const char *Exe) { Executable = Exe; } + const char *getExecutable() const { return Executable; } const llvm::opt::ArgStringList &getArguments() const { return Arguments; } diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index b3de12e8c7b..53e68ed2cef 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -638,8 +638,8 @@ def _DASH_DASH : Option<["--"], "", KIND_REMAINING_ARGS>, Flags<[NoXarchOption, CoreOption]>; def A : JoinedOrSeparate<["-"], "A">, Flags<[RenderJoined]>, Group; def B : JoinedOrSeparate<["-"], "B">, MetaVarName<"">, - HelpText<"Search $prefix/$triple-$file and $prefix$file for executables, libraries, " - "includes, and data files used by the compiler. $prefix may or may not be a directory">; + HelpText<"Search $prefix$file for executables, libraries, and data files. " + "If $prefix is a directory, search $prefix/$file">; def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>, HelpText<"Search for GCC installation in the specified directory on targets which commonly use GCC. " "The directory usually contains 'lib{,32,64}/gcc{,-cross}/$triple' and 'include'. If specified, " @@ -1143,8 +1143,7 @@ defm autolink : BoolFOption<"autolink", // languages and accept other values such as CPU/GPU architectures, // offload kinds and target aliases. def offload_EQ : CommaJoined<["--"], "offload=">, Flags<[NoXarchOption]>, - HelpText<"Specify comma-separated list of offloading target triples" - " (HIP only)">; + HelpText<"Specify comma-separated list of offloading target triples (CUDA and HIP only)">; // C++ Coroutines TS defm coroutines_ts : BoolFOption<"coroutines-ts", @@ -1152,6 +1151,10 @@ defm coroutines_ts : BoolFOption<"coroutines-ts", PosFlag, NegFlag>; +def fembed_offload_object_EQ : Joined<["-"], "fembed-offload-object=">, + Group, Flags<[NoXarchOption, CC1Option]>, + HelpText<"Embed Offloading device-side binary into host object file as a section.">, + MarshallingInfoStringVector>; def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">, Group, Flags<[NoXarchOption, CC1Option, CC1AsOption]>, MetaVarName<"