From 44983fd083a9517afc3868d21d665e436eea5e08 Mon Sep 17 00:00:00 2001 From: Djordje Antic Date: Tue, 8 Jul 2025 04:09:36 -0500 Subject: [PATCH 1/6] Squashed 'external/llvm-project/' changes from e8215edf65d2..659e9cd04732 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 659e9cd04732 merge main into amd-staging (#2991) dacd132ef399 Fix Unknown immediate size X86MCCodeEmitter::encodeInstruction (#2990) 8f5727a2a2f8 merge main into amd-staging 3afeb1805010 Fix Unknown immediate size X86MCCodeEmitter::encodeInstruction 80c3b03f99af [Comgr][NFC] Refactor remove dir for windows 3c76a054ac4c [CIR] Implement functional cast to ComplexType (#147147) b8f5cbb4ffbf [OpenACC][CIR] 'cache' construct lowering (#146915) 59b1d631d7c8 [llvm][SandBoxIR] Fix Windows+clang compiler warning (#146905) 28649f211742 [Clang] accept @tparam on variable template partial specializations (#147219) 68309adef359 [NFC] Clean up poison folding in simplifyBinaryIntrinsic (#147259) 8ae8d3183272 [Offload] Add liboffload unit tests for shared/local memory (#147040) 0f48bafafc38 [ExtractAPI] Include tilde in destructor name (#146001) 1121034dd1c4 Triple: Record default exception handling type b7c4ac2db4cd NFC, use structured binding to simplify the code. 6aa33ee971f6 [AArch64] arm64-bitfield-extract.ll - regenerate test checks 5f2e88a1254e [NFC][TableGen] Rename `CodeGenTarget` instruction accessors (#146767) 17d6aa01ec0c [ARM] Fix expansion of ABS in a call sequence (#147270) 599b9def29a8 [AArch64] sve-vscale.ll - cleanup test checks 7c2182a132c7 NFC, use structured binding to simplify the code in SourceManager.cpp. 543f94831245 [AMDGPU] Preserve exact flag for lshr (#146744) d3d8ef7e416c [PowerPC] licm-xxsplti.ll - regenerate test checks 45d679218aeb [clang][OpenMP] Fix signed v unsigned comparison fa859ed8c6bf [AMDGPU][NFC] Fix typo "store" -> "load" in comment for AMDGPUTLI::performLoadCombine (#147298) c80fa2364bee [DAG] SDPatternMatch m_Zero/m_One/m_AllOnes have inconsistent undef h… (#147044) acb4fff866f9 [NFC] Fix GCC warning on enum/non-enum ternary thanks to 438863a0 1a1a11f7096d [clang][OpenMP] Issue a warning when parsing future directive spelling (#146933) ea62de5b1dc0 [mlir] NFC - refactor id builder and avoid leaking impl details (#146922) 3277f623440f [SDAG] Remove invalid check (NFC) (#146899) 747496269a44 [Hexagon] build-vector-float-type.ll - regenerate test checks 6190d407e09c [Hexagon] vect-vshifts.ll - regenerate test checks 9ebe6f9a1f9e [lldb][test] Fix libstdc++ std::variant formatter tests for valueless variants (#147283) 16dad11f503e [ValueTracking] Have sub and xor in KnownNonZero take the same exact path (#146975) c3c3919dc2d3 Revert "[DenseMap] Do not align pointer sentinel values (NFC) (#146595)" 60630310e9a4 [clang-cl] Support /std:clatest (#147284) 0a6283696981 [mlir][gpu][transforms] Add support for mapping to lanes (#146912) 46e3ec0244c4 [BOLT][NFCI] Report perf script time (#147232) 3d6407965d5a [clang][OpenMP] Use DirectiveNameParser to parse directive names (#146779) 20864c4379f3 [LAA] Strip outdated comment in isDependent (NFC) (#146367) 9d9d68fd3b3e AMDGPU: Fix using underaligned atomicrmw in atomic scan tests b5401624e1f1 DAG: Add RTLIB::getPOW helper (#147274) db389bda9b28 Revert "[clang][modules-driver] Add scanner to detect C++20 module presence" (#147286) 2bb72924c245 [clang] Remove source range from CXXOperatorCallExpr (#147028) 6855573700c3 [flang][OpenMP] Fix parallel-firstprivate-clause-scalar.f90 test (#146932) 95862d089735 [clang] Fix manual memory management with SmallVector in ConceptRef (#147231) 3c86b747286f [AMDGPU] add_i1.ll / sub_i1.ll - regenerate test checks 49dc163d15ca [NVPTX] mulwide.ll - regenerate test checks c4386031ac01 [RISCV] Use cached SubtargetInfo in AsmPrinter (NFC) (#147269) e14e98290e71 [lldb][test] Combine libstdc++ and libc++ std::shared_ptr tests into generic test (#147141) 22357fe33a8a [analyzer] Avoid unnecessary super region invalidation in `CStringChecker` (#146212) 1113224f9444 [VectorCombine] Account for IRBuilder simplification in translateExt. 6daf2b956d0b [MLIR][Linalg] Remove elemwise_unary and elemwise_binary (#147082) 0aab8e4ccc18 [MLIR][LLVM][NFC] Remove unused argument from parseOptionalLLVMKeyword (#147058) 8315167a76e4 [Driver][RISCV] Fix incorrect compiler-rt path override in BareMetal toolchain after RISCVToolChain removal (#146849) ae441382aec9 [MIPS] setcc-se.ll - regenerate test checks 8a5458c79ac7 [C23] Fix typeof handling in enum declarations (#146394) 40fb90efed7b [lldb][Formatters] Add shared/weak count to libstdc++ std::shared_ptr summary (#147166) 87632451165a [X86] pr134607.ll - regenerate test checks fb845f93c003 [LAA] Hoist setting condition for RT-checks (#128045) e7bcd3f7c743 ARM: Remove fast flags from ldexp calls test f34de0a14fa9 [clang-tidy] [NFC] Potential dereference of nullptr. (#143145) c995c5035567 [KeyInstr] Add bitcode support (#147260) 7a6435bec590 [DenseMap] Do not align pointer sentinel values (NFC) (#146595) c19c71b90593 [lldb][test] Split out libc++ std::string tests that check corrupted strings (#147252) 912ab5241379 [lldb][test] Adjust import-std-module shared_ptr/weak_ptr tests 84e54515bc4e [AArch64] Add support for -mcpu=gb10. (#146515) e2aa8781e18a [RISCV] Fix out-of-bounds offsets in fixed vector splice tests. NFC (#147247) ded142671663 [clang][modules-driver] Add scanner to detect C++20 module presence (#145220) de7ff1f2248e [mlir][spirv][nfc] Add StorageImageReadWithoutFormat capability to the Target test (#145949) b6b2561337f5 [mlir][spirv] Add support for Aligned memory operand in CoopMatrix memory operations (#145480) 52383956f8b7 [DAG] Replace DAGCombiner::ConstantFoldBITCASTofBUILD_VECTOR with SelectionDAG::FoldConstantBuildVector (#147037) 465f2b05712d DAG: Fix asserting in error case for frexp softening (#147236) 7cd179612d7a [libclc] Fix typo in OpenCL header math/sincos.h (#147244) b1a8c8a32c4b [flang][test] Fix REQUIRES and options for a few x86 specific tests (#146872) 3e934dded0d9 [flang][test] Fix test REQUIRES and options for aint.f90 (#146870) ea685890b8b2 [libclc] Reduce include usage in OpenCL builtins (#146840) 08defcb6d3cd DAG: Fix asserting in error case for powi softening (#147237) 074ccde3b092 [lldb][Formatter] Consolidate libstdc++ and libc++ unique_ptr formatter tests into generic test (#147031) 0860f7aaeb42 [clangd][NFC] fix broken documentation link (#147088) 30836781e801 [X86] Don't use `rbp` when it's reserved (#146638) 8a221a585ca7 [Flang][OpenMP] Push context when parsing DECLARE VARIANT (#147075) 5271f9fba9dd [Flang][Doc] NFC: Minor fix for headings (#147077) 1c8283a30c6e [BasicTTIImpl] Add cost entries for ldexp, [l]lround (#146373) c50415bb82a7 [AArch64] Do not promote scalable constants to global variables (#146926) e430581e66ff [libc][bazel] Add missing header dependencies. 49d7c53756bc [lldb][test] Combine libstdc++ and libc++ std::map tests into generic test (#147174) 6fec6a98c015 [lldb][Formatters] Make libc++ and libstdc++ std::shared_ptr formatters consistent with each other (#147165) d06956e24afa [lldb][Formatters] Use container summary helper for libstdc++ formatters (#147140) 7fea83e3143e [clang] NFC, use LocalLocOffsetTable in getFIleIDLocal. 784bd61fc497 [clang] Speedup getFileIDLocal with a separate offset table. (#146604) b7d4735a0e2a [lldb][test] Combine libstdc++ and libc++ vector tests into generic test (#147137) d8ef15637935 DAG: Remove verifyReturnAddressArgumentIsConstant (#147240) dc14cd059418 [Comgr] Add test for get_version() API fb628238c540 [Comgr] Add test for status_string() API 69c5925aee39 [Comgr] Add test for OpenCL 2.0 ca634f3762d3 [Comgr] Add test for DataAction APIs 19afd27eb8ef [Flang] Fix ACOSD and ASIND (fixes issue #145593) (#145656) 721adc18b77a [CodeGen] Fix stale comment about register coalescing order (#146762) a5af8745039f [clang-format][NFC] Use `empty()` instead of comparing size() to 0 or 1 0fbaeafd7ff7 [CodeGen][NPM] Allow nested MF pass managers for -passes (#128852) 7f90a5c2d8d1 MCAsmBackend: Simplify FT_Data/FT_Relaxable code d733c8e5c584 [Orc] Fix error handling in `ORCPlatformSupport::initialize` (#144637) 91cc33f3219c [TargetLowering] hasAndNotCompare should be checking for X, not Y (#146935) 1b136824bb81 [DebugInfo][LICM] Fix debug value loss caused by hoisting the cmp instructions (#146640) 3f8af4f55129 [NFC][AMDGPU] Pre-commit srl preserve flag test (#146747) 3f33e7ba5b08 [RISCV] Add Andes XAndesVSIntLoad (Andes Vector INT4 Load) extension (#147005) 9d8a1bec2b55 [Sema] Remove an unnecessary cast (NFC) (#147203) be4cd9f4da98 [mlir] Remove unused includes (NFC) (#147206) 7f9bacd58e86 [IR] Remove an unnecessary cast (NFC) (#147205) 15653108b11e [Serialization] Remove an unnecessary cast (NFC) (#147204) 29b2b2263f9e [TargetParser] Use StringRef::consume_front (NFC) (#147202) eca05fde844b [X86] Switch operands order for FMINIMUMNUM/FMAXIMUMNUM (#147193) dc5d353f3a0a AArch64: Fix some missing llvm.frexp test coverage (#146691) 9865d7cb635f ARM: Add missing test coverage for windows frexp libcalls (#146690) 5a8e60e7249b [mlir] Use `llvm::fill` instead of `std::fill`(NFC) (#146889) 718e647a0c8f [mlir] Fix Wparentheses warning (#146893) 7b0f70a9b26a WebAssembly: Stop changing MCAsmInfo's ExceptionsType based on flags (#146343) 408e87184f82 MCAssembler: Merge fragmentNeedsRelaxation into relaxInstruction fa9cd473284f [NFC][libclc] Rename __CLC_FUNCTION to either FUNCTION or __IMPL_FUNCTION (#146999) eeba57a860e5 LoongArch: Remove unused relaxInstruction 5a70a9949c5a MCA: Remove unused MAB 24ba6d753de6 MCAsmBackend: Use assert for unreachable relaxInstruction dump code 3af5317c8938 M68k: Simplify relaxation code and reduce MCInst uses 01c97b4953e8 MCA: Remove relaxInstruction call d476c1db5120 merge main into amd-staging (#2978) 2235e20885b4 MCAsmBackend: Remove redundant relaxInstruction overrides 51f4e2cda2b3 [Bitcode][NFC] Add abbrev for FUNC_CODE_DEBUG_LOC (#147211) 5ccbea9f480d [clang-format][NFC] Replace size() with empty() (#147164) 6a9a16da7a38 [VPlan] Replace RdxDesc with RecurKind in VPReductionPHIRecipe (NFC). (#142322) 6d77b8261f39 [LV] Add tests where LCSSA phis could be re-used during SCEV expansion. c35fbb5460b4 [VPlan] Use VPReductionPHIRecipe::isOrdered instead of CM (NFC). 6d67794d164e X86MCCodeEmitter: Work around gcc/value-range.cc bug in GCC 13.3.0 c5fff132d019 [LV] Add LVL::getRecurrenceDescriptor (NFC). fcf1e4834ed4 merge main into amd-staging cf0604723158 [LV] Remove AddedAnyChecks, check directly instead (NFC). 1828381ed259 [clang][bytecode] Fix APValue generation for RValueReferenceType (#147207) e26f8ba8b6ed [NFC] Add `_LOWLEVEL_` before dwarf low-level library header guards (#147172) 494253f5d6d3 [DebugInfo] [DWARF] Fix C to CMake comment (#147199) 923a3cc160a1 [LLD] Fix crash on parsing ':ALIGN' in linker script (#146723) 9c7320e5d370 [clang][bytecode] Fix visiting for-range loop variable (#147188) aa9e02cc10f8 [AArch64] Add lrint and lround costmodel tests. NFC 0d1e5ab2fd9c [libc++] P2655R3 common_reference_t of reference_wrapper Should Be a Reference Type (#141408) f1549befc125 [AArch64] Add ldexp cost-model tests. NFC ec9eefcef560 [clang][bytecode] Fix a crash in overflow builtins (#147189) f63674cbf6d2 merge main into amd-staging (#2975) db4e927f9f02 [clang][bytecode] Misc union fixes (#146824) 6c153e50f8b2 [clang-tidy] Fix false positives with template in `misc-unconventional-assign-operator` check (#143292) ab92c68c5c38 [libc][NFC] Fix func name in comment. (#147183) 13f7a1fb5904 [libc++] LWG 3987 provide iterator.range access from flat_{map,set} (#137524) fc75dda7f6da merge main into amd-staging ca297cd6e4ad [MLIR] Add support for IntArrayProp (#146685) 6c257f7d0d33 [PowerPC] fp-branch.ll - regenerate checks 5f44b5a3054d [libc++][doc][NFC] update release notes on P3372R3 (#147161) c358979d7f45 [libc++] fix atomic::wait memory order (#146267) ba7d78ac4597 [DAG] foldABSToABD - fallback to value tracking if the (ABS (SUB LHS, RHS)) operands aren't extended (#147053) 7ef0f9a216b1 merge main into amd-staging (#2974) bdbaa9636d27 merge main into amd-staging 9f66ebe42715 MC: Eliminate redundant fragment relaxation 6f87e5812d91 merge main into amd-staging (#2973) aec88832df5e MC: Remove unneeded MCFixupKind casts d575f802104f MCFixup: Make MCFixupKind a type alias 878ce210e30f [clang-format] Propagate `LeadingEmptyLinesAffected` when joining lines (#146761) c43efcb039dd [MLIR][MemRef]-Add basic folding for memref ViewOp (#146237) 5a4002349786 MCAsmBackend: Reduce FK_NONE uses 83401ed6a233 [clang][bytecode] Narrow allocated single-array Pointer (#147160) 178e18263f1a [InstCombine] Add tests for moving exts across identity shuffles. 6433030f6984 [Hexagon] Use range-based for loops (NFC) (#147157) 16435a87b6a7 [CodeGen] Remove an unnecessary cast (NFC) (#147155) 945ed2ed5eea [MLIR][SCF] fix loop pipelining pass use of uninitialized value (#146991) 30298f91367f MC: Simplify fragment code. NFC 9a934611c36f merge main into amd-staging 602791c0c1a3 Revert "[AMDGPU] SelectionDAG divergence tracking should take into ac… (#2971) 244e053b6c39 MC: Remove llvm/MC/MCFixupKindInfo.h 152c9d577c41 MC: Sink FKF_IsAlignedDownTo32Bits to needed targets 3f4be893e3ba AArch64AsmBackend: Remove redundant PCRelFlagVal 430c0376c8a0 [Sema] Remove an unnecessary cast (NFC) (#147154) fb2c7610e831 [clang][bytecode] Fix comparing pointers pointing to base classes (#146285) 38b8ef16f76f [mlir] Remove unused includes (NFC) (#147158) b94a9bc741e5 ARM: Improve branch fixup test 7d65cb1952dc [ARM] Copy (SELECT_CC setgt, iN lhs, -1, 1, -1) -> (OR (ASR lhs, N-1), 1 from AArch64 to ARM (#146561) 3448e9c075aa [AArch64][GlobalISel] Fix lowering of i64->f32 itofp. (#132703) 9eb4fc700636 [libc++] constexpr `flat_set` (#140360) 113ea3d15be0 [gn build] Port ca697096aa6f f17a6387daf0 [gn build] Port 1121d64ba96d ca697096aa6f [libc++] Granularize (#146650) 1121d64ba96d [libc++][NFC] Merge add_{r,l}value_reference.h (#147022) bdbac2bb4954 [libc++] default some special members in map and set (#147081) 22f8ceded4e1 [libc++] Add the thread safety annotations unconditionally (#117497) c9d9c3e34984 [InstCombine] Fold `icmp pred X + K, Y -> icmp pred2 X, Y` if both X and Y is divisible by K (#147130) 0bc6d60b9b53 [llvm] Fix typos in documentation (#147129) 15f07db6a541 [clang] Fix a typo in documentation (#147128) 2d71692bcfe9 Revert "[AMDGPU] SelectionDAG divergence tracking should take into account Target divergency. (#144947)" e64289baa00f [clang][Sema] Unify getPrototypeLoc helpers in SemaCodeComplete and clangd (#143345) 0a067dc10700 [Attributor] Swap range metadata to attribute for calls. (#108835) 1941d40a97bf merge main into amd-staging (#2970) 9d994d1c08c4 [bazel] Port b9b2661f72ac5f9d4f23d9bb83131aa3d46020b9 b726713e4fcb merge main into amd-staging a38cf8573890 [MachineLICM] Let targets decide if copy instructions are cheap (#146599) fb13be06e18d MC: Generalize evaluateTargetFixup 1947eb93974a merge main into amd-staging (#2967) cd39eaeb376e MC: Merge MCFixupKindInfo.h into MCAsmBackend.h a49a5dba5d82 test: Update mc-dump.s 65e11f600db3 [Clang][AArch64] Remove redundant tune args to the backend (#146896) 3d6f4fb5f7ac [Clang][Sema] Do not perform error recovery for invalid member using-declaration in C++20+ mode (#147003) 9372f4050a94 [LoongArch] Pre-commit for optimizing bitcast extracted fp elements. NFC 32f83d38bd62 MCFixup: Remove FK_PCRel_ 158fa4ae8389 AMDGPU: Replace deprecated FK_PCRel_ with FK_Data_ fixup and PCRel flag 49c91ec6f179 Hexagon: Remove dead deprecated FK_PCRel_4 use abaa55d937e5 COFF: Replace deprecated FK_PCRel_ with FK_Data_ fixup and PCRel flag 970ed59e031d CSKY: Remove unused deprecated FK_PCRel_4 a26f8f234843 BPF: Replace deprecated FK_PCRel_ with FK_Data_ fixup and PCRel flag 66952f7b2d61 M68k: Remove unused deprecated FK_PCRel_ c20379198c7f X86: Replace deprecated FK_PCRel_ with FK_Data_ fixup and PCRel flag 22c590bd3c75 [RISCV][ISel] Optimize setcc with mask test idioms (#147015) ae3d3135277a VE: Remove dead FK_PCRel_* code c05593b1908e M68: Replace FK_PCRel_ with FK_Data_+PCRel 5760c064bbe7 M68,test: Remove CHECK lines for MCAsmStreamer's fixup output 45509a8c6d2d M68,test: Remove CHECK lines for MCAsmStreamer's fixup output 6ec27f1b8a5a MCFixup: Remove FKF_IsPCRel 74fcff4905ff CSKY: Remove unneeded MCFixupKindInfo::FKF_IsPCRel d85536c5e362 CSKYMCCodeEmitter: Set PCRel at fixup creation 0e9571df982f M68kMCCodeEmitter: Standardize how fixups are appended e0384a7c5c17 merge main into amd-staging (#2965) 09372335c51b X86: Test fixup/relocation with -filetype=obj 3e2e99bc6778 [Analysis] Remove traces of BlockEdgesAdder (#147102) f78d74f9c86f [llvm] Use llvm::fill (NFC) (#147099) 57cb9265bf48 [Analysis] Drop const from a return type (NFC) (#147098) 21fb7e68ef05 [Driver] Use range-based for loops (NFC) (#146987) add2c58e6560 [Index] Remove an unnecessary cast (NFC) (#146944) 755b4732cf81 VEMCCodeEmitter: Set PCRel at fixup creation 7b7dc151a75b AVRMCCodeEmitter: Set PCRel at fixup creation 3544eba44a33 MSP430MCCodeEmitter: Set PCRel at fixup creation b418e73becc1 AMDGPUMCCodeEmitter: Set PCRel at fixup creation 21cf7bd4ec51 BPFMCCodeEmitter: Set PCRel at fixup creation 56cf2cb0eadd HexagonMCCodeEmitter: Set PCRel at fixup creation def731a787da MipsMCCodeEmitter: Set PCRel at fixup creation adc566006d65 merge main into amd-staging 5b7f1c17d943 BOLT: Replace deprecated MCFixupKindInfo::FKF_IsPCRel with MCFixup::isPCRel 3c5d03a86a04 SystemZMCCodeEmitter: Standardize how fixups are appended 637a38211824 SystemZMCCodeEmitter: Remove unneeded MCFixupKindInfo::FKF_IsPCRel 8bb4e534284d PPCMCCodeEmitter: Set PCRel at fixup creation 6670fe2ed498 ARMMCCodeEmitter: Set PCRel at fixup creation 73c03b92cec6 XtensaMCCodeEmitter: Set PCRel at fixup creation 2bfc488d34ef X86MCCodeEmitter: Remove unneeded MCFixupKindInfo::FKF_IsPCRel 955c04862e99 AArch64MCCodeEmitter: Standardize how fixups are appended 43397e5fe3de LoongArchMCCodeEmitter: Set PCRel at fixup creation b9257a34a9e0 RISCVMCCodeEmitter: Set PCRel at fixup creation 7d500b115db5 SPARC: Remove unneeded MCFixupKindInfo::FKF_IsPCRel 83fbd8690911 SPARCMCCodeEmitter: Set PCRel at fixup creation d337e09e73b3 SystemZMCCodeEmitter: Set PCRel at fixup creation eb84af49a1bf AArch64MCCodeEmitter: Set PCRel at fixup creation 07ae19c132e1 [RISCV] Move performCombineVMergeAndVOps to RISCVVectorPeephole (#144076) 07286b1fcdec [InstCombine] Propagate poison pow[i], [us]add, [us]sub and [us]mul (#146750) 6db02dc4311b [Clang] Introduce `--offload-targets` for `-fopenmp-targets` (#146594) 454e4e3e29d8 [mlir][AffineExpr] Order arguments in the commutative affine exprs (#146895) 1f3f9874b025 [VPlan] Fix crash when narrowing interleave-groups with reuse. ea600576a6f9 MCFixup: Add PCRel to ctor parameter and set it in X86MCCodeEmitter fa9adbfda967 [mlir] Remove unused includes (NFC) (#147101) ed0ee3a419f3 [mlir] Use llvm::fill (NFC) (#147100) 1be685ac2395 [mlir] Remove unnecessary casts (NFC) (#147097) e2510b189dae [clang] SourceManager: Cache offsets for LastFileIDLookup to speed up getFileID (#146782) a7cf78fd5261 merge main into amd-staging 372752c2ddd0 MCFixup: Remove unused Loc argument 20b3ab5683c6 MCFixup: Remove unused Loc argument 777391a2164b MCFixup: Improve location accuracy and remove MCFixup::Loc 833839ba65fd [ASTMatchers][NFC] improve 'isInteger' docs to show matching of unsigned (#147012) 8740ff822d46 [mlir][docs][python] Fix up testing docs (#147092) 249acb8e4913 MC: Update tests that check column information b38de6c18ed7 [NFCI][LLVM] Adopt `ArrayRef::consume_front()` in a few places (#146793) 7b517cf743f1 MCParser: Add SMLoc to expressions 06922c463a57 [PowerPC] Pre-commit test case to ensure that milicode is not used for memcmp, but instead a library call is used on AIX OS. (#146948) 3c0058c8e835 Manual update of LLVM_MAIN_REVISION to 543426 (#2962) 6a948145aa7a [HLSL][RootSignature] Update `setDefaultFlags` to account for Root Signature Version (#145828) b0473c599b04 [InstCombine] Pull extract through broadcast (#143380) cc6a864788ff [RISCV][VLOPT] Add support for vfrec7.v (#146918) 2472cdcb69d2 [InstCombine] Refine nuw propagation in `OptimizePointerDifference` (#147059) fd5ed046fdca [Flang][OpenMP][NFC] Remove flag toggling deprecated no hlfir flow in map-types-and-sizes.f90 (#146995) 6b19cdcefacb [Offload][amdgpu] Map `INVALID_CODE_OBJECT` to `INVALID_BINARY` (#147070) 0008af882dc3 [SROA] Allow as zext index when unfolding GEP select (#146929) a4f31ccfa0ef [mlir-tblgen] Emit named operand indices (#146839) c08ef07e8b70 Manual update of LLVM_MAIN_REVISION to 543426 a1789497f9f5 [gn build] Port 56e3fc4c42d1 56e3fc4c42d1 [NFC][HLSL][RootSignature] Split up `HLSLRootSignatureUtils` (#146124) a438c6099786 [X86][FP16] Do not customize WidenLowerNode for half if VLX not enabled (#146994) e8543213e5fc [IR] Use llvm::for_each (NFC) (#146989) 60fca53ad64c [llvm] Use llvm::fill (NFC) (#146988) a465e35908b6 [Sema] Remove an unnecessary cast (NFC) (#146985) f46c1d6bcc3b [PowerPC] Fix a warning 5224a17aa7cb [FuzzMutate] Prevent the mutator from generating illegal memory operations (#144885) 32946eb124e8 [lldb][Formatters] Fix weak reference count for std::shared_ptr/std::weak_ptr (#147033) 9fcea2e4656a [ARM] Add neon vector support for roundeven 258c048f643f [clang][bytecode] Fix copy constructors for empty unions (#147050) 45909ec469ce [PowePC] using MTVSRBMI instruction instead of constant pool in power10+ (#144084) e5cd9bdfea90 [NFC][TableGen] Delete extra spaces in comments (#147004) 79d5db4613d4 [NFC][CodeGen] Improve comments in Target.td (#147006) 740da004af5e [DAG] Fix static analyzer warning about mismatched argument comments in isConstOrConstSplat. NFC. ed17bf1e4c54 [flang] Fix tests broken by #146734 (#147055) 5eb195fa90c7 [mlir][Vector] Fold vector.constant_mask to SplatElementsAttr (#146724) 0b4941a30f9a [mlir][xevm] Add missing static value utils dependency (#147051) af2bb8f82605 [Clang] Correctly handle allocations in the condition of a `if constexpr` (#146890) ad20dc0a87fc [mlir][Transforms] Add `ApplyConversionAction` for profiling purposes (#146208) b9b2661f72ac [MLIR][Dialect] Add XeVM dialect (#144811) 274e798a9832 [flang] use set_union instead of merge in added DerivedTypeCache (#147024) 0ba59587fa98 [flang] Optimize assignments of multidimensional arrays (#146408) d17a248fc614 [libcxx][test] Correct syntax of lit directives in some tests (#146886) 6faccd73128a merge main into amd-staging (#2961) 4a6d78e66c56 [MLIR][ODS] Improve diagnostic for using a property as an anchor d0db199bcc0e [PowerPC] anyext_srl.ll - regenerate checks ec752c67669f [LoongArch] Pre-commit tests for optimizing insert bitcast fp element ea5ee2e74347 [mlir][OpenMP] Don't allow firstprivate for simd (#146734) 3099b7eb5da7 [Passes] Move LoopInterchange into optimization pipeline (#145503) 03cfba484fff [MLIR][IRDL][CMake] CMake fixes for cross-compilation (#145672) 043789519a11 [X86] combineShiftToPMULH - convert matching to use SDPatternMatch. NFC. 222e795347c1 [libclc] Fix target dependency be63b2309a6a [OpenCL] Add decls for cl_intel_subgroup_local_block_io (#146656) 81e6552a3d68 [libclc] Make library output directories explicit (#146833) 1f8e2a4b1068 [libc++][NFC] Remove __remove_uncvref (#140531) 8f6a964c89c3 [libc++] Fix tests broken on the Buildkite CI (#146733) a77446313367 [libc++][NFC] Fixed some wrongly spelled `_LIBCPP_STD_VER` in comments (#147008) a34b1755e23c [DLCov] Origin-Tracking: Add debugify support (#143594) de3c8410d87f [debuginfo][coro] Emit debug info labels for coroutine resume points (#141937) 2fcf1f8279b8 [MsDemangle] Use LLVM style RTTI for AST nodes (#143410) d74c9ef8370c [lldb][test] Skip TestFrameVarDILGlobalVariableLookup.py on older AArch64 macOS version 0106585499c4 Revert "[flang][OpenMP] Allocate `reduction` init temps on the stack for GPUs (#146667)" cb286da0011b merge main into amd-staging c7d3b818963a [bazel] Port 0ceb0c377a3e67b70965c32e7f21fe8b33f555d2 a89e232058a2 [lldb][DataFormatter] Format libstdc++ unique_ptr like we do libc++ (#146909) 25f05c02afb9 [llvm][release] On release page, explain package types and verification (#138144) 6181a0689736 [NFC][LoopFuse] Regenerate LoopFusion tests using UTC (#146902) 7e3e2e1b8c6f MCParser: Add SMLoc to expressions 7ee2c72a8e5b [AArch64] Mark aarch64_set_fpmr as IntrWriteMem (#146353) d84df61c001a [flang] Fix x86 REQUIRES in a couple of tests (#146869) 3e78afff0d8e [flang] Fix Windows bot failure caused by #146667 (#147002) 1d5d1256487c [ConstantFolding] Consolidate poison propagation for intrinsics (#146878) 25bf90eaede4 [MLIR][Docs] Fix typo in addTypeAttributeConversion comment (#146977) 06c988cefd91 [RISCV][VLOPT] Add support for vwsll.vx/vv. (#146998) 5a9e6babd81f [clang-tidy] fix false negatives with type aliases in `cppcoreguidlines-pro-bounds-pointer-arithmetic` check (#139430) 59e812f2eed8 [lldb][test] Skip pointer to std::unordered_map formatter tests on older Clang versions f724d31a37ee [RISCV] Trim line to 80 chars in RISCVInstrInfoXAndes.td. NFC. 671870be9132 [RISCV] Fold funct7 into class for XAndesVBFHCvt instructions. NFC. 1194532bbae6 merge main into amd-staging (#2959) d90e4b1699b6 merge main into amd-staging (#2958) a550fef9061f [llvm] Use llvm::fill instead of std::fill(NFC) (#146911) 872eac7af005 [RISCV] Move vendor clang intrinsics tests to seperate directory. NFC. (#146862) 0612c4bbd336 [Driver][Test] pgo-sample-use-profi.c: Specify targets to fix test (#146996) 8fe205d31695 [Serialization] Remove an unnecessary cast (NFC) (#146986) afd20aaca5fd [clang-scan-deps] Fix "unterminated conditional directive" bug (#146645) 85aaaf6e7409 [clang-tidy] EndSourceFile() for preprocessor before diagnostic client (#145784) 8c9e0c6c61f6 [flang][OpenMP] Allocate `reduction` init temps on the stack for GPUs (#146667) ddcccc4afaff [OpenCL] Add decls for cl_intel_subgroups_char, cl_intel_subgroups_long (#146655) 724dfdc948a8 [OpenCL] Add declarations for version 1.1 of cl_intel_subgroups_short (#146647) 038431b2ba10 merge main into amd-staging 61529d9e36fa [RISCV] Remove implied extension Zvfhmin for XAndesVPackFPH (#146861) 5b8304d6b90c Revert "[AMDGPU] Re-apply: Implement vop3p complex pattern optmization for gisel" (#146982) 48e89a8cf4b8 [mlir][transform] Fix Wtype-limits warning (#146898) db03c2776365 [AMDGPU] Re-apply: Implement vop3p complex pattern optmization for gisel (#136262) 965b94428c1b [TableGen] Use emplace_back and const correct two reference arguments. NFC 0db0c79ab45f [mlir] Use range-based for loops (NFC) (#146946) 60d1c4e257ed [llvm] Use range-based for loops (NFC) (#146945) c3947a63690d [AMDGPU][NFC] Remove a redundant test (#146888) a60d6c808b46 merge main into amd-staging ba9c262a9711 [mlir] Use llvm::any_of and llvm::all_of (NFC) (#146947) 7e04bfbf18c9 Revert "[lldb][RPC] Upstream lldb-rpc-gen tool" (#146969) 0a02c28e2912 [clang-doc] add namespace references to VarInfo (#146964) 96f7f22825d0 [mlir][examples] Use {} instead of std::nullopt (NFC) (#146949) 2910c24638fc [Modules] Record side effect info in EvaluatedStmt (#146468) 9bfb347ea0a0 [lldb][RPC] Upstream lldb-rpc-gen tool (#138031) 4482bc19a56b merge main into amd-staging (#2957) 45083dc4d224 [lldb][framework] Correctly place framework files in framework with script (#146425) 1f7effc88774 [mlir][acc][flang] Use SymbolRefAttr for func_name in ACC routine (#146951) 0ceb0c377a3e [NFC][HLSL][DirectX] Let `HLSLRootSignature` reuse the `dxbc` defined enums (#145986) 1725cc025e8f [lldb] Remove unused `hardware` argument (NFC) 2b7e3f6fa6fb [flang] Unify derived types in distinct module files (#146759) dd3214d5a6b5 [flang] Fix handling of identifier in column 1 of free form continuat… (#146430) 0b98b27930da Use the root directory as the SDK root on POSIX platforms 17cb0a73a054 [lldb][docs] Fix another broken markdown link 7007a50a62ba merge main into amd-staging (#2956) eda3161c3565 AMDGPU: Implement tensor load and store instructions for gfx1250 (#146636) 1995fd9ac6be [lldb] Extract DW_OP_deref evaluation code (NFC) (#146801) 2aa0f0a3bd54 [AArch64] Add option -msve-streaming-vector-bits= . (#144611) 3c13257f32f5 [RISCV] Rename XTHeadVdot instructions to match their mnemonic. NFC (#146953) d0d84c4150a3 [RISCV] Add SF_ to SiFive instructions in RISCVGenInstrInfo.inc. NFC (#146939) e35cf02e54c7 [RISCV] Pass RISCVSubtarget to translateSetCCForBranch. NFC ec350657893d [ARM] Add neon vector support for rint e18c5dec6dc3 [X86/AArch64] Autogen two additional tests 6efa3dfb7b21 [VPlan] Handle interleave groups with trivially narrow operands. bc89380179c4 [flang][preprocessor] fix use of bitwise-and for logical-and (#146758) 67d6679c91e1 [flang][prescanner] fix invalid check (#146613) 08ed9e17bf87 [LV] Add tests for narrowing interleave groups with single scalar ops. be762b7b7d60 [RISCV] Efficiently lower (select cond, u, rot[r/l](u, rot.amt)) using zicond extension (#143768) e4fb69d4e4ab merge main into amd-staging ea88634764f8 [Support] Remove an unnecessary cast (NFC) (#146810) 0afbf1721346 [LAA,LV] Add tests with early-exit loops and deref assumptions. 48ef55ce3e85 [CGP] Update tests to use autogen scripts, and refresh check lines a3dea0addd0e [gn build] Port 795b17d0b821 bfd457588af9 Revert "[AMDGPU] SelectionDAG divergence tracking should take into account Target divergency. (#144947)" 378f248934d6 [lldb] Add SB API to make a breakpoint a hardware breakpoint (#146602) 1e76f012db3c Fix the build after 8ac7210b7f0ad49ae7809bf6a9faf2f7433384b0 made TTI mandatory 994501abe75c [Clang] Fix evaluation context of lambdas appearing in discarded statements (#146857) 6cadd3524dc3 merge main into amd-staging 1e541c1c8904 merge main into amd-staging (#2955) d66254e7fe21 Revert " Move python binding tests to lit framework (#146844)" (#146931) a0e846277023 [compiler-rt][sanitizer_common] Improve handling of env vars for iOS simulator tests (#146721) 53baee94cce6 [RISCV] Prune unnecessary LMUL from SiFive sf.vfwmacc.4x4x4 pseudo instruction. NFC 8d3dbdb00f8f [lldb] fix incorrect logging message (#146903) 2f75f658b18a [lldb] Take a sledgehammer approach to resizing the statusline (#146578) 795b17d0b821 [Frontend][OpenMP] Implement directive name parser (#146776) 1aa39690aa73 [CIR] Upstream UnaryDeref support for ComplexType (#146757) a695d6b9a726 [HashRecognize] Check TC against bitwidth of LHSAux (#144881) 77f0f812b419 [Sema][ObjC] Treat unknown selector messages as unrecoverable errors under ARC (#146803) 4cd9c894d1ef [DebugInfo] Remove an unnecessary cast (NFC) (#146809) 8ac7210b7f0a [AMDGPU] SelectionDAG divergence tracking should take into account Target divergency. (#144947) b6e113a149bf Drop timestamp in generated source code (#146822) e8f491fc973e [mlir] Remove unused includes (NFC) (#146812) 61a0653cc610 [VPlan] Fix first-order splices without header mask not using EVL (#146672) 21c4fbd4235a [RISCV][VLOPT] Pre-commit test for adding support for vfrec7.v e93a34662f14 [CIR] Upstream SubstNonTypeTemplateParmExpr support for ComplexType (#146755) 59d641a2dab4 [CIR] Upstream support for SubstNonTypeTemplateParmExpr (#146751) a24490792235 [clang] Use range-based for loops (NFC) (#146811) 5df748dd329e [Sema] Remove an unnecessary cast (NFC) (#146808) 0f717044ff1a [X86] lowerX86FPLogicOp - use MVT::changeVectorElementTypeToInteger(). NFC. 46b4ca8e9869 [NFC][PowerPC] Pre-commit testcases for locking down the xxsel instructions for ternary patterns (#146764) 6c23e9e82c36 [RISCV] Fix crash when trying to remove segment (#146524) 4b9f622ca94d [CIR] Bit manipulation builtin functions (#146529) f019c890087a [X86] foldXorTruncShiftIntoCmp - pull out repeated SDLoc. NFC. 51ff8f2f7e4c [X86] foldXor1SetCC - pull out repeated SDLoc. NFC. a282c6858067 [X86] combineX86AddSub - pull out repeated getOperand() call. NFC. 23104a74e79f [CIR] Add nothrow attribute to the call operation (#145178) 3ba161bb7530 [NFC][LLVM][CodeGen][SVE] Add merging unary operation tests. 2b49d36c081f [flang][cmake] Separate FLANG_INCLUDE_TOOLS from FLANG_BUILD_TOOLS (#145005) a88e286aefbf [lldb][test] Consolidate libstdc++ and libc++ vector formatter tests into generic test (#146885) 34f124b06ffd [mlir][toy] Use `make_early_inc_range` when erasing ops during iteration (#146892) 522d743545e6 [lldb][test] Run generic set formatter test-case on specified STL (#146882) 6440b1028220 [lldb] Remove PRIuFT macro and use LLDB_LOG instead (#146867) 10dc4e122ace [lldb][test] Turn std::chrono libcxx test generic (#146873) b0444b0473c0 [lldb][test] Turn std::atomic libcxx test generic (#146843) 31bdd5fd39cb [lldb][test] XFAIL TestIRInterpreter.py on Windows again 03aa5c0a9e71 [LLDB] Optimize identifier lookup in DIL (#146094) f2ccda7e8972 Revert "[mlir][vector][nfc] Rename `populateVectorTransferCollapseInnerMostContiguousDimsPatterns` (#145228)" 438863a09e2d [OpenACC][Sema] Implement warning for 'cache' invalid var ref d4e57c6d45e5 Revert "[mlgo][regalloc] Fix after PR #131837" (#146897) c71bbd50a10d [analyzer] Correct Z3 test cases, fix exposed crashes (#146597) 4f047bc5955c [DLCov] Origin-Tracking: Collect stack traces in DebugLoc (#146678) 30eb97c5848d [X86] commuteSelect - update to use SDPatternMatch. NFC. (#146868) 23216b4af5ba [mlir][SCF][NFC] Remove duplicate `getConstantTripCount` implementation (#146347) d805707ee435 [clang][test] Correct UNSUPPORTED syntax in print-ranges.cpp 8171f474d642 [llvm][dsymutil][test] Fix REQUIRES syntax 651c994febea [llvm][test] Fix REQUIRES in extractelement-insertpoint.ll 59731f5cfac6 [llvm][llc][test] Fix REQUIRES in regalloc pipeline test 57b55b6401e3 merge main into amd-staging b7059ebafe8a [LSR] Strip dead code (NFC) (#146109) 0a656d8e57c9 [Bitcode] Add abbreviations for additional instructions (#146825) 791bb606b5bd [X86] fp128-select.ll - remove CFI noise c5f47c6fd2cd [lldb-dap] Prevent using an implicit `step-in`. (#143644) 8763ac3252f2 [flang] fix skip-external-rtti-definition for ppc (#146826) 4868d66282b2 [flang] improve DITypeAttr caching with recursive derived types (#146543) b5f5a7699c1d [OpenMP] Make headers parse standalone. NFC 2638fa1be63c [ORC] Add cloneToContext: Clone Module to a given ThreadSafeContext (#146852) 2532bde03889 [clang][python][test] Move python binding tests to lit framework (#146844) 76274eb2b343 [PHIElimination] Revert #131837 #146320 #146337 (#146850) 51485ab46d33 [mlir][bufferization] Do not access operation after it was replaced (#146860) f36ad98b2740 [RISCV] Remove unneeded blank line between the features for XAndesVBFHCvt and XAndesVPackFPH. NFC. a2505cf1e3f2 [LangRef] Revisit attributes semantics after opaque ptr migration (NFC) 5f62c791061d [C++20] [Modules] Use current named module to do module local lookup ca0b56639cf9 [NFC] [C++] [Modules] Mark P1979 as implemented and add test (#146841) ec25a0568cfb [VPlan] Don't convert VPWidenSelectRecipes to vp.select in EVL transform (#146695) 789127036dc9 [lldb][Windows] Fix compilation warnings d8023e7cf8fe [lldb] Use correct size when dumping DWARF64 DW_FORM_ref_addr (#146686) 776300235778 [MLIR/Utils] Add missing dep on Arith dialect (#146834) 4e8843ee870e [lldb][test] Disable TestIRInterpreter.py on x86_64 Windows da6c7e6dd2c2 [lldb][mcp] Skip MCPUnixSocketCommandTestCase if remote (#146807) 41fd13c63509 [ORC] Fix file header comment formatting. NFC. cbc2ac5db8ea [WebAssembly] Fold TargetGlobalAddress with added offset (#145829) a17c598145b0 [lldb][test] Enable TestExpressionInSyscall.py on Windows c79fcfee4125 [DAG] combineVSelectWithAllOnesOrZeros - reusing existing VT. NFC. dd495f16f7a0 [lldb][test] Correct TestIRInterpreter 563bea91222f [lldb][test] Enable TestIRInterpreter on Windows d56c06e6c9f0 [flang][debug] Generate DISubprogramAttr for omp::TargetOp. (#146532) 4017dc06e3b5 [lldb][Commands][NFC] image lookup: remove unused local variable (#146554) 58d84a615e91 [lldb][DWARF][NFC] Reduce scope of ref_addr_size variable (#146557) 94d823157827 [LLDB] Mark TestCallStdStringFunction as XPASS on Windows (#146835) 431507db52c8 [libcxxabi][cmake] Account for LIBCXXABI_TARGET_SUBDIR in test config (#138527) 44031237284e Revert "[win][aarch64] Always reserve frame pointers for Arm64 Windows" (#146836) 6a50aa77821d [lldb] Add linux test for the three-arg version of getProcFile (#146500) 032966ff5679 [RISCV] Added the MIPS prefetch extensions for MIPS RV64 P8700. (#145647) bd6cd92984e7 [MLIR][OpenMP][NFC] Use header guards for tblgen'd definitions (#146684) 2dba752f0575 [RISCV] Use template version isInt instead. NFC. fcdb91e11346 [VPlan] Remove redundant debug location setting in VPInterleaveRecipe::execute. nfc (#146670) b478c38c19f9 MCAsmBackend: Replace FKF_IsPCRel with isPCRel() 4acdb8e14ef7 [VectorCombine] Scalarize extracts of ZExt if profitable. (#142976) 3efa461d45a1 [libcxx] Avoid hash key in __hash_table::find() if it is empty. (#126837) 3e370452fd23 [VPlan] Early assert for unsupported interleaved access features. nfc (#146669) 85d09de5fa19 [libclc] Add prepare- targets (#146700) 0bfa0bcd79f7 [ORC] Replace ThreadSafeContext::getContext with withContextDo. (#146819) 9234d077522e MCAssembler: Optimize PCRel fixups 6504c96b1d86 [clang][analyzer] Fix the false positive ArgInitializedness warning on unnamed bit-field (#145066) 1f8f477bd038 [ARM] Add neon vector support for trunc 65537539e129 [llvm][ADT] Add wrappers to `std::fill` (#146681) b59763a7db7f MCAsmBackend: Simplify shouldForceRelocation overrides dd2891535d4b MCAsmBackend: Merge addReloc into applyFixup (#146820) 119705e5ad2b [lldb][test] Synchronize `__compressed_pair_padding` with libc++ (#142516) d67013a2b442 [Flang][AArch64][VecLib] Add libmvec support for Flang/AArch64 (#146453) 31e85f987d58 MCAsmBackend: Make some target overrides out-of-line 283f53ac6fcd [RISCV] Add isel patterns for generating XAndesPerf branch immediate instructions (#145147) cd65d4e3c9e2 merge main into amd-staging (#2952) e481c3a1f0bf [openmp] - Add openmp_INCLUDE_DIR to openmp-config.cmake (#2950) 4cf53cd266b9 [msan] Fix "Add optional flag to improve instrumentation of disjoint OR (#145990)" (#146799) 922dde3c6403 MCAssembler: Simplify fixup handling c9babbc2065d Pre-commit PhaseOrdering/always-inline-alloca-promotion.ll a25887077bd5 ELFObjectWriter: Optimize isInSymtab 9382a95e654e [NFC][TableGen] Adopt `ArrayRef::consume_front()` in `PrintMessage` (#146775) 4f1ba5a06ed6 [RISCV] Add additional gather/scatter addressing coverage 797d519d9915 [RISCV] Check whether plain type is supported for permutation intrinsics instead of its float type (#146657) cc801b6570df [clang] [modules] Add err_main_in_named_module (#146635) 13fddeaf2c49 [BPF] Emit proper error message for insns with tied operands (#146778) 854e951365a5 Revert "[mlir][OpenMP] implement SIMD reduction (#146671)" 220a00239696 [SDAG] Prefer scalar for prefix of vector GEP expansion (#146719) 44bed1af0fb6 [RISCV] Add negative pre-defined macro test for XAndesVBFHCvt e718ce00374d Revert "[flang][cuda] Do not create global for derived-type with allocatable device components (#146780)" a5350785db62 Revert "[flang][cuda] Allocate derived-type with CUDA componement in managed memory (#146797)" eaac126c9fe9 Port ZCFS improvements (#2829) a068ed288af1 [lldb][mcp] Fix unix domain socket protocol server addresses (#146603) f01017ca9711 [docs] Refresh Developer Policy text (#136198) 4e26801ea91f clang: Add requires webassembly to a test 5e31d4cdf2f5 [RISCV][VLOPT] Support v[f]slide1up.v{x,f} (#146716) 717899ce8664 [CIR] Upstream get_bitfield operation to load bit-field members from structs (#145971) 925588cd001a [flang][cuda] Allocate derived-type with CUDA componement in managed memory (#146797) e873ce31ae0e [flang][cuda] Do not create global for derived-type with allocatable device components (#146780) 0d7e64f5d2b4 [ASan][Windows] Honor asan config flags on windows when set through the user function (#122990) 6550f28977b9 [RISCV][VLOPT] Support vslide{up,down} (#146710) c6abab2875ef [RISCV][VLOPT] Add support for vfmerge.vfm and vfmv.v.f (#146692) 6ab7e52dd80d WebAssembly: Move validation of EH flags to TargetMachine construct time (#146634) 8dbf6a42c84d merge main into amd-staging (#2948) d4331344ac45 [Clang][Driver][SamplePGO] Introduce -fno_sample_profile_use_profi flag for SamplePGO (#145957) c863e0ebc2e5 Revert "Move python binding tests to lit framework (#146486)" (#146789) c2347170f40d Reapply "[Clang,debuginfo] added vtt parameter in destructor DISubroutineType (#130674)" (#145697) a74c7d877637 [win][aarch64] Always reserve frame pointers for Arm64 Windows (#146582) 551d6ddaa381 [clang] [test] Add a missing requirement for a test 497060fae5c3 [lld][WebAssembly] Add missing relocation types to the --compress-relocations path (#144578) 272576543246 [LLVM][ADT] Add `consume_front` and `consume_back` to ArrayRef (#146741) 7fc50e92a59c clang: Fix parsing of seh exception model (#146643) 734d31a464e2 clang-format ELF.cpp 6ff3b4370017 [TableGen] More generically handle tied source operands in CompressInstEmitter. (#146183) 8eb61d9154c5 [SHT_LLVM_BB_ADDR_MAP] Cleanup old version support code from ELF.cpp. 274152c5fa9f [mlir][vector][spirv] Lower `vector.to_elements` to SPIR-V (#146618) a880c8e670be [NFC][TableGen] Add accessors for various instruction subclasses (#146615) d45762187252 [lldb] Fixing warnings / win32 builds in MainLoop. (#146632) ae9990ed9651 [libc++] Remove dead code from (#143854) 3ee0f97b950a [libc++] Avoid including vector in (#144310) b173c12b5454 [libc++] Make libcxx/selftest a top-level test directory (#144852) 954810d27b85 merge main into amd-staging 0a822f82de91 [PowerPC] Fix ppc-reduce-cr-ops mishandling of subregister uses (#144405) 1f7ba23422da [NFC] [MSAN] replace (void) with [[maybe_unused]] (#146617) 81ba1d421ec7 offload fixes for Name -> getName 6ecb6a8a8cd5 [mlir][vector][nfc] Rename `populateVectorTransferCollapseInnerMostContiguousDimsPatterns` (#145228) ab0fa6c5dc72 [lldb] Fix else-after-return in Breakpoint (NFC) bec6a124bb79 merge main into amd-staging c03acc899e6c Regen 3 lit tests a63f57262898 [mlir][bufferization] Return BufferLikeType in BufferizableOpInterface (#144867) 2ed7b22f0c9e [HLSL] Add `-Gis` option to clang-dxc (#146448) 218fd692617b [BOLT] Decouple new segment creation from PHDR rewrite. NFCI (#146111) da01257c3a16 [Test] Account for spaces in paths in the new dtlto/files.test (#146749) e3edc1bd873f asan: refactor new/delete interceptor macros (#146696) 00e071d69062 [lldb] remove do-nothing defaults in case statements, unbreak gcc CI bots. 77d95911a3a4 Revert "Fix wcpncpy() return value; add test." (#146752) 988876cdd918 Fix wcpncpy() return value; add test. dfc5987faccb [bazel] Add missing dep after 242996efee4aaa30dd0ddb4359675b8bc103294a 832cd2df0b56 [SPIRV] Add option to add all KHR extensions (#145535) 5a3d107252b9 [DAG] Refactor X86 combineVSelectWithAllOnesOrZeros fold into a generic DAG Combine (#145298) 358348b7922e merge main into amd-staging a4d517dc3808 [SystemZ][z/OS] Fix error about const char in Text Encoding (#146727) 5e6e51bbbec4 [Sema] Remove an unnecessary cast (NFC) (#146703) aa8e1bc0e989 [X86] Add BLEND/UNPCK shuffles to canCreateUndefOrPoisonForTargetNode/isGuaranteedNotToBeUndefOrPoisonForTargetNode (#146728) bf016b930b5c [mlir][spirv] Add support for SPV_ARM_tensors (#144667) 1626867ccdf4 [lldb] Fix warnings 6b623a662270 [SHT_LLVM_BB_ADDR_MAP] Remove support for versions 1 and 0 (SHT_LLVM_BB_ADDR_MAP_V0). (#146186) cbfc10260cfe Fix lld crash caused by dynamic bit offset patch (#146701) 50f40a5327ad [libc] Fix internal alignment in allcoator (#146738) e9be5286e14e [CIR] Implement NotEqualOp for ComplexType (#146129) 6a97b56ce5c5 [MLIR][AMDGPU] Redirect transfer read to masked load lowering (#146705) dfcef35ff1d3 [lldb][NFC][MachO] Clean up LC_THREAD reading code, remove i386 corefile (#146480) ed27f18e324d __sys builtin support for AArch64 (#146456) de4f283d141c [Xtensa] Fix XtensaELFObjectWriter. (#146731) 641ad52b6ab4 [AMDGPU][MC] Fix disassembly for v_permlane16_swap_b32 for GFX950 (#146600) 2fe0feb84875 [LLVM][AsmWriter] Print a comment for unknown intrinsics (#146726) b62826cc054c [InstrEmitter] Use AddOperand in EmitCopyToRegClassNode. (#146637) 191583c6a550 [mlir] Remove unused includes (NFC) (#146709) bbf4402635c5 [Analysis] Remove a redundant control flow statement (NFC) (#146708) 0f1accd80642 [clangd] Drop const from a return type (NFC) (#146707) 4461de2e5139 [StaticAnalyzer] Remove unnecessary casts (NFC) (#146706) e717e503cae1 [AMDGPU] Fix comment on DelayInfo::advance (#146718) 3c0571a74971 [Offload] Add missing license header to Common.td (#146737) 338fd8b12ce6 [SimplifyCFG] Transform switch to select when common bits uniquely identify one case (#145233) 68173c809159 [HLSL][SPRIV] Handle signed RWBuffer correctly (#144774) 1c305f711f86 [HashRecognize][NFC] Add a missing "phi" in a comment (#146702) 7e1dc7e8d4b7 [nfc] Rename API with typo in BranchProbabilityInfo (#146447) 16b75c819dde [mlir][OpenMP] implement SIMD reduction (#146671) 7931a8f10298 [VectorCombine] Scalarize vector intrinsics with scalar arguments (#146530) 05ebb363c901 [libc++] Re-add a script to trigger the libc++ Buildkite pipeline (#146730) 7d52b0983e0b [Offload] Add `MAX_WORK_GROUP_SIZE` device info query (#143718) ab42c4abe86c [NFC] Replace "omp.default.mapper" with llvm::omp::OmpDefaultMapperName. 1841b021c6bf [CIR] Add OptInfo attribute (#146261) ce99db9d1b8a [CIR] Add mlir-translate to CMake (#146608) d04d2557255a [Clang] Properly use `CommaJoined` for `--offload-arch` (#146687) d74d4ffa3342 [Bitcode] Extract common BitCodeAbbrevOps (NFC) b1774222c761 [flang] Emit `fir.global` in the global address space (#146653) 3b4e79398de5 [DTLTO][LLD][ELF] Add support for Integrated Distributed ThinLTO (#142757) e32439249d8a [lldb][test] Consolidate generic and libcxx std::deque formatter tests (#146697) 3cb28e9dee41 [CIR] Untie Type and Attribute definitions (#146663) 242996efee4a [Clang][DLCov][NFCish] Fix debugloc coverage tracking macro in Clang (#146521) 03919ef8d9d9 [Clang][OpenCL] Declare cl_amd_media_ops/cl_amd_media_ops2 builtins with -fdeclare-opencl-builtins (#143507) 4db8ce725138 [clang-fuzzer] Fix latent race condition in build (#146119) e288561e6ba4 [CIR] Clean up FPAttr (#146662) 3dc09fbf29d5 [Xtensa] Implement THREADPTR and DFPAccel Xtensa Options. (#145543) 2dc44b3a7ba1 [InstCombine] Fix multi-use handling for multi-GEP rewrite (#146689) ad715beca184 [AMDGPU] Remove HasSampler variable. NFC. (#146682) 5a8d096ae344 [clang-tidy] Fix false positive for cppcoreguidelines-pro-bounds-pointer-arithmetic (#127394) cbfd0d68ea50 [HashRecognize] Rewrite arePHIsIntertwined (#144878) 8dcdc0ff1f41 [CIR] Clean up IntAttr (#146661) 38ad6b1983e3 [mlir][Affine] Fix crash in affine-loop-fusion pass by guarding against an empty op list (#144841) 5491576a1623 [CIR] Introduce IntTypeInterface to allow uniform integer types handling (#146660) 24828c8c45d7 [libc] Efficiently implement `aligned_alloc` for AMDGPU (#146585) 3f386876ec16 merge main into amd-staging (#2940) bca79ec0d21e [mlir][linalg] Use `ub.poison` in linalg vectorizer instead of `0` for some transfer ops (#146544) ebcf7f91ffa0 [SystemZ][HLASM] Emit END instruction (#146110) bbcebec3af5a [DAG] Refactor X86 combineVSelectWithAllOnesOrZeros fold into a generic DAG Combine (#145298) d78036f06ea9 Only restart failed libc++ jobs, not cancelled ones. (#146397) 8b3cc4d1ed06 [llvm][docs] Remove LLDB DWARF64 release note a9ee1797b716 Remove helper function and use target agnostic needConversion function (#146680) fc00256b2b4d [lldb][test][NFC] Rename libcxx unordered_map tests to unordered_map-iterator 2b03efc7fba8 [AMDGPU] Use isImage. NFC. (#146677) dbe441e71611 X86: Avoid some uses of getPointerTy (#146306) 4f02965ae246 [Offload] Store kernel name in GenericKernelTy (#142799) e63de82d904c [LLD][COFF] Disallow importing DllMain from import libraries (#146610) acb52a8a98f0 [Offload] Improve liboffload documentation (#142403) 4e213159af9e [SPIRV] Add FloatControl2 capability (#144371) 9c0743fbc5ba [GlobalISel] Allow expansion of urem by constant in prelegalizer (#145914) 0aafeb8ba1b1 Reland [TSan] Clarify and enforce shadow end alignment (#146676) c0e9084b1ce1 [AMDGPU] Add a debug option `-amdgpu-snop-padding` for `GCNHazardRecognizer` (#146587) 9eac5f72f629 Revert "[TSan] Clarify and enforce shadow end alignment" (#146674) 6ec9b1b36672 [MLIR] Remove spurious space when printing `prop-dict` (#145962) f575b18fdc83 [LV] Add support for partial reductions without a binary op (#133922) dea4f3213d84 [libc] Use is aligned builtin instead of ptrtoint (#146402) 5fe63ae9a3fb [lldb-dap] Fix flaky test TestDAP_server (#145231) 585b41c2ecc0 TargetOptions: Look up frame-pointer attribute once (#146639) 35626e97d886 [DLCov] Origin-Tracking: Enable collecting and symbolizing stack traces (#143591) a2c9f7dbcc8b [Xtensa] Implement lowering SELECT_CC/BRCC for Xtensa FP Option. (#145544) 7cc8fe2a2cd4 [LLVM][AArch64] Relax SVE/SME codegen predicates. (#145322) 38200e94f142 [DAG] visitFREEZE - always allow freezing multiple operands (#145939) 4c7a706589ca [LLDB] Simplify libstdc++ string summaries (#146562) 40275a4ee312 [lldb][test] Add tests for formatting pointers to std::unordered_map bc8dad1c7ef0 [VPlan] Emit VPVectorEndPointerRecipe for reverse interleave pointer adjustment (#144864) 6e1e89ee380e [SLP] Avoid -passes=instcombine stages in SLP tests (#146257) 7ead20db2842 [lldb] Use llvm::erase_if (NFC) (#146624) 82c0a53763bc [LoongArch] Pre-commit for optimizing insert extracted pair elements 1b7cbe1f871e [flang][OpenMP] Create unique reduction decls for different logical kinds (#146558) 651c5208f859 VPlanRecipes.cpp - fix "'llvm::VPExpressionRecipe::computeCost': not all control paths return a value" MSVC warning. NFC. 85bc8684173b [AArch64][TTI] Reduce cost for splatting whole first vector segment (SVE) (#145701) a75587d2718f [clang][python][test] Move python binding tests to lit framework (#146486) 2c1900860c08 [lld][LoongArch] Support TLSDESC GD/LD to IE/LE (#123715) f1cc0b607b03 [IR] Introduce `dead_on_return` attribute d5608d675131 MC,test: Improve section group test 647aa6616fa5 [mlir][SPIRVToLLVM] Set valid insertion point after op erasure (#146551) 83272a484939 [InstCombine] Fold icmp of gep chain with base (#144065) 0588e8188c64 [Serialization] Use the SourceLocation::UIntTy instead of the raw type for the offset, NFC 6c9be27b526f [mlir][tensor] Fold identity `reshape` of 0d-tensors (#146375) 9262ac3ee4d5 Revert "ELFObjectWriter: Optimize isInSymtab" c577bc6fea42 merge main into amd-staging eac1a1d3a8db MCAssembler: Consistently place MCFragment parameter before MCFixup 85be60d358eb merge main into amd-staging (#2936) b68e8f1de71a [mlir][linalg] Allow promotion to use the original subview size (#144334) 3c6cade485d4 MCObjectStreamer: De-virtualize emitInstToFragment f4b938b7c0ec [TableGen] Use range-based for loops (NFC) (#146626) b809d5e2ac8d [ProfileData] Use lambdas instead of std::bind (NFC) (#146625) 838b91d7f683 [clangd] Drop const from a return type (NFC) (#146623) 7b4dbb4f37d8 [Sema] Remove an unnecessary cast (NFC) (#146622) 2723a6d9928c [LLVM][Cygwin] Enable dynamic linking of libLLVM (#146440) 984c78f27d14 [clang][bytecode] Add back missing initialize call (#146589) c9bfdae62002 [RISCV] Use uint64_t for Insn in getInstruction32 and getInstruction16. NFC (#146619) 75d12330ef05 merge main into amd-staging f1a4bb62452d [RFC][NFC][AMDGPU] Remove explicit value assignments from `AMDGPU::GPUKind` (#146567) 36f4a9b9750f merge main into amd-staging (#2935) a8a9a7f95a69 [WebAssembly] Fix inline assembly with vector types (#146574) 2a702cdc38f9 Driver: Avoid llvm::sys::path::append if resource directory absolute. aa1d9a4c3104 [MLIR][Affine] Enhance simplifyAdd for AffineExpr mod (#146492) eb07f0d4a933 [Analysis] Use range-based for loops (NFC) (#146466) 2599a9aeb543 [clang] [modules] Implement P3618R0: Allow attaching main to the global module (#146461) 3deed4211a46 [docs] Add clang release notes for LoongArch (#146481) a87b27fd5161 [lldb] Fix the hardware breakpoint decorator (#146609) 7502af89fc0e clang: Forward exception_model flag for bitcode inputs (#146342) b0e6faae0842 [libclc] Add missing clc_lgamma_r with generic address space pointer arg (#146495) 93fe52f19e99 [libclc] Add __clc_nan implementation with signed nancode argument (#146485) c71ec37aebe6 merge main into amd-staging 2b16af8df2ee [Offload][cmake] Add GPU test job limit for AMDGPU buildbot cmake cache (#146611) 6b7e1b97f4bb [CI] Use Github Native Groups in monolithic-* scripts e89458d3985c [lldb] Fix PipeTest name collision in unit tests e9c9f8f3748a [WebAssembly] Fold any/alltrue (setcc x, 0, eq/ne) to [not] any/alltrue x (#144741) 4a8c1f7d127a [WebAssembly] [Backend] Wasm optimize illegal bitmask (#145627) ae2104897c7d [SelectionDAG] Fix NaN regression in fma dag-combine. (#146592) 475cd8dfaf84 [NVPTX] Further cleanup call isel (#146411) 5ed852f7f728 [mlir][arith] Add `arith::ConstantIntOp` constructor (#144638) 863e17a5be77 [VPlan] Make Phi operand for VPReductionPHIRecipe optional (NFC). f393211454a2 [Reland][IPO] Added attributor for identifying invariant loads (#146584) d99b14623f43 AMDGPU: Implement tensor_save and tensor_stop for gfx1250 (#146590) bcbc4407120c [VPlan] Add missing VPWidenSelectto VPRecipeWithIRFlags::classof (NFC). 42578e8586e6 [mlir][linalg] Use hasPureTensorSemantics in TransposeMatmul methods. (#146438) b6ffe2cb88a2 merge main into amd-staging (#2931) 5d849d3a9085 [mlir][xegpu] Fix seg-fault caused by setting a null attribute (#146002) 829f2f2448f5 [VectorCombine] Mark function as changed if shuffle is created. ac76e4d8a9ae [Serialization] Use SourceLocation::UIntTy for the offset type, NFC c56c349d3946 [clang-tidy] Switch misc-confusable-identifiers check to a faster algorithm. (#130369) a06117142632 [AsmParser] Remove unnecessary casts (NFC) (#146549) 650d0151c623 [clang] Improve getFileIDLocal binary search. (#146510) 777d6b5de90b [VectorCombine] Use InstSimplifyFolder to simplify instrs on creation. (#146350) 6b3d2b629cc3 [VPlan] Add VPExpressionRecipe, replacing extended reduction recipes. (#144281) 7da8ed8d339a Fix missing/outdated pass options in PassRegistry.def (#146160) d48035942050 [mlir][sparse] Do not access operation after it was replaced (#146546) 119292c40b0f [IR2Vec] Add out-of-place arithmetic operators to Embedding class (#145118) efe0deae3fc6 [NFC][IR2Vec] Increasing tolerance in `approximatelyEquals()` of `Embedding` (#145117) 6fafa46f8c1b [CIR] Upstream PackIndexingExpr for ScalarExpr (#146239) e11d354d64fb [CIR] Upstream GenericSelectionExpr (#146211) 67f1eb5c1702 [CIR] Comma Operator for ComplexType (#146204) b54e02a40b3c [clang][bytecode] Check pointer data type for bitcast eligibility (#146552) 8dbfe83681ed [CIR] Fix mlir::ValueRange init from ArrayRef warning (#146577) 491c79f76396 [CIR] Implement ArraySubscript for ComplexType (#146283) 5035d20dcbce AMDGPU: Implement ds_atomic_async_barrier_arrive_b64/ds_atomic_barrier_arrive_rtn_b64 (#146409) 3edae0d5e5b6 [lldb] Use EL_REFRESH to refresh Editline 35b80031f43f [NFC] Formatting PassRegistry.def (#144139) 9aa80c32e9a5 merge main into amd-staging c17e88f07e26 [Analysis] Remove a workaround for ancient GCC (NFC) (#146550) e79e22c9af97 [AMDGPU] Remove an unnecessary cast (NFC) (#146548) 72a9c3cced89 [Analysis] Remove an unnecessary cast (NFC) (#146547) 98e6d5cd47d4 [lldb] Fix warnings d79c284a2fef [flang] Fix a warning a79404e50cf5 [lldb] Correct an assertion name. c8450ea226ed AMDGPU: Remove the unnecessary needAlias argument in DS_Real_gfx12 (#146439) 21d5017a05d1 [AMDGPU] Refactor FLAT_Load_Pseudo class (#146539) b697b801b13d [X86] freeze-vector.ll - fix cut+pasta typo in frozen build vector tests a34a02481246 [AMDGPU][SIInsertWaitCnts] skip meta instructions early (#145720) 13e6ea7b4c29 [bazel] Add missing dependency for 08cf6ae537852d39f93f76575fff62ea26e21ed1 9fe42c6a0adf Reland "[flang] add option to generate runtime type info as external (#145901)" (#2923) 01a6c0853314 [PHIElimination] Verify reappropriated COPY is of similar register class, update livevars. (#146337) ad5522764f52 merge main into amd-staging (#2924) ba116a8bed9a [flang][OpenMP] Split check-omp-structure.cpp into smaller files, NFC (#146359) 1a7b7e24bcc1 [lldb] Adding pipe support to lldb_private::MainLoopWindows. (#145621) 9d3875203294 Refactor sequential asserter and add unit tests (#2910) 47e28d9cd1c0 [libc] wcscspn implementation (#146158) 04c614327c28 [InstCombine] Pull vector reverse through intrinsics (#146384) 4dab0b230060 [AMDGPU] Fix wrong reverse operations for `v_cmpx_le_u32` (#146398) 2b36406d5c95 [LLVM][AMDGPU] Remove compiler flag for enabling vectorization of i8s (#2912) 569ca0f69876 [mlir][async] Erase op later to preserve insertion point (#146516) 0c124be33f8d [lldb][NFC] Inline ResolveSDKPathFromDebugInfo in one of its call site (#146062) 69b69cbcb451 [flang][tco] Add -emit-final-mlir flag (#146533) 3cff3d882b02 [Offload] Add skeleton for offload conformance tests (#146391) 6b1c92cbcb76 [X86] legalize-sub-zero.ll - regenerate test checks 86077c41a789 [flang][OpenMP] Rewrite min/max with more than 2 arguments (#146423) 6e3465cd0f23 [AArch64] Fix ldp rename through a bundle (#146415) 5332534b9cb6 [ARM] Add neon vector support for ceil cf9374933d2e [Modularize] Make `Location::operator bool` explicit d7b8b65e239f [LLVM][TableGen][DecoderEmitter] Add wrapper struct for `bit_value_t` (#146248) e99da2b7a95a [mlir] Remove unused includes (NFC) (#146467) f4cdb89b47d7 [mlir] Remove unnecessary casts (NFC) (#146465) 7622bf9d1270 [IR] Remove an unnecessary cast (NFC) (#146464) bb080107e401 [CodeGen] Remove unnecessary casts (NFC) (#146463) 11ecd4742b74 [LLDB] Update DIL to pass current 'frame var' tests. (#145055) ace5108f373e feat(linalg): add a way to pass controlFn to `foldIntoPackUnpackPatterns` (#143685) f9413e1754a5 [clang][test] Remove duplication from gcc toolchain test (NFC) (#146487) 42e779692027 [ARM] Add a comment about fixupImmediateBr updaing ImmBranches. NFC bab9d4c2d78a [NFC][AMDGPU] Pre-commit a test case that shows wrong reverse operation is used for V_CMPX_LE_U32 (#146527) a6592ddf4ed9 [AArch64] Mark neon.stN intrinsics as writeonly (#145289) 1fe993c25196 [clang][bytecode] Allocate operator new data as array (#146471) 8cfd9b88215a [MLIR] Make generic skip packing init operand when not used in DataLayoutPropagation (#146139) 08cf6ae53785 [mlir][memref] Add a new `ReifyResultShapes` pass (#145927) 3355cca9380e [NFC][AMDGPU] Auto generate check lines for some test cases (#146400) bedd7ddb7fb5 [InstCombine] Fix use after free 1a253e213daf [NFC][Offload] Fix possible edge cases in offload-tblgen (#146511) da0828b1e93c [lldb] Enable support for DWARF64 format handling (#145645) 857815f3fa26 [OpenACC][CIR] Implement 'rest' of update clause lowering (#146414) e44fbea0a17f [FunctionAttrs] Handle ConstantRange overflow in memset initializes inference (#145739) 3702d64801c8 [mlir] Reapply 141423 mlir-query combinators plus fix (#146156) 771ee8e38785 [bazel] Add mising dependency for 698ec8c7ba6c47cfec6112d1c93b481fc9ac7973 72f87d2d69b2 [DAG] canCreateUndefOrPoison - remove isGuaranteedNotToBeUndefOrPoison check for insert/extract vector element indices (#146514) 524f0903064c [alpha.webkit.UncountedCallArgsChecker] Treat CFEqual as a safe function (#146369) 6ebe0912a763 xfail: clang/test/CodeGenCXX/bitfield-access-empty.cpp 6731f151ea15 [clang][bytecode] Remove unused InRange function (#146509) d9d9ab869817 [clang][CodeComplete] skip explicit obj param in code completion string (#146258) 59eadf748e74 merge main into amd-staging e5c7169bebc4 fixup! [offload][omptest] Add unit tests for sequential asserter b8b749455143 [InstCombine] Rewrite multi-use GEPs when simplifying comparison (#146100) 84282ea562b8 Use `replaceWithAddrOfOrASCast` (amd-staging only util) 5d3c1dc43d9d Reland "[flang] add option to generate runtime type info as external (#145901)" 9b13dfdfbc6d [LV] Use vscale for tuning to improve branch weight estimates (#144733) 15ab4bb5c8a7 [Hexagon] Implement shouldConvertConstantLoadToIntImm (#146452) 67b79468fbba [RISCV] Factor out getKillRegState in copyPhysReg (NFC) (#146454) 89fe42926293 [DAG] canCreateUndefOrPoison - remove isGuaranteedNotToBeUndefOrPoison check for shift nodes (#146502) 56841565db77 [DAG] canCreateUndefOrPoison - add handling for CTTZ/CTLZ_ZERO_UNDEF nodes (#146501) 4a2fa0847fb0 [VPlan] Support VPWidenIntOrFpInductionRecipes with EVL tail folding (#144666) ee372f5f5f5d fixup! [offload][omptest] Refactor asserters to enable testing a6339d0e5854 [clang]Fix Handle structs exceeding 1EB size limit (#146032) 90e20d4f42c3 [Clang][Bytecode] Implement P1061 structured binding pack (#146474) fd46e409a91f [X86] detectZextAbsDiff - use m_SpecificVectorElementVT matcher. NFC. (#146498) c0e62dd982bc Apply llvm#127838: [flang][Lower][OpenMP] Don't read moldarg for static sized array (#2918) 37d30d9e219a [mlir][tblgen] Fix test definition names to reflect expected valid results (NFC) (#146243) 6d6b36439f38 [Clang][AArch64] Move definitions of FP8 Neon loads & stores (#146352) f581ef5b6687 [mlir][gpu] Add gpu.rotate operation (#142796) a97826a13b7c [DAG] canCreateUndefOrPoison - explicitly state the AssertSext/Zext/Align/NoFPClass can create poison. NFC. (#146493) 43d2486e27fd [mlir][tblgen] Fix region and successor references in custom directives (#146242) 4e30f8101e4b [DAG] visitFREEZE - remove isGuaranteedNotToBeUndefOrPoison assertion (#146490) 2ee884a9db29 [clang-doc] Remove the unused clangd header. 8fe25f30714c [PowerPC] Remove chenzheng1030 from active maintainers (#145519) cd60247a0fca [llvm][docs] Document how to ask for things other than commit access (#146340) 5c08aeac85e5 [clang] Don't use raw source location in DeclarationName, NFC (#146412) 698ec8c7ba6c [mlir][tosa] Require signless types in validation and add corresponding conversion pass (#144367) cd10ded69787 [Clang] Remove AArch64TargetInfo::setArchFeatures (#146107) a6bb895efe47 [RISCV] Fix typo in header of llvm/test/CodeGen/RISCV/rvv/select-fp.ll. NFC. fadd3f9661b7 merge main into amd-staging (#2917) 84c849e85b0f [InstCombine] Combine interleaved recurrences. (#143878) 102c22cb2c10 [FatLTO] Disable analysis verification in pipeline test (NFC) 5fa4eb1dfd8f [Clang] Verify data layout consistency (#144720) cb806510914e [RISCV] Merge AllBFloatVectors into AllFloatVectors. NFC. b5f4fd03c2cc [RISCV] Remove unused variable AllFloatVectorsExceptFP16. NFC. 67be4fe3d5fd Fix MSVC implicit double -> float truncation warning. NFC. 3cc200f46b9c DynamicAPInt: Support APInt constructor. (#146301) 65cb0eae58d2 [Flang][OpenMP] Add Semantics support for Nested OpenMPLoopConstructs (#145917) 372e332a57ed [X86] freeze-unary.ll - remove unnecessary freeze from CTLZ/CTTZ_ZERO_UNDEF tests ab6316e21965 [Coroutines] Work on intrinsic IDs instead of names (NFCI) (#145518) 9beb467d9213 MC: Store fragment content and fixups out-of-line 7e830f76711f [Clang] Partially fix m68k alignments (#144740) c5e4546a0119 [DwarfDebug] Slightly optimize computeKeyInstructions() (NFC) (#146357) 72b40f7c6437 [lldb] Delete unused DWARFDataExtractor methods (#146356) 54b801af0040 Apply llvm#127838: [flang][Lower][OpenMP] Don't read moldarg for static sized array e066cc433226 merge main into amd-staging 84e82746c3ff [X86][llvm-exegesis] fix LNLP performance counter binding issue (#146348) 393aebf5c218 CodeView: Move MCCVDefRangeFragment storage to MCContext/MCFragment. NFC (#146462) 67b740bd73a6 [X86] Add diagnostic for fp128 inline assemble for 32-bit (#146458) e94c6091c93a [lldb][Mach-O] Fix several bugs in x86_64 Mach-O corefile (#146460) bbe4357fd0ca merge main into amd-staging (#2915) ce159d20e52a [RISCV] Put REQUIRES: riscv-registered-target in the first line of the file. NFC. 393a75ebb735 [mlir][Vector] Add constant folding for vector.from_elements operation (#145849) 0a69c83421ac [NFC][IR2Vec] Remove unreachable code and simplify invalid mode test (#146459) 66cc167dfa5b [LoongArch] Add tests for inserting extracted integer elements. NFC 8cf3b989a933 [Analysis] Fix a warning a2dc64cd0332 [NFC][MLGO] Convert notes to proper RST note directives in MLGO.rst (#146450) 943804881689 [IR2Vec] Simplifying creation of Embedder (#143999) 24c4bba076b5 [bazel] Quick fix for #145584 (Core deps ProfileData/InstrProf.h) 6323541a2a56 [LLD][ELF] Skip non-SHF_ALLOC sections when checking max VA and max VA difference in relaxOnce() (#145863) 6620db50fef7 [NFC][MLGO] Fix indentation in MLGO.rst (#146444) 70db191efa47 [RISCV] Add LLVM IR intrinsicis vrgatherei16/vslideup/vslidedown support for Zvfbfmin (#146312) 4e1a97870498 [flang][acc] Fix dialect dependencies (#146431) 6a929ffafff9 merge main into amd-staging a4f637d988bd [MLGO] Fix feature iteration using FeatureMap.size() instead of NumberOfFeatures (#146436) 8d9cdb65f090 [Clang][LoongArch] Fixed incorrect _BitInt(N>64) alignment (#145297) ad7d6759913b [BOLT] Refactor mapCodeSections(). NFC (#146434) a3c816542147 [flang][acc] Fix dialect dependencies (#146431) d2500e639b64 [pgo] add means to specify "unknown" MD_prof (#145578) d3cc2598aabb merge main into amd-staging (#2911) 12409a18f609 [DirectX] Implement `memcpy` in DXIL CBuffer Access pass (#144436) 92b50959da32 [NFC][TableGen] Capitalize `to` in `UseFnTableInDecodetoMCInst`. (#146419) f8d4d5384378 Remove compiler flag for enabling vectorization of i8s b5ef184f506a merge main into amd-staging (#2905) ff4faaa660e1 [mlir][examples] Fix deprecation warnings for `ArrayRef(std::nullopt)` (#146420) f16983f7d0f8 [flang][acc] Ensure fir.class is handled in type categorization (#146174) 6896d8a05dab [RISCV][MC] Support Base P non-GPR pair instructions (#137927) 59a7185dd9d6 [VPlan] Truncate/Extend ComputeReductionResult at construction (NFC). (#141860) d599bdeaa49d [AMDGPU] Autogen checks for test (#146421) 1eb795413df3 [lldb] Correctly restore the cursor column after resizing the statusline (#146132) 0d1392e979ba [MachineOutliner] Remove LOHs from outlined candidates (#143617) f4cecfe1bbdd [flang][cuda] Bring PARAMETER arrays into the GPU module (#146416) 56739f586653 [Analysis] Fix a warning 0745eb501df3 [IR2Vec] Scale embeddings once in vocab analysis instead of repetitive scaling (#143986) 56ef00a59d7e [X86][GlobalISel] Fix RegBank issue for G_FABS (#145674) eb904e857af1 [lldb] Fix link syntax in docs/use/mcp.md dcf8ec921863 Reland "[MLGO][IR2Vec] Integrating IR2Vec with MLInliner (#143479)" (#145664) 026aae704799 [VPlan] Infer reduction result types w/o accessing underlying phis.(NFC) f205e354ae3e [CIR] Upstream GenericSelectionExpr for ComplexType (#146265) 81c9a1a4e510 [libc][obvious] Fixed typos in some wchar headers (#146413) 4c7d3e9315a5 [STLForwardCompat] Implement llvm::type_identity (#146390) 95409b376ea4 [offload][omptest] Add unit tests for sequential asserter 4bf0c6b5f8e2 [libc][bazel] Added wchar functions to bazel (#146126) 163a7e1b4fad [mlir][LLVMIR][NFC] Remove duplicate getUnnamedAddrAttrName uses in op printers (#146090) 93849a39c432 [flang] Check for ultimate ALLOCATABLE component in LOCAL_INIT() (#145800) 16813de178b4 merge main into amd-staging 7da3f0d9a93d [offload][omptest] Refactor asserters to enable testing a68e4470c16b [clang-doc] serialize friends (#146165) 96b9b2e21de4 [Clang] Fix '-Wformat-overflow' FP when floats had field-width and plus prefix (#144274) 90da61634a4a [flang] Use outermost fir.dummy_scope for TBAA of local allocations. (#146006) 0f291e5787a5 [clang-tidy] Add flag to specify an alternative to std::move in cppcoreguidelines-rvalue-reference-param-not-moved (#138757) 5f91b697bcd8 [MLIR] Always emit setPropertiesFromParsedAttr() when hasCustomAssemblyFormat is set (#145973) 46628718c05a [IR][PGO] Verify the structure of `VP` metadata. (#145584) 878d3594ed74 [mlir][vector] Avoid setting padding by default to `0` in `vector.transfer_read` prefer `ub.poison` (#146088) 6a57af8d0367 [clang-tidy] Add flag to specify an alternative to std::forward (#138755) 999b216135b5 Revert "[flang] add option to generate runtime type info as external (#146071)" ba84d0c8d762 [clang-doc] Precommit friends test (#146164) 233078fd8d70 [nfc][asan] clang-format for #145087 536ba87726d8 [libomptarget] Add a test for OMP_TARGET_OFFLOAD=disabled (#146385) 5548f4d5ef6a [LLDB][NFC] Refactor code extracting timestamp from StructuredData (#145954) 125dbe103e4f [OpenACC][CIR] 'update' construct lowering + a few clauses (#146378) 2d825cc3af4e [flang] Add new hints to expected warnings (#146399) b2b20eeb5412 tsan: Support free_sized and free_aligned_sized from C23 (#144531) 01d0171e7a95 Address formatting mistake in libc++ test 36cf51d16e02 [clang][bytecode] Classify variable initializer, not the decl (#146338) 0494f934345f [Basic] Drop const from a return type (NFC) (#146382) 6a83a84ac52a [IR] Remove an unnecessary cast (NFC) (#146381) 7a33b709b1e2 [libc] wcstok implementation (#145989) 790bc5bc724e [flang][NFC] Remove inadvertently added source file (#146395) de7c2f29405f [HLSL] Remove dead code in Type.cpp [NFC] (#146365) 407542b3ecbe [flang] Process pointer component default initializers sooner (#145601) f3d57590bfae [flang] Skip over fixed form spaces when prescanning exponents & kind… (#145347) a93d843ab31a [flang] Don't warn on (0.,0.)**(nonzero noninteger) (#145179) 348002e1117b [flang] Check definability for logical INQUIRE specifiers (#144797) dccc0266f423 [flang][runtime] Allow INQUIRE(IOLENGTH=) in the presence of defined I/O (#144541) 83b462af17ca [flang][CLI] Have the CLI hint the flag to disable a warning (#144767) efc561c061bc [CodeGen] Remove an unnecessary cast (NFC) (#146380) 529508c187e9 [DAG] canCreateUndefOrPoison - add handling for CTTZ/CTLZ nodes (#146361) 04395be63078 MC: Merge MCFragment.h into MCSection.h a8f460d1dcc2 [libc] implement sigsetjmp for thumb/thumb2/armv7-a (#138147) c79b68541be0 Restrict tests in Transforms/InstCombine/SystemZ to SystemZ (NFC) (#146363) 6bd9ff04afdf [ARM] Add neon vector support for round a1d83311c892 [AArch64] Change IssueWidth to 5 in AArch64SchedNeoverseN2.td (#145717) 18a0675082de [bazel] Add gdb-scripts filegroup in llvm and mlir (#146358) 16dc6f64ded3 [lldb] Document MCP support in LLDB (#145935) 25e5010a302f [lldb] Delete unused variables in TestLoongArchEmulator.cpp. 4aaab693148e [libc++] Fix wait_on_destruct.pass.cpp hanging sometimes (#146240) 199c6ecb5cd0 [RISCV] Add coverage for missed scalarization of gather/scatter base pointers 8a5b97a7205d Revert "[clang] [modules] Add err_main_in_named_module (#146247)" 545cdca48835 [SCCP] Improve worklist management (#146321) 6f7370ced630 [InstCombine] Pull vector reverse through fneg (#146349) 425359a83d22 [experimental] Ask copilot to check perf profile degradation (#146271) 00cdaa5c395c [clang][bytecode] Add `Descriptor::hasTrivialDtor()` (#146286) 53102a395f3b [ExtractAPI] Format pointer types correctly (#146182) 5ab3114bd12c Expand annotation check for -Wunique-object-duplication on Windows. (#145944) c00c5a389899 [X86] Add test coverage to show failure to push freeze through CTLZ/CTTZ nodes (+ZERO_UNDEF variants) 44ec3e8f9c3e [clang][AST] Fix AST IgnoreUnlessSpelledInSource traversal nullptr dereference (#146103) 1cdc7f872410 [clang] [Sema] Suggest [[noreturn]] for void functions that always throw (#146234) d1ba2692ee52 [LLVM][Clang] Enable strict mode for `getTrailingObjects` (#144930) b0ff473340e3 [LLVM] Change `ModulePass::skipModule` to take a const reference (#146168) 05cc70fbfaa3 merge main into amd-staging 67e73ba605ea [Offload] Refactor device/platform info queries (#146345) 619f7afd716c [LAA] Clean up APInt-overflow related code (#140048) 8c7719183558 [InstCombine] smin(smax(X, -1), 1) -> scmp(X, 0) and smax(smin(X, 1), -1) -> scmp(X, 0) (#145736) 10445acfa64a [libc] Efficiently implement 'realloc' for AMDGPU devices (#145960) d7e23bef6ad4 [lldb][RISCV] fix LR/SC atomic sequence handling in lldb-server (#146072) a99fee6989a6 [OpenACC][CIR] Implement 'exit data' construct + clauses (#146167) 51dfe28f8754 [clang] odr-checker fix for conversion operators (#146153) d19d7e03a7cf merge main into amd-staging (#2898) d4fdfc3aa718 [DA] Improve code in getSplitIteration (NFC) (#146137) 183acdd27985 [GlobalOpt] Revert global widening transform (#144652) f01a7936bea4 [VPlan] Replace all uses of VF when EVL tail folding. NFCI (#146339) 652630b3c918 [ISel/RISCV] Fix fixed-vector [l]lrint lowering (#145898) b9e4679976e2 [DAG] canCreateUndefOrPoison - add handling for ADD/SUB/MUL overflow nodes (#146322) eb1a80bfd3a0 [DAG] Implement SDPatternMatch `m_SpecificScalarVT` and `m_SpecificVectorElementVT` matchers (#144996) 749c7c5dc49a [AMDGPU] Add support for `v_cvt_f16_bf8` on gfx1250 (#146305) a99c964d7f40 [AMDGPU] Add support for `v_cvt_f16_fp8` on gfx1250 (#146302) e810c639febc [gn build] Port f8cb7987c64d a4647b21f2cb [gn] port b42c8831d57a b29fea6eebae [KeyInstr][Clang][NFC] Don't set -dwarf-use-key-instructions (#144115) be75ded3fea9 [KeyInstr][Clang] Copy ctor/assignment operator source atoms (#144346) 003145d0c8d5 [Offload] Implement `olShutDown` (#144055) 6e6c61d696c9 [InstCombine] Add explicit data layout to test 7a3e555353c5 [Clang][Sema] Require `BaseClass::` (not other classes) in member using-declaration in C++98 mode (#143492) c3f8dd122822 [NFC][analyzer] Use %clang_analyze_cc1 consistently (#145895) 3a7d60860d1a [FatLTO] Relax checks for fatlto pipeline test 5186d4aeeeca [NFC] [clang] Fix a test regression 33c8d5c686ea [Clang][AArch64] Add FP8 variants of Neon store intrinsics (#145346) a72a0f415d59 [Clang][AArch64] Add mfloat8_t variants of Neon load intrinsics (#145666) 5e732c09b213 [CLANG][AArch64] Add mfloat8_t support for more SVE load intrinsics (#145383) d7a3bdffb9a3 [PassBuilder][FatLTO] Expose FatLTO pipeline via pipeline string (#146048) f4128428af0d [PHIElimination] Fix bug around $noreg assignment (#146320) de6b8cdc4112 [EarlyCSE] Add support for writeonly call CSE (#145474) f8cb7987c64d [RISCV] Integrate RISCV target in baremetal toolchain object and deprecate RISCVToolchain object (#121831) 24fd3437c311 [lldb][test] TestMetadataRegisters.py: add missing include 47ecd18f24d3 Global string alignment (#142346) d0c1ea928c5c [InstCombine] Pull unary shuffles through fneg/fabs (#144933) f226852265e6 [X86] Add test coverage to show failure to push freeze through ssubo/usubo nodes (+carry variants) 338dee0742ce [NFC][libclc] Refactor _CLC_*_VECTORIZE macros to functions in .inc files (#145678) 1dfc3e846154 [X86] Add test coverage to show failure to push freeze through saddo/uaddo nodes (+carry variants) 2e7aa7ead680 [mlir][tosa] Add custom operand getters for select op (#145921) 473769ec9b2f [clang] [modules] Add err_main_in_named_module (#146247) b42c8831d57a [clang] Build the Z3 mock module via CMake (#146284) af82e14c4a35 [KeyInstr] Fully support mixed key/non-key inlining modes (#144103) 7ec494e9bde8 [gn build] Port a64db49371f0 96fc0b3a329c [gn build] Port a3a60e03e2bf 22064ce53eb5 [gn build] Port 3f531552e66f 5c5bcd622192 [gn build] Port 34b2e934ea9e 6a120bf02ec0 [Hexagon] Remove unused flag from HexagonGenExtract(NFC) (#146310) 179cc202bda3 [libc++] Add missing _LIBCPP_NODEBUG in <__type_traits/invoke.h> 9fbde32a8c75 Revert "CodeView: Move MCCVDefRangeFragment storage to MCContext/MCFragment" e0864b56b016 [libc++] Fix not exporting std::errc (#146268) 5220e4f2bfb6 Speculative test tweak after ed25d473fb1b7 b563e763065d [AArch64] Improve scalar and Neon popcount with SVE CNT. (#143870) 597ee882a557 [Driver] Add support for `-m` flag to linker job of Baremetal toolchain (#134442) faefe7cf7daf [flang] add option to generate runtime type info as external (#146071) 834c410d9df3 [Target] Prevent copying in loop variables (NFC) 8602204d9fc4 [mlir][tensor] Relax input type requirement on `tensor.splat` (#145893) 57f7e14b5779 [LoongArch] Pre-commit test for _BitInt(N) 7354123c34e6 [KeyInstr] Use DISubprogram's is-key-instructions-on flag at DWARF emission (#144104) ed391f174b90 [Driver] Forward sysroot from Driver to linker in BareMetal ToolChain Object (#132808) 140e1894f245 [KeyInstr] Add DISubprogram::keyInstructions bit (#144107) 629126ed44bd [clang][bytecode][NFC] Remove some dead code (#146287) 2d94c08d03ad Reland [Driver] Add option to force undefined symbols during linking in BareMetal toolchain object. (#146304) bb982e733cfc AMDGPU: support s_monitor_sleep on gfx1250 (#146293) a17f63590ac0 Reland [Driver] Fix link order of BareMetal toolchain object (#146291) 59eaffe93aec [RISCV] Remove required features zvfhmin from vslideup/vslidedown baa8aff47198 merge main into amd-staging (#2897) 42d94afffe64 [Target] Use range-based for loops (NFC) (#146277) 72c0fc230504 [LTO] Remove an unnecessary cast (NFC) (#146275) 678ccd5e536d [IR] Remove an unnecessary cast (NFC) (#146274) d4b5905a2591 Add`final` specifier to the classop (#145977) e47d4010d341 CodeView: Move MCCVDefRangeFragment storage to MCContext/MCFragment 9a6e0688b04f [mlgo][regalloc] Fix after PR #131837 (#146297) 2105da73cab4 Revert "[PHIElimination] Reuse existing COPY in predecessor basic block (#131837)" ff7c5c829497 merge main into amd-staging 613222ec332b [DAGCombiner] Remove `UnsafeFPMath` usage in `visitFSUBForFMACombine` etc. (#145637) 2de51345fb3d MCFragment: Add addFixup to replace getFixups().push_back() dc6b029aa107 merge main into amd-staging cd075a40133d MCObjectStreamer: Deduplicate emitInstToData 38df9ebdc6db [docs] Fix a typo in llvm/docs/CMake.rst (#138639) 75f359dc5643 [MC] Remove an unnecessary cast (NFC) (#146276) b62b58d1bbbf [OpenMP] Fix crash with duplicate mapping on target directive (#146136) 1f5f38192090 AMDGPU: Implement intrinsic/builtins for gfx1250 load transpose instructions (#146289) b822a32659c3 [VPlan] Fix crash when trying to narrow interleave group storing const. 347a5f4f3d8d [gn] port 23f1ba3ee456 (DebugInfo/DWARF/LowLevel) d8081297bd88 [gn build] Port 23f1ba3ee456 d0e8d84424fd [gn] port 3fdf46ad60f1 (RuntimeLibcalls.inc) ed25d473fb1b Reland [Driver] Add support for crtbegin.o, crtend.o and libgloss lib to BareMetal toolchain object (#144649) 43f2a3cd2df9 [gn] port e34e02128ec5eb8 8943036ec37b Fix UAF in ARMConstantIslandPass. fa058647fe3a [clang-format] Make EndsInComma in ContinuationIndenter consistent (#146256) a3a60e03e2bf [clang-tidy] add new check: modernize-use-scoped-lock (#126434) 40525fb4c78a [NFC][docs][coro] Fix syntax & typos (#146282) b5cd49eff02b [mlir] Remove unused includes (NFC) (#146278) f5c62ee0fa04 [PHIElimination] Reuse existing COPY in predecessor basic block (#131837) 37ffe896a5cd Reland [Driver] Add support for GCC installation detection in Baremetal toolchain (#145390) 5fe40b9df3b9 MCExpr: Make print private 8d099271c6ce MCInt: Change dump functions to accept MCContext instead of MCRegiserInfo 713839729c97 [Clang] Add __builtin_invoke and use it in libc++ (#116709) 43ab5bb92115 [CodeGen] Use std::tie to implement a comparison functor (NFC) (#146252) d2d5203bf48a [clangd] Consistent precedence between `--header-insertion` and `HeaderInsertion` (#146235) 2f6a927099e8 merge main into amd-staging (#2892) f5ed863176dd Revert "[VPlan] Allow derived IVs and scalar-steps in narrowing interleave." 267945b665cf [libc++][NFC] Refactored equality comparisons tests for `pair` and `expected` (#145668) f21f2b483c4f [InstCombine] Create Icmp in canonical form (NFC) (#146266) 2787759ef2e4 [VPlan] Allow derived IVs and scalar-steps in narrowing interleave. dd02fb3a5145 [AArch64] Fix stale +zcm target feature to +zcm-gpr64 (#146260) 1649e37f2eb4 merge main into amd-staging dcc9e36b1826 [ARM] Add neon vector support for floor (#142559) c5a49fb62d41 [LAA] Add tests with 128 bit inductions and 128 bit pointers. 20fbbd76755c [LV] Add support for cmp reductions with decreasing IVs. (#140451) 8bd6d36a4413 [ARM] Override hasAndNotCompare (#145441) dc1a79a97814 MC: Make save-temp-labels imply UseNamesOnTempLabels b54337d76cc7 MC: Enhance mc-dump output bab13b379c2c merge main into amd-staging (#2891) 842f4f711d3a [Target] Prevent copying in loop variables (NFC) 2661d595793c MC: Remove post-relaxation and Symbol printing from mc-dump output 279e808b7511 MC: Make mc-dump output compact 2248cdfa74ec [Arm] Fix UAF in ARMConstantIslandPass (#146232) c9cdc33dd697 [clang] Remove unused includes (NFC) (#146254) 9cf251d9d8cc [Target] Use range-based for loops (NFC) (#146253) 72e24f3022f3 [MC] Remove an unnecessary cast (NFC) (#146251) 8a4b6cd8d80d [IR] Remove an unnecessary cast (NFC) (#146250) 0d0daef6ee95 [GlobalISel] Remove an unnecessary cast (NFC) (#146249) 6f2cec219a52 merge main into amd-staging 68d83fae70b2 [llvm-profdata] Resolve tilde for weighted input filenames (#146206) 25d52fbf96ec [PowerPC] Prevent copying in loop variables (NFC) 6c2aa37fb1fd MCAsmStreamer: Print symbol equated to a register 1108cf64196a ELFObjectWriter: Optimize isInSymtab 3cc78a806778 [NFC][AMDGPU] Fix the instruction order in some test cases to make downstream easier (#146214) aa8afadd251c MCSymbolRefExpr: Migrate away from deprecated VariantKind 53e665e50134 merge main into amd-staging (#2889) 2ed04016120f CSKY: Migrate to the new relocation specifier representation f771d08a2476 [clang-format] Fix a bug in `ReflowComments: Always` (#146202) d2e8e55e02f7 CSKY: Replace deprecated MCExpr::print with MCAsmInfo::printExpr bdb299a67eb8 [VPlan] Simplify code in single scalar transform code (NFC). a365abd544fd MCExpr: Remove error-prone operator<< e6b25288eb0a MCExpr: Migrate away from operator<< 5ffdd9480d80 [CodeGenPrepare] Filter out unrecreatable addresses from memory optimization (#143566) 3ea7fc733970 attempt to calm down restarter job fb24b4d46a0a [BOLT] Push code to higher addresses under options (#146180) f90025ebd930 [llvm] Compare std::optional to values directly (NFC) (#146222) bad5a740e114 [PowerPC] Use range-based for loops (NFC) (#146221) 402baea0a9ff [modularize] Use std::tie to implement operator< (NFC) (#146220) dea8217a7a09 [ADT] Use llvm::has_single_bit (NFC) (#146219) 289c066ac474 [ExecutionEngine] Remove unnecessary casts (NFC) (#146218) c101415820f2 [DebugInfo] Remove an unnecessary cast (NFC) (#146217) 25d7fd35b203 [Analysis] Remove unnecessary casts (NFC) (#146216) c57c5f53a32a [flang] Fix warnings 303bc0df6ade SPIRV: Replace deprecated MCExpr::print with MCAsmInfo::printExpr f96832a52019 BPF: Replace deprecated MCExpr::print with MCAsmInfo::printExpr 55fd1ac63839 merge main into amd-staging 80222f0aa44c [bazel] Port 3f531552e66f242d4bfc0163be848f9e51259d80 0255ae81ba4e AsmMatcher: Use getAsmInfo() e878b7e3492b MCParsedAsmOperand::print: Add MCAsmInfo parameter 33c265ddf7f3 [SimplifyCFG] Use indexType from data layout in switch to table conversion (#146207) 344b5b7f9e5b [flang][OpenMP] Move lowering of ATOMIC to separate file, NFC (#146225) ff075d0ac22e MCParser: Remove operator<< const MCParsedAsmOperand &MO 2327f3f1d5aa merge main into amd-staging (#2887) 194953649494 [VPlan] Also visit VPBBs outside loop region when unrolling by VF. d93aff42c230 MC: Migrate away from operator<< MCExpr a9295ad4d2d3 AArch64: Replace deprecated MCExpr::print with MCAsmInfo::printExpr 94c1506548ec Further restrict the restarters ability to restart manually canceled jobs 169b4bea8774 Attempt to fix over-keen restarter. 372c80821777 [X86] canCreateUndefOrPoisonForTargetNode - PCMPEQ/PCMPGT don't create poison/undef (#146116) bf8b346e0566 merge main into amd-staging fd47c265dda7 merge main into amd-staging (#2886) 3d21f54e42e0 merge main into amd-staging (#2885) b8f122812e0a [docs][coroutines] Revamp "Debugging C++ coroutines" (#142651) 34b2e934ea9e [libc++] Introduce `__product_iterator_traits` and optimise `flat_map::insert` (#139454) feb61f5b0529 [Target] Prevent copying in loop variables (NFC) 8ecee5098e34 merge main into amd-staging 8c1aca180cf7 Revert "Reapply "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#… (#145959) (#146112)" 5ea29f77b9f8 [DA] Let getConstantPart return optional APInt (NFC) (#146135) cadf26b68865 merge main into amd-staging 04cd0f270227 [LSR] Clean up code using SCEVPatternMatch (NFC) (#145556) 7ff9669a2e80 [ISel/RISCV] Refactor isPromotedOpNeedingSplit (NFC) (#146059) be9502b095d2 [LoopInterchange] Modernize loops (NFC) (#146105) 1e2ddc8a3d4a [CostModel/RISCV] Add tests for ldexp, [l]lround (#146108) 93ae443ef53f Merge amd-debug into amd-staging (#2883) b6515ae6843d [AArch64] Align 0-cycle reg-mov model of GPR64, GPR32 reg classes (#146051) 69b8e59f29a3 [ValueTracking] Forward-declare class instead of including header (NFC) 0ba456fcc6b1 [Clang][LoongArch] Match GCC behaviour when parsing FPRs in asm clobbers (#138391) c83862451184 merge main into amd-staging (#2884) e34e02128ec5 [clang] Fix tests requiring Z3 headers in standalone builds (#146200) 3c4e7308028e [Sema][clangd] add noexcept to override functions during code completion (#75937) 8351752dbc40 [clang-tidy] Fix false positives in `readability-redundant-inline-specifier` (#135391) 18e9cfd56b0a Hexagon: Remove getVariantKind b9ca4c5fab40 MCExpr: Make COFF-specific VK_SECREL target-specific 3f531552e66f [REAPPLY][Clang-Repl] Add support for out-of-process execution. #110418 (#144064) ac9204de7d4f MCExpr: Remove VK_None c5479dc09f25 merge main into amd-staging e121f72c945f X86: Rename X86MCExpr::VK_ to X86::S_ 1a94bcf90f26 [llvm] Remove unused includes (NFC) (#146199) 094a7087b83b [Target] Use range-based for loops (NFC) (#146198) 56da4a962855 [llvm] Use std::tie to implement comparison functors (NFC) (#146197) f90af1c9e83b [MC] Drop const from a return type (NFC) (#146196) 7f6d7391cfff [Basic] Use StringRef::drop_back (NFC) (#146195) eff28bdd46b1 [AMDGPU] Use StringRef::consume_back (NFC) (#146194) c73906ec691d MCParser: Reduce VK_None uses 80625c16f067 [MLIR][Affine] Fix memref replacement in affine-data-copy-generate (#139016) 28d4cc6d7b16 MC: Reduce MCSymbolRefExpr::VK_None uses 4d7510c33525 [RISCV] Remove untested code from SelectAddrRegRegScale. (#146185) 0e558239b825 LoongArch: Remove unneeded VK_None check 5aa3e6baa0b0 MC: Reduce MCSymbolRefExpr::VK_None uses 109b7d965c58 MC: Remove unneeded VK_None argument to MCSymbolRefExpr::create calls c6bd0207141f Revert "[Hexagon] NFC: Reduce the amount of version-specific code" (#146193) 54a7d53227ae [BOLT] Fix program-header.test 163ad0bcdae5 [bazel] Add lldb deps for #144627 (#146192) 3923dd4484b8 Fix uncaught-exception.test. (#146190) 72060f1cfd56 Fix uncaught-exception.test. (#146181) a64db49371f0 [lldb][Mach-O] Allow "process metadata" LC_NOTE to supply registers (#144627) 67a5fc8e12dc Update references from llvm-beanz to llvm (#146177) 389fd7e888f8 xfail two mlir tests 32180cf9f9eb [CIR] Upstream support for operator assign (#145979) 48a9d5bc30d1 Resolve conflicts 66cf7844fb6c Merge branch 'amd-debug' into amd-staging 570b95218c13 [flang][cuda] Do not generate section checks in device context (#146170) 6d817810daa1 [clang-doc] serialize IsBuiltIn and IsTemplate for types (#146149) 71d4c9ce70e7 cmake: Allow CLANG_RESOURCE_DIR to be absolute. 5ecd21a46ab1 [NFC] Make unwind table internal data structures more accessible (#145804) c43282ab69d7 [RelLookupTableConverter] Drop unnamed_addr for GVs in entries to avoid generating GOTPCREL relocations (#146068) c7c79183febc Fix libomptarget build with flang disabled (#2879) 51d642d8289f Manual update of LLVM_MAIN_REVISION to 542578 (#2882) 75175e723085 [flang][cuda] Inline this_thread_block() calls (#146144) 9a93de58f7f3 [TableGen] Simplify copying OperandMap entries for tied operands in CompressInstEmitter. NFC 457c9aec9e84 [TableGen] Simplify how we calculate NumMIOperands in addDagOperandMapping. NFC 8bc61cbfde28 [Clang][ByteCode][NFC] Avoid copies by using move in Disasm.cpp (#146127) f58caed1bc50 [libc] Changed CharacterConverter returns (#146130) 171aa34e43bc [DirectX] Add static sampler support to root signature (#143422) 442f99d7698a [lldb] Fix evaluating expressions without JIT in an object context (#145599) 9f5061d4f004 [lldb] Fix a typo in documentation (#146115) b2f504ff15a1 [flang][cuda] Inline this_warp() calls (#146134) 231076898cc0 merge main into amd-staging (#2878) 68239b76f139 [gtest] Fix building on OpenBSD/sparc64 (#145225) 29b105483510 [mlir][linalg] Update pack and unpack documentation (#143903) 33d20828d1ff [OpenACC][CIR] Implement enter-data + clause lowering (#146146) 8d2034cf68b5 [clang] Add flag fallow-runtime-check-skip-hot-cutoff (#145999) 23be14b22200 [HLSL][SPIRV] Boolean in a RawBuffer should be i32 and Boolean vector in a RawBuffer should be (#144929) f20ef8520ddc [CIR][NFC] Fix init llvm::ArrayRef warning (#146147) 98f7d756e334 [FileCheck] Improve printing variables with escapes (#145865) 929fea8c807d Manual update of LLVM_MAIN_REVISION to 542578 526701f8dc54 [LV] Add additional tests for narrowing interleave groups. e9c9adcefed1 [Hexagon] NFC: Reduce the amount of version-specific code (#145812) 21993f0a47f0 [lldb][NFC] Switch IRMemoryMap::Malloc to return llvm::Expected (#146016) 254c26d02276 Add missing dependency. (#146140) 17328f36f6ca [BOLT][test] Fix NFC mismatches in perf2bolt tests (#146148) 23daa31341a6 [llvm] Don't preserve analysis results after EmbedBitcodePass (#146118) d34214a85e3b [libc] Add and use 'cpp::launder' to guard placement new (#146123) 1eacdddc0c44 [SandboxVec][SeedCollector][NFC] Replace cl::opt flags with constructor args (#143206) 2e98979ef4bf Fix libomptarget build with flang disabled 52040b44f606 [ADT] Remove MutableArrayRef(std::array) (NFC) (#146114) 9d6cbc3c2092 [ADT] Deprecate MutableArrayRef(std::nullopt) (#146113) 71bc606e95d6 [LowerAllowCheckPass] allow to specify runtime.check hotness (#145998) 6c2e91285510 AMDGPU: Add alias tests for load transpose instructions for gfx1250 (#146117) 5dbd8772fed2 [DirectX] add support for i64 buffer load/stores (#145047) 23f1ba3ee456 Reapply "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#… (#145959) (#146112) a4be46e0e5bc [Clang][ByteCode][NFC] Misc minor performance fixes (#145988) 836dd77c45ee merge main into amd-staging 32ef4ceec03d [InstrRef] Skip clobbered EntryValue register recovery (#142478) e4d8e06f83f8 [OpenACC][CIR] Implement present/deviceptr/attach lowering for data 778b6a21ec27 [DirectX] Allow vector Allocas to be transformed into arrays (#145972) a19d37044b35 [libc++] P2944R3: Constrained comparisions - `tuple` (#145677) a3fcfacc35e7 [TableGen] Simplify verifyDagOpCount in CompressInstEmitter.cpp. NFC c11ea449e59c [ValueTracking] Add `matchSimpleBinaryIntrinsicRecurrence` helper ac7e3910350a [libc] Implemented wcsnlen (#145610) af2bf2e544b5 MC: Remove unneeded MCSymbolRefExpr::VariantKind calls 74cabdb806ae [CIR] Add basic support for operator new (#145802) 3e9fd4966d73 [CIR] Add support for constructor aliases (#145792) d1d8ef2ad9c2 [PassBuilder] Treat pipeline aliases as normal passes (#146038) (#2871) f80d1b5d9dad merge main into amd-staging (#2875) 2557f9946373 [OpenACC][CIR] Implement 'no_create' lowering for data f03782dd67d3 [NVPTX] Fixup v2i8 parameter and return lowering (#145585) 7613c2412a25 [LoopInterchange] Use ArrayRef in more places (NFC) (#146077) 4df059484c13 Merge llvm/main into amd-debug d00c83ef226f [BOLT] Skip creation of new segments (#146023) 2282d4faa011 [ISel/RISCV] Improve code in lowerFCOPYSIGN (NFC) (#146061) 9df1c81fee5b [SelectionDAG] Combine range metadata when loads are CSEd. (#146026) 375af75efb2e [RISCV] Simplify the check for when to call EmitLoweredCascadedSelect. NFC (#145930) b76bc185a4f2 [OpenACC][CIR] Add copy/etc clause lowering for 'data'. e933cfcfb2d2 [NVPTX] Fixup NVPTXPrologEpilogPass for opt-bisect-limit (#144136) 37b0b0f7d2b6 [lldb] Add class property for the version string (#145974) a460aa1071c9 [Sema] Fix a warning ec150a9944b2 [PhaseOrdering] Add test for memset DSE (NFC) fd24e8237087 Merge llvm/main into amd-debug 794edd187cee [clang] Suppress noreturn warning if last statement in a function is a throw (#145166) 07f1502b867e [CIR] Implement SizedTypeInterface to make isSized hookable (#146045) 61c0a94a9047 [CIR] Refactor type interfaces (#146044) dc6d2b841f22 Revert "[flang][OpenMP] Move lowering of ATOMIC to separate file, NFC" (#146091) 3b7b95f78e24 [VPlan] Support VPWidenSelectRecipe in narrowToSingleScalar. 1df3e0a275bd [lldb] Use llvm::is_contained (NFC) (#146012) f0311f447a23 [ADT] Remove a constructor (NFC) (#146010) 3876e887d00f [MLIR][ArmSVE] Add an ArmSVE dialect operation mapping to `bfmmla` (#145064) da2969b1051f [LLDB] Update DIL to handle smart pointers; add more tests. (#143786) 772009ce4aff [PS5][Driver] Allow selection of CRT with `-L` (#145869) 3463aba45f61 [OpenACC][CIR] Implement copyin/copyout/create lowering for compute/c… (#145976) 08d747c1ef65 [AMDGPU] Fix bad removal of s_delay_alu (#145728) 39f19f2f1fb8 [Offload] Store device info tree in device handle (#145913) 102cf1b99971 [Offload] Make CUDA Driver Version a string (#146049) 3e8437cf8e8f [openmp] - Rework openmp-config for portability (#2856) dcea5f1f38eb [TargetLowering] Fold (a | b) ==/!= b -> (a & ~b) ==/!= 0 when and-not exists (#145368) e9acd14d27d5 [HeterogeneousDwarf] Fix asserts during expression emission (#2860) 5ecf16f5e107 merge main into amd-staging f329689ec091 [AMDGPU] add_i128.ll - regenerate test checks 2b48ce7034a8 [docs] Add documentation for LLVM Qualification Group (#145331) 2cbcec483293 [Clang][NFC] - Move attr-cpuspecific-cpus test over to Sema (#146065) f59d270867cc [cmake] Ignore pstl in LLVM_ENABLE_PROJECTS (#146070) 302ed97b583f [flang][OpenMP] Move lowering of ATOMIC to separate file, NFC (#146067) ec1c73b2ecb3 [compiler-rt][ARM] Only use bxaut when the target has pacbti (#146057) d8ca77e2b96e [Clang][Sema] Allow qualified type names in `swift_name` attribute 541f33e0751d [mlir][linalg] Prevent hoisting of transfer pairs in the presence of aliases (#145235) 7e2e03012143 GlobalISel: Replace use of report_fatal_error (#145866) 37e2d104994d Revert "[flang] add option to generate runtime type info as external" (#146064) 91f10df794d3 [Flang][OpenMP] Skip implicit mapping of named constants (#145966) c8ea114741ce AMDGPU: Introduce a pass to replace VGPR MFMAs with AGPR (#145024) bc1a6a2a9377 AMDGPU: Add baseline tests for VGPR MFMA rewriting pass (#145023) cf3d136c2253 [AArch64] Do not generate ld1IndexPost when inserting into lane 0 of a zero vector (#145723) e9805235bf68 [libc++] Move libcxx/test/libcxx/extensions to libcxx/test/extensions and update the tests (#145476) 3666b42257c9 [PassBuilder] Treat pipeline aliases as normal passes (#146038) 5fdcb35aaa4e [InferAlignment] Add tests with GEP recurrences. e816817bbb28 [flang] add option to generate runtime type info as external (#145901) f0f46e25ecbf [bazel] Port 3fdf46ad60f1747e8ea1cced2e67dd36f29fc43b b989c76f3974 [flang][NFC] switch ValueRange(nullopt) to ValueRange{} after #146011 (#146043) 3f00cff5c787 [lldb][test] Disable TestLocationsAfterRebuild.py on Windows 7dde6027a079 [DAG] canCreateUndefOrPoison - add handling for ISD::SELECT (#146046) 0158ca21a23b Prevent a crash when a global variable has debug metadata (#145918) 793667017c64 [NFC][LLVM] Use DL consistently throughout AArch64ISelLowering.cpp. aed8f1992a3b [NFC][mlir][memref] refine debug message about memref::SubViewOp. (#145470) c3e08c9b893b [MLIR] Replace getVoidPtrType with getPtrType in ConvertToLLVMPattern (#145657) 1fb786ea9387 [clang][scandeps] Improve handling of rawstrings. (#139504) 7f223d121d74 [PassBuilder] Treat pipeline aliases as normal passes (#146038) 613804cca986 [LV] Improve code using [[maybe_unused]] (NFC) (#137138) 08f074a59f3d [TTI] getInstructionCost - consistently treat all undef/poison shuffle masks as free (#146039) 5f2b9dd90dcc Re-land "[-Wunterminated-string-initialization] Handle C string literals ending with explicit '\0' (#143487)" bf2b14acf326 [LV] Enable auto-vectorisation of loops with uncountable exits (#133099) 2c90c0b90cbd [lldb] Extract debug server location code (#145706) 7255c3aee3eb DAG: Check libcall function is supported before emission (#144314) ddb8493ca757 [LV] Fix test issue caused by #145877 (#146041) b4d3283ab79c AArch64: Add libcall impl declarations for __arm_sc* memory functions (#144977) 779f7243c8bb XCore: Declare libcalls used for align 4 memcpy (#144976) f38773e980e2 Hexagon: Add libcall declarations for special memcpy (#144975) 4243e502c13e ARM: Add runtime libcall definitions for aebi memory functions (#144974) b88e1f6a79cb TableGen: Generate enum for runtime libcall implementations (#144973) 3fdf46ad60f1 TableGen: Add runtime libcall backend (#144972) d163ab332349 [libc++] Remove a bunch of unnecessary type indirections from __tree (#145295) c15f4225419f [RISCV] Remove required features zvfhmin/zvfbfmin from plain f16/bf16 intrinsics (#145891) 6f43754e9caa [LV] Disable interleaving via hints for uncountable early exit loops (#145877) 2529de5c935a [ADT] Deprecate ArrayRef(std::nullopt) (#146011) a40a4c552b92 [MC] MCSectionGOFF.h - fix GCC Wparentheses operator precedence warning around assert message. NFC. ec62dee70349 [VPlan] Handle FirstActiveLane when unrolling. (#145394) 045b82736702 [GlobalISel] Use-Vector-Truncate Opt Needs Elt Type Check (#146003) 8a839ea79123 [analyzer][NFC] Fix clang-tidy warning in Malloc and UnixApi checkers (#145719) 205dcf7146ce PowerPC: Remove redundant MCSymbolRefExpr::VariantKind casts 96c1611163d3 [mlir][linalg] fix OuterUnitDims linalg.pack decomposition pattern (#141613) 23384cd58171 [OpenMP][test][NFC] Temporarily disabling failing test 950d281eb2d4 [RISCV] Add ISel patterns for Qualcomm uC Xqcicm extension (#145643) bc90166a50c4 [TSan] Clarify and enforce shadow end alignment (#144648) 7726103d1ee1 WebAssembly: Merge MCExpr into MCAsmInfo a277d24ddb7c [ProfileData] Use llvm::count (NFC) (#146013) c7b34b0b44ae [mlir] Use a new constructor of ArrayRef (NFC) (#146009) 26ec66dc1825 [llvm] Use a new constructor of ArrayRef (NFC) (#146008) 8f71650baaee [clang] Use a new constructor of ArrayRef (NFC) (#146007) 786ccb2c0e8c [LV] Directly check if memory or SCEV check blocks are used (NFCI). eb9d22b24cb8 VE: Merge MCExpr into MCAsmInfo afe6af14ff9b [msan] Add optional flag to improve instrumentation of disjoint OR (#145990) 56b2c7d98875 MC: Rename initializeVariantKinds to initializeAtSpecifiers 917932244714 Revert "[llvm][EmbedBitcodePass] Prevent modifying the module with ThinLTO" (#145987) d829636f5d71 [C++20] [Modules] Don't mark namespace decl as module local declaration 47292428785f AMDGPU: Add MC layer support for load transpose instructions for gfx1250 (#146024) 7dfcf489fd93 PowerPC: Separate ELF and XCOFF @ specifiers 905f987d2f44 merge main into amd-staging (#2865) 60a18d611907 [LowerAllowCheckPass] fix pipeline printing (#146000) 0cde5a85690c [gn build] Port 4f97780a7a55 61739d76f009 AMDGPU: Trivial doc fixes (#146021) 8ed064b979d5 [bazel] Add targets for transform.debug python extension (#146022) 207925ebe780 Xtensa: Move MCExpr into MCAsmInfo ab1e4d55d866 [clang-doc] refactor BitcodeReader::readSubBlock (#145835) 4f97780a7a55 LoongArch: Move MCExpr into MCAsmInfo 569fcac4584a [LoongArch] Pre-commit tests for optimizing insert extracted fp elements 1b2843bae062 [bazel] Port #145995 (#146014) 96ec1c29f236 [RISCV] Add nds.bfos and nds.bfoz for the short forward branch optimization. (#145836) 0515449f6dcb [mlir][tensor][memref] Enhance collapse(expand(src)) canonicalization pattern. (#145995) 30e519e1ad18 [LoongArch] Fix xvshuf instructions lowering (#145868) d58b0f23d062 AMDGPU/MC: Try harder to evaluate absolute MC expressions (#145146) 54e2f5ac9c45 [clang][docs] Fix typo in -fapinotes-modules option. (#145907) 13da48ddb31e [lldb][NFC] Remove unused ConstString includes in Utility (#145983) f2f17e563df9 [clang-format][NFC] Remove `\brief` from comments (#145853) ad6b597875b9 [ORC] Fix EPCGenericMemoryAccessTest write-ptrs implementation after f93df5ebd99 0247f88ab6f6 merge main into amd-staging 2e4aa7855b99 merge main into amd-staging (#2863) 9a0a9764f38a [Clang][AArch64] _interlockedbittestand{set,reset}64_{acq,rel,nf} support for AArch64 (#145980) ec48d15b2003 Fix a bug in the breakpoint ID verifier in CommandObjectBreakpoint. (#145994) c3811c8474f4 [lldb][scripts] Use named args in versioning script (#145993) 89513a0cb4b8 merge main into amd-staging (#2862) f93df5ebd992 [ORC] Add read operations to orc::MemoryAccess. (#145834) 76f3cc9e0453 [lldb] Fix another race condition in Target::GetExecutableModule (#145991) 018548ddffea [objcopy][coff] Place section name first in strtab (#145266) 3df36a2b1872 [AMDGPU] Enable vectorization of i8 values. (#134934) 9e4981cf1189 [NFCI][msan] Add test for "disjoint" OR (#145982) 45639186cd54 merge main into amd-staging c73e5e3e209c [lldb][scripts] Fix bugs in framework fix script (#145961) 4e154ccaf17f [bazel] Add missing deps needed for parse_headers after #145313 (#145978) 772eb075674b [VPlan] Clarify comments after #145340 (NFC). aeec2c6e4893 [VPlan] Speed up VPSlotTracker by using ModuleSlotTracker (#139881) e811383f3353 [gn build] Port d7b936b633f3 ca0565aa0b4c [gn build] Port 33872f12187b 8f62c0c3dadb [gn build] Port 0faa181434cf 6116f5acc615 [gn build] Port 0a3c5c42a178 063cee7bdeef [AMDGPU][MC] Allow opsel for v_max_i16 etc in GFX10 (#143982) 9727781b5727 locally land: [Clang] Determine offloading architectures at Toolchain creation (#145799) 1dfdd1e6dea1 [mlir][emitC] Add support to emitter for `classop`, `fieldop` and `getfieldop` (#145605) fb138a675e4a [gn] port 40cc4379cda6e0d 64f16f48965e [gn] port e175ecff93628 30c61119b932 [MergeICmps] Fix miss-compile in MergeICmps in presence of blockaddresses (#145925) a9ed84b61808 [clang] ms-abi: member pointer inheritance model lock-down fix (#145958) d699fbd2033e [OpenACC][Docs] Add a release note for Clang 21 (#145938) 5d03e7a2047c Revert "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#… (#145959) 0f1fd8735ca1 [gn] fix `gn gen` after 2a907f40bcb1f26c 7849590a5fe4 merge main into amd-staging df5097dd946e [Offload] Add default for HSA agent type to silence warning (#145943) 938cdb30f16f [flang] Migrate away from std::nullopt (NFC) (#145928) a0c5f1992d21 [SystemZ][zOS] disable _Float16 support on z/OS (#145532) 283c2e8d7c9f [flang][semantics] fix issue with equality of min/max in module files (#145824) e25db2f6b30d [CostModel] getInstructionCost - match SK_InsertSubvector shuffle patterns before SK_Select (#145920) 72ffa799c847 [NVPTX] tryStoreParam - remove default-only switch statement. NFC. (#145948) 70233c61d659 Add minimum count threshold for indirect call promotion (#145282) 4308292d1e3f [BOLT] Refactor NewTextSegmentAddress handling (#145950) b0500f56c8b6 Revert "[clang][python][test] Move python binding tests to lit framework" (#145951) 0ef27186c931 [tests] Additional coverage for gather/scatter address optimizations 947e072744ae [CodeGen/RISCV] Add fixed-vector [l]lround tests (#145926) 232c2921e19a Reland [mlir][OpenMP] Use correct debug location with link clause. (#145889) cbf781f0bdf2 [NFC][DebugInfo][DWARF] Create new low-level dwarf library (#145081) f2991bf79109 [AMDGPU] Convert 64-bit sra to 32-bit if shift amt >= 32 (#144421) 442c417749d2 [libc][bazel] Support generating public libc headers in Bazel builds. (#145381) 66ec14171ede [libc][bazel] Add bazel targets for libc/include/... tests. (#141150) 3c5b17fb980f merge main into amd-staging (#2851) edf0d0da435c [OpenACc][CIR] Fix tests failed because of crossed-patches 6b9e6f066f84 [Hexagon] Remove emplace workaround (NFC) (#145718) 592f203ee6d3 [X86] abds-vector-128.ll - regenerate VPTERNLOG asm comment 30d861f2e873 [clang-scan-deps] Enable test P1689.cppm on Windows (#145857) 655d04859be6 [GOFF] Add writing of text records (#137235) e880cf74217d Reland "[lldb][target] Add progress report for wait-attaching to proc… (#145111) 4c8fab399b2e [libc++] Avoid type-punning between __hash_value_type and pair (#143501) 7842e9eada2e [mlir][Vector] Lower `vector.to_elements` to LLVM (#145766) abf8e25ac764 [DAG] Add `SDPatternMatch::m_Load` (#145481) 1d60d91bf3ae [HLSL][SPIRV] Add option to add all KHR extensions (#145536) 0a2b6f6c1cc7 [OpenACC] Fix 'copyout' allowed modifiers alwaysin vs alwaysout 0b8a656ba110 [lldb-dap] Fix source references (#144364) 5c310d1ef018 Default transcript dumping in "statistics dump" to false (#145436) 066a14d4d483 [clang-doc] refactor JSONGenerator array usage (#145595) e0c7136713d2 [LowerAllowCheck] preserve CFG analyses (#145816) 9a44f55c00f7 [sanitizers] do not accept out of bounds -fsanitize-skip-hot-cutoff (#145806) 32aa80c362bf [NFCI] [LowerAllowCheck] also test lower-allow-check-percentile-cutoff-hot (#145822) 8a6519677c08 [RISCV] Move CascadeSelect test into float/half/double-select-fcmp.ll. NFC d83457eb83d8 [NFC][lldb-dap] Add missing header guard for DAPError and ProgressEvent. (#145915) 48e893792a33 [Clang] Determine offloading architectures at Toolchain creation (#145799) 928a7e6cb933 [AArch64] Use 0-cycle reg2reg MOVs for FPR32, FPR16, FPR8 (#144152) f0c1a9a85d18 [DAG] Add SDPatternMatch::m_Result to match a specific SDValue result (#145775) 720d7e09b322 [CIR][NFC] Fix an unused variable warning (#145922) 69bbf2135e7d [OpenACC][CIR] Implement 'modifier-list' lowering (#145770) 2e3995981cb3 [HLSL][RootSignature] Use "stringified" version for diagnostic output of punctuator tokens (#145827) aeea062dd43e [lldb][DataFormatter] Unwrap reference type when formatting std::unordered_map (#145872) e0b83ca8a409 [MLIR][ArmNeon] Add a couple of negative tests for BFMMLA with scalable dimensions (#145882) 9d91b07e1e8b [CIR] Implement EqualOp for ComplexType (#145769) 07e3c859b0cb [FileCheck][NFC] Pre-commit test for printing escaped variables (#145906) 5a996c6ed760 Add triple target to buildtype.ll in X86 (#145764) 33872f12187b [GOFF] Add writing of section symbols (#133799) 6bdfecaea837 [clang] Revise relnote for int->enum conversion. (#145755) 04b60d29ba7f Disable HWSan for thread_creae_failure.pass. abc2c3a53805 [mlir] Use llvm::is_contained instead of llvm::all_of (NFC) (#145845) 3d5903c4d8a6 [llvm] Use llvm::is_contained (NFC) (#145844) 31122446c90e [clang] Use llvm::is_contained instead of llvm::all_of (NFC) (#145843) 70dce3d987ce [mlir] Migrate away from std::nullopt (NFC) (#145842) 87729bcbb817 [clangd] Migrate away from std::nullopt (NFC) (#145841) a13cf846e0c6 [ASTMatchers] Migrate away from ArrayRef(std::nullopt) (NFC) (#145840) 620dbf1fec47 [llvm] Use llvm::interleaved (NFC) (#145839) 7eec132f9c0d [lldb] Fix source/Host/common/Editline.cpp formatting (NFC) 775a69b237d0 [OpenMP] Fix comma -> semicolon (#145900) 08964d69b069 [HLSL][SPIRV] Handle `uint` type for spec constant (#145577) 4233ca1e4e53 [OMPIRBuilder] Fix use of uninitialized variable. (#145883) 5bbe1536dfa6 Cap IntRange::Width to MaxWidth (#145356) 0f87c78f647c [GitHub] Add PR filters for VectorCombine patches (#145896) d13e223a89b0 [MLIR][AArch64] Add integration test for lowering of `vector.contract` to Neon FEAT_I8MM (#144699) 1a60c74c131a [CostModel][X86] SK_InsertSubvector inserted into the lowest subvector should be treated as SK_Select blend (#145892) 817da3e996a1 merge main into amd-staging 06a4394b5036 Disable HWSan for thread_creae_failure.pass. 2bece2194a12 [mlir][mesh] resubmitting #144079 (#145897) 5bf43634c450 [mlir][affine] NFC Rename SimplifyAffineMinMax -> SimplifyAffineMinMa… (#145905) 90c9cc2c9810 [clang][python][test] Move python binding tests to lit framework (#145855) 58b7d200aa51 [libc] Fix the risc-v half precison float feature check (#145894) 67302b2e6f81 [AMDGPU][NFC] rename some constants for readability (#145870) 4ce96987e5e5 merge main into amd-staging (#2846) d05634d5cdc5 [VectorCombine] Fold bitwise operations of bitcasts into bitcast of bitwise operation (#137322) cfdc4c4a5b67 Revert "[flang][OpenMP] Move lowering of ATOMIC to separate file, NFC (#144960)" 597ffb1187dd Revert "[flang][OpenMP] Fix namespace nesting after PR144960" a1d5b9d1cda4 [mlir][affine] Wrap SimplifyAffineMinMax in a pass (#145741) 90f3147424a3 [Sema] Cut the deep_recursion.c test in half to fix tests in asan mode 5b76cdba5aac [VPlan] Handle AnyOf when unrolling. (#145340) fe4b4033edf2 [X86] lowerShuffleAsVTRUNC - use combineConcatVectorOps to catch more "cheap" concats (#145876) cc1eae6ea2de [flang][OpenMP] Remove experimental warning (#144915) 6a5469bb815d [bazel] Fixes for e5a8c51c9dc85a7b463a4570942e3e5e1cb70e0b afc6c2bb9b43 [Clang] Allow the use of [[gnu::visibility]] with #pragma clang attribute (#145653) d59e0ba80b85 [lldb][docs] Document qWatchpointSupportInfo (#145709) e5a8c51c9dc8 [mlir][tensor] Make tensor::PadOp a ReifyRankedShapedTypeOpInterface (#145867) af7166a3f126 [AArch64] Ensure the LR is preserved if we must call __arm_get_current_vg (#145760) 35a0c18b88e0 [GOFF] Introduce GOFFWriter class (#131216) 40cc4379cda6 [NFC][analyzer] Remove Z3-as-constraint-manager hacks from lit test code (#145731) 2a907f40bcb1 [gn] sync dbb3e7d1162d (ish) 0b6ddb02efdc [clang] NFC: Add alias for std::pair used in SourceLocation (#145711) 548e8e92e98d [X86] [clang] Add missing check line for diamondrapids (NFC) (#145542) 635acfbfca47 [LLVM][AArch64] Relax SVE/SME codegen predicates for crypto and bitperm instructions. (#145696) 3287c1c17655 [XeGPU] Move targetinfo constants to their own header file b77114b723eb [lldb] Remove child_process_inherit argument from Pipe (#145516) f64d5df3c252 [LLVM][SME] Only FADD/FSUB are enabled by either sme-f16f16 or sme-f8f16. (#145704) 6307b496f8ba [AMDGPU] Add `GCNRPTarget` to track register pressure against a target (#145765) d41f5fe9e40e merge main into amd-staging 95149011ea01 Guard against self-assignment; NFC (#145743) 21def215b53e [Utils] Drop const from a return type (NFC) (#145838) 9ae41f017d8e [lldb][Darwin] revert change to lang_opts.BuiltinHeadersInSystemModules (#145864) d3fd7921d4d7 Clarify some code based on static analysis complaints; NFC (#145679) a19ddff98013 [LoongArch] Pre-commit test for fixing xvshuf instructions. NFC 30de98c283f5 Revert "[-Wunterminated-string-initialization] Handle C string literals ending with explicit '\0' (#143487)" 0cc10383f4bc [X86] avx512-vbroadcast.ll - regenerate VPTERNLOG asm comment 0905767610d6 [libc++] Address remaining comments from #130145 163871c2d269 [Support] Remove workarounds for building with mingw.org toolchains (#145683) aa2402931908 [VPlan] Unroll VPReplicateRecipe by VF. (#142433) 696c0f92e0fe [libc++] Don't try to wait on a thread that hasn't started in std::async, take 2 (#130145) 4f1b362ffa9c merge main into amd-staging (#2839) 13daf656561d [flang] handle common block used as BIND(C) module variables (#145669) a2265423d0ba [MLIR][ArmNeon] Add an ArmNeon operation which maps to `bfmmla` (#145038) 7a5af4f6b850 [BOLT] Gadget scanner: detect untrusted LR before tail call (#137224) 2e196a0ed14c [DOCS][BUILDBOT] Bump recommended worker version (#144853) 8b3e345002f3 [ADT] Clean up TinyPtrVector e8f85cf51fb9 [ArrayRef] Bring MutableArrayRef's constructor in line with ArrayRef d144eb1d8cd3 [Clang] Back out the source location workaround for CXXConstructExpr (#145260) 741e1ca3b331 [AMDGPU] upgrade test to use auto-generated llc checks (#145832) a16126844750 [InstCombine] Add test for freeze of GEP with recurrence offset (NFC) (#145541) e9e25f02e6e1 [mlir][vector] Restrict vector.insert/vector.extract to disallow 0-d vectors (#121458) d2ca10ab75bd [AArch64] Match indexed forms of fmul/fmla/fmls (#144892) 9903c1936a5d [-Wunterminated-string-initialization] Handle C string literals ending with explicit '\0' (#143487) 1b914e15cf21 [lldb][test] Remove debug code from TestCommandScriptAlias.py 249f074b2253 [BOLT][AArch64] Make gs-pacret-autiasp.s deterministic (#145527) d681c73a04bc [BOLT] Create marker for source changes in nfc-mode testing. (#142931) a8998fa06261 [mlir][vector][nfc] Move vector.splat test (#145699) 7289b6789ef3 [libc] Improve memcpy for ARM Cortex-M supporting unaligned accesses. (#144872) 0e268791c561 [SpeculativeJIT] Add missing include f070c74e3543 [AMDGPU][SDAG] Tests for target-specific ISD::PTRADD combines (#143672) 78b7f6a03d0f [Sema] Avoid deep recursion in AnalyzeImplicitConversions (#145734) c225d6dee011 [AMDGPU][SDAG] Handle ISD::PTRADD in SelectionDAGAddressAnalysis (#142778) 616816468bd2 [AMDGPU][SDAG] Add test for ISD::PTRADD handling in SelectionDAGAddressAnalysis (#142777) 215e61c08847 [AMDGPU][SDAG] Add ISD::PTRADD DAG combines (#142739) 28aa871dd434 AArch64: Remove AArch64MCExpr.h 8b55129d46c9 [llvm-debuginfo-analyzer] Fix incorrect REQUIRES in WebAssembly test case (#145848) 7e67307fea97 AArch64: Remove deprecated AArch64MCExpr::Specifier 402480325b4e [AMDGPU] More tests for S_WAIT_XCNT insertion (#145681) c91cbafad211 TargetLibraryInfo: Delete default TargetLibraryInfoImpl constructor (#145826) 418c5de19bbd PowerPC: Move PPCMCExpr into PPCMCAsmInfo 96ed2abadf90 [DebugInfo] Specify x86_64 triple for test (#145797) d46a69cab4e3 [PredicateInfo] Use BumpPtrAllocator for predicates (NFC) (#145692) 5fb0ae1a5b58 [LegacyPM] Remove unused getAdjustedAnalysisPointer() method (NFC) (#145738) 9ccf613b3426 [mlir][Transforms][NFC] Store per-pattern IR modifications in separate state (#145319) a98e01f3c5ab Regenerate newly added test fff720d6419b Triple: Forward declare Twine and remove include (#145685) 39bb67391567 Merge llvm/main into amd-debug c8243251cb25 [RISCV] Remove separate immediate condition codes from RISCVCC. NFC (#145762) a6e524276e2c [Modules] Add merged Files to UsedModuleFiles ce8f1600d042 [RISCV] Use SelectAddrRegRegScale for Xqcisls instructions. (#145608) 49847148d4b1 [BOLT] Fix density for jump-through functions (#145619) 4cb8308ee9cb AMDGPU: Avoid report_fatal_error for unsupported ds_ordered_count (#145172) 8b7fc6487d56 [llvm-debuginfo-analyzer] Fix crash with WebAssembly dead code (#141616) 3ee8dabcc016 [CMake] Fix for #144598: Move LLVM_ENABLE_LLVM_EXPORT_ANNOTATIONS backwards cca44e030ddd [RISCV] Explicitly check for supported opcodes in optimizeCondBranch. NFC (#145622) a440aa079dcc merge main into amd-staging b6bca4a3fd19 merge main into amd-staging (#2838) 5b5e95ceb8d6 [RISCV] Add more test cases for Xqcisls scaled load store instructions. NFC ae05dbbb04ef [NFC][AMDGPU] Add a test that can cause backend crash (#145777) 117ed65c0720 [clang-format][NFC] Remove a redundant check for null 25a6f7ae21cb merge main into amd-staging (#2837) 3f3282cee87f [AMDGPU] Adding AMDGPU dialect wrapper for ROCDL transpose loads. (#145395) e2cc82b1777c [NFC] [LowerAllowCheck] use InstIterator (#145817) 13e06403b4ed [GlobalISel] Remove dead code. (NFC) (#145811) 16e712e7c308 [NVPTX] Allow directly storing immediates to improve readability (#145552) 46c8cc7e5172 [libc] Enable all f16 math functions on the GPU (#145813) 2f9eee849f7d [RISCV] Implement intrinsics for XAndesVBFHCVT (#145634) 5f69f2e6513b merge main into amd-staging (#2833) 0529a346007c [clang][Preprocessor] Handle the first pp-token in EnterMainSourceFile (#145244) 63b14b3f2bf6 [RISCV] Add missing required features for Zvfbfmin intrinsics (#145646) 09b52653781f [RISCV] Decrease the capacity of SmallVector to 6. NFC. (#145650) 36fbc6a8d23c [MLIR][XeGPU] Remove the transpose attribute from Gather/Scatter ops and Cleanup the documents (#145389) 0faa181434cf [ORC] Extract MemoryAccess from ExecutorProcessControl, break up header. (#145671) d36b0f738261 merge main into amd-staging b413bea4355e [NFC] [sanitizer] get rid of references to fsanitize-top-hot (#145810) 967540bbd127 Revert "Non constant size and offset in DWARF (#141106)" c539ec0db53a [mlir][vector] Add support for vector extract/insert_strided_slice in vector distribution. (#145421) 2b2bd51f3b35 [flang][cuda] Inline this_grid call for cooperative groups (#145796) f63bc84b0d2a [lldb] Fix FindProcessImpl() for iOS simulators (#139174) 19797500d85c [NFC] [sanitizer] fix inaccurate comment (#145809) a5baf5302adf Add modified runtimes back to runtimes_to_{test|build} (#145805) 82cbd68504e6 [NFC][PGO] Use constants rather than free strings for metadata labels (#145721) 8ef76c7496b5 merge main into amd-staging 00f6d6ab66a7 [NFC][CodingStandard] Require``[[maybe_unused]]`` for unused variables in asserts (#142850) 3d5149062288 [RISCV] Fix typo in the description of xsfvfwmaccqqq. (#145771) e1f224b99a91 AMDGPU: Handle folding vector splats of inline split f64 inline immediates (#140878) 472c9141f9d0 AMDGPU: Fix tracking subreg defs when folding through reg_sequence (#140608) 7381d816f31c [lldb][NFC] remove the ResolveSDKPathFromDebugInfo method (#145744) ff0dcc461474 [MLIR][Linalg] Harden parsing Linalg named ops (#145337) ac29858e2d7f AMDGPU: Remove global_atomic_ordered_add_b64 from gfx1250 support (#145781) 79da5fecdb70 [CIR][NFC] Remove duplicate code (#145790) bd86fc925238 [libc] Error fixes for mbrtowc and wcrtomb (#145785) 17f91a26fff2 [AMDGPU] Add gfx1250 run lines to gfx12_dasm_vop3_dpp8.txt. NFC. (#145778) c72507d43149 [FIX] Add type definition into test case `clang/test/CodeGenOpenCL/builtins-amdgcn-gfx1250.cl` 38aec4f1f422 [DirectX] Limit GEP transformations to Arrays (#145758) a8ef75e75898 [DirectX] Strip `dx.rootsignatures` metadata during `dxil-prepare` (#145746) ce1c1a0e6d6b [AMDGPU] Add support for `v_cvt_pk_f16_bf8` on gfx1250 (#145753) ff23ee40d6af [AMDGPU] Add support for `v_cvt_pk_f16_fp8` on gfx1250 (#145747) 6fd182a3bb28 [RISCV] Support fixed vector vp.reverse/splice with Zvfhmin/Zvfbfmin. (#145596) e8abdfc88ffe [lldb] Make MCP server instance global (#145616) 2db0289abe17 [libc] Implemented wctomb (#145554) 695264590b9a merge main into amd-staging 0c359d747daa Revert "Move python binding tests to lit framework (#142948)" (#145774) 62f8281e0842 [IR][PGO] Verify invalid `MD_prof` metadata on instructions (#145576) fcbfff193e96 AMDGPU: Remove floating point dot4 and dot2 from gfx1250 support (#145751) bc905417d953 [libclang/python][NFC] Fix formatting in test_file (#145773) 4a31f7f8ea77 [ConstantFold] Special case atan +/-0.0 (#143962) 473f992c1f14 [AMDGPU] Add the support for `v_cvt_f32_bf16` on gfx1250 (#145632) ad0fba211cc9 [llvm] annotate remaining CodeGen and CodeGenTypes library interfaces for DLL export (#145361) f8b906ef0f7b [CIR][NFC] Sort the 'Misc' section of MissingFeatures (#145750) b6b08117bdb4 [AMDGPU] Simplify S_WAIT_XCNT insertion. NFC. (#145682) 7dfcced079e3 [clang][python][test] Move python binding tests to lit framework (#142948) 3b8ac7a22c64 [OpenMP] Fix various alignment issues (#142376) 5781d526ecf2 [llvm] annotate remaining ExecutionEngine, Frontend, and TargetParser interfaces for DLL export (#145367) 1abe1aa7b2b4 [llvm] annotate remaining Analysis library interfaces for DLL export (#145359) d9a7b1647984 InterlockedAdd_*, InterlockedAdd64_* support for AArch64 (#145607) aec88679db5f [OpenMP] avoid segv for a lock that has already been destroyed (#145625) 7aeb1a1fd8bd Fix Solaris buildbot (#145737) a75279e4a5b5 Revert "[mlir][OpenMP] Use correct debug location with link clause." (#145768) 1c56d101a214 [libc] Added isValidState to CharacterConverter class to ensure a provided mbstate is valid (#145564) 20f56d140909 [libc++abi] Fix C++ demangling for _BitInt type (#143466) c873e5f87d84 [mlir][TilingInterface] Handle multi operand consumer fusion. (#145193) 28f6f870617f [mlir] Migrate away from std::nullopt (NFC) (#145523) d760f9738787 [Clang] Implement diagnostics for why `std::is_standard_layout` is false (#144161) 70333de6cfa7 [NVPTX] Consolidate and cleanup various NVPTXISD nodes (NFC) (#145581) 5f8e7ed5a38c [mlir][linalg][nfc] Split hoisting tests into dedicated test functions (#145234) 369cbcc1a21a [lldb] include `LLVMTargetParser` in `LINK_COMPONENTS` (#145606) 626be98c3544 [mlir] Remove dependency on LinalgTransformOps.h from #144657 (#145749) 3b90597c2cea Non constant size and offset in DWARF (#141106) 487581b826a5 [lldb][darwin] force BuiltinHeadersInSystemModules to be always false (#144913) 357297c0f283 [bolt] Fix the build after 0556a2aa187b86c28a9441aec3e98b9780a2c9ee 1e45ea12db5e [CIR] Add support for function linkage and visibility (#145600) 1276a5b36849 [CIR] Upstream support for builtin_vectorelements (#144877) e4da49f0183b [CIR] Upstream __imag__ for ComplexType (#144262) 585ed213a859 [NFC][Clang][Preprocessor] Refine the implementation of isNextPPTokenOneOf (#145546) 0556a2aa187b [ArrayRef] Provide constructors from any type with a data() member (#145735) df79c40c988a [clang-tidy Fix a warning 2a35414e9888 [Transforms] Use range-based for loops (NFC) (#145252) 86026ee623cd [clang-tidy] Warn about misuse of sizeof operator in loops. (#143205) 532c15a718d1 [mlir][linalg] Fix module dependency issue due to unused import (#145727) b4f4af7ebb91 [flang][OpenMP] Verify that N in -fopenmp-version=N is valid (#145725) 5a194c1fd97b [msan] Sharpen instrumentation of Intrinsic::{ctlz,cttz} (#145609) 9b307ebdd051 [bazel] Update deps from #144657 (#145726) dd47b845a62c [clang-format] Handle Trailing Whitespace After Line Continuation (P2223R2) (#145243) 9a7720ad2f96 [CIR] Upstream __real__ for ComplexType (#144261) 3e337bc30802 [Offload] Add a stub unloadBinaryImpl for host device (#145716) 029823a84de9 [Clang][NFC] Clean up OpenMP offload toolchain generation (#145549) a76448c27de2 [Clang] Fix replaceability/relocatability computation (#145655) c92b580d6308 [mlir][ArmSME] Remove `ConvertIllegalShapeCastOpsToTransposes` (#139706) c08502defe47 [MLIR][Transform] expose transform.debug extension in Python (#145550) 46ee7f1908f4 [libclc] Avoid out-of-range float-to-int. (#145698) 8202c94cec41 [CostModel][X86] getMaskedMemoryOpCost - widening masks must compute the cost of the full width insert_subvector across multiple legal vectors (#145693) 81e07996aa8b [AMDGPU][SIInsertWaitcnts] don't crash when printing messages at end of block (#145694) 60285d98efa6 [asan] Implement address sanitizer on AIX: build configuration (#139583) c3b160bcaa7d [RISCV] Remove -mattr=+no-rvc-hints (#145138) 2dfcc30e3800 [AArch64] Add tests for inefficient LD1lanePost. NFC 77a3ae5845da [flang][OpenMP] Remove recognition of versions 3.0 and older (#145708) 287b24e1899e [asan] Implement address sanitizer on AIX: address descriptions (#138891) ea1e18157133 [MLIR][AArch64] Lower `vector.contract` with mixed signed/unsigned arguments to Neon FEAT_I8MM (#144698) 36819eaed124 [llvm-objdump] Support --symbolize-operand on AArch64 6bc708728735 merge main into amd-staging (#2826) 10edc3df99f7 [RISCV] Try to optimize `vp.splice` to `vslide1up`. (#144871) 020fefb6af01 AMDGPU: Avoid report_fatal_error in image intrinsic lowering (#145201) 75de95ddd28f [Option] Use llvm::interlaved (NFC) (#145642) 817c097887e0 [Analysis] Drop const from a return type (NFC) (#145641) 050f6283eeaa [AMDGPU] Drop const from return types (NFC) (#145640) fb6882719a51 Triple: Remove workaround for gcc 4.0.3 (#145660) c9910d5ef8b7 [LangRef] Clarify definition of fragments (#145582) 096cad59dff5 [Serialization] Fix a warning ae947567ae6f merge main into amd-staging (#2824) b8e8ff3dd669 [Clang] Implement diagnostics for why is_empty is false (#145044) a945fb1481e0 [clang] NFC, move the SourceLocationEncoding.h header guard to the begining of the file e64f5dd94847 Revert "[clang][dataflow] Expose simple access to child StorageLocation presence." (#145710) b8bda9d446e7 [clang][analyzer] Correctly handle lambda-converted function pointers (#144906) 022e1e99f3b0 [mlir][memref]: Fix Bug in GlobalOp Verifier (#144900) d76fdf7f536c [clang-c] introduce queries on GCC-style inline assembly statements (#143424) fd3cc204de96 [SelectionDAG] Fold undemanded operand to UNDEF for VECTOR_SHUFFLE (#145524) 41457bc9d2b5 [NFC][AsmPrinter] Rework/add comments (#145587) 2bf0ff3254a9 [X86] var-permute-256.ll - add missing check prefixes for AVX512F/DQ only targets 0870c8838ba2 [Offload] Add an `unloadBinary` interface to PluginInterface (#143873) e90ab0e34277 [Serialization] Remove delta encoding optimization (#145670) 183ff08b32ff [libclc] Add missing deps for LLVM_ENABLE_RUNTIMES. (#145684) e99d8bb0dcc5 [PowerPC] eliminate RLWINM instruction following LBARX as possible (#144089) 31bf9348fa10 [MLIR][NVVM] Add an explicit mask operand to elect.sync (#145509) 77618a9253d2 Delete copy constructor/assignment; NFC (#145689) 01174ff2babe Remove unneeded checks for null; NFC (#145686) d16f42d1e227 [mlir][linalg] Constrain the parameters m, r in Winograd ops (#144657) 4bb5e48fb933 [LoongArch] Add codegen support for ILP32D calling convention (#141539) d7b936b633f3 [OpenMP] Add directive spellings introduced in OpenMP 6.0 (#141772) 006037675c10 [mlir][OpenMP] Use correct debug location with link clause. (#145026) 3ef796b981f1 [Clang] Diagnose unsatisfied `std::is_assignable`. (#144836) d3ed84ed6717 [Utils][mlir] Fix interaction between CodeExtractor and OpenMPIRBuilder (#145051) 2db3cc4f3470 [AArch64][CostModel] Lower cost of dupq (SVE2.1) (#144918) bb7242477c2f [MC] Use StringTable to reduce dynamic relocations (#144202) 8231dd71cb7d [flang][OpenMP] Skip runtime mapping with no offload targets (#145594) 7ff0d28f2e1a Triple: Remove redundant member initializers (#145661) daedad8b3d56 merge main into amd-staging 7fcd2ca2efc7 [lldb-dap][test] Import skipIfAsan decorator c941bee75d25 [lldb] Fix qEcho message handling. (#145675) 97fdc237ddda [NFC] [Modules] Adding profiling points to template lookups in serializer 8e4fb4beada4 [IA] Remove recursive [de]interleaving support (#143875) 14e280e44e05 [lldb-dap][test] Skip TestDAP_runInTerminal/TestDAP_restart_runInTerminal on ASAN 0036beeeefd1 [bazel] Port e175ecff936287823b5443d7b2d443fc6569f31f 46b97a836a89 Fix signed/unsigned comparison warning. NFC. 62d36857b542 RuntimeLibcalls: Cleanup darwin bzero configuration (#145639) 9e8152b51491 RuntimeLibcalls: Cleanup darwin exp10 case (#145638) b991b21874ed Triple: Add BridgeOS to isOSDarwin (#145636) acab82b4c344 Regen CodeGen/AMDGPU/global-load-xcnt.ll 54953b922d11 Handle vendor string in match for clang version string (#145612) 630d55cce45f [AsmPrinter] Always emit global equivalents if there is non-global uses (#145648) 892a263106af [flang] Add release note for compiler-rt dependency on AArch64 (#145547) 6f47f4b9e58f [MIPS][MSA] compare_float.ll - regenerate checks 9fde72e72987 [AArch64] Use `-filetype=null` in test (NFC) (#145662) 992f0d12255a [Clang][SPIRV][AMDGPU] Override `supportsLibCall` for AMDGCNSPIRV (#143814) eeb206d688b7 [SystemZ] vec-max-min-zerosplat.ll - regenerate checks a8a2c6fa882d [BOLT] Gadget scanner: fix LR to be safe in leaf functions without CFG (#141824) 36a060a4e51b [ORC] Sink DynamicLibrary.h header include into ExecutorProcessControl.cpp. d223832a5888 [TableGen] Use getValue instead of getInt for enum attributes (#144030) 1060d8910f12 [TTI] improveShuffleKindFromMask - pull out repeated Mask.size() calls. NFC. 4efb61850b59 [C++20] [Modules] Handling template declare with debug info 22ee837ec0ae [flang][NFC] do not copy fields in fir::RecordType::getTypeList (#145530) 5d2ece14378e [X86] Allow znver3/4/5 targets to use double-shift instructions by default (#132720) 3a3d1bf4a39b [lldb][AArch64] Handle core file tag segments missing tag data (#145338) 97b8cec789fe [lldb][lldb-dap] Skip runInTerminalWithObjectEnv test on Windows 20a72083fdff [BOLT] Gadget scanner: improve handling of unreachable basic blocks (#136183) 29f8dca0853c [bazel] Add missing dependency for e93a0d0d1ed790173e23247fa2833cdac30b8268 32febe60f364 [PowerPC] Support for Packed BCD conversion builtins (#142723) 0f01cd528914 [X86][GlobalIsel] support G_FABS (#136718) f2f4b557aa7a [libc++] P2944R3: Constrained comparisions - `variant` (#141396) 88297cca8f8c [AMDGPU] Correct -mcpu processor name in test (#145493) d0469d1d3c31 [mlir] Move WalkResult to Support (#145649) ad87d951c94f [clang] Fix __builtin_mul_overflow for big _BitInts (#145497) ecff028a9662 [LV] Update test after 4ac4726d00. 3b251cd675fb [MLIR] Legalize certain `vector.transfer_read` ops of scalable vectors (#143146) 4f9adb688941 [mlir][vector] Relax operand type restrictions for `vector.splat` (#145517) 17c5c19902a8 [Verifier] Always verify all assume bundles. (#145586) 4ac4726d0064 [VPlan] Format some print forms.NFC (#144644) d12fb1fc3714 [WebAssembly] Refactor PerformSETCCCombine (#144875) d32239b461ed [ORC] Move UnsupportedExecutorProcessControl into unittests. aeaf319b8c22 [flang] avoid useless rebox of polymorphic scalars (#145507) 31545ca5f467 [Docs] Incorporate the recent discussed changes to release process (#145285) 237b8de2c0d9 [IfConversion] Fix bug related to !HasFallThrough (#145471) 7c38ee26d441 [FunctionAttrs][IR] Fix memory attr inference for volatile mem intrinsics (#122926) 5238f06f7234 [IfConversion] Pre-commit testcase for !HasFallThrough bug. NFC 956bab0381e9 [TSan] Add 2 test cases related to incomplete shadow cleanup in unmap (#145472) 4f4e4b547720 merge main into amd-staging d95f46ca84d7 [IR] Fix incorrect writeonly on llvm.allow.ubsan/runtime.check (#145492) 01b288fe6a1e [clang-format] Improve QualifierAlignment in guessing macros (#145468) 34bfa4e7898c [RISCV] Fix incorrect chapter number in comment in RISCVSchedSiFive7.td. NFC. c3c923c8d62c [X86][GlobalISel] Enable SINCOS with libcall mapping (#142438) 6f186bdd8808 merge main into amd-staging (#2819) a0ce3e691c19 [C++20] [Modules] Avoid crash with calls to (this auto) syntax 0512d119fdf0 [lldb] Clean up GDBRemoteCommunication::StartDebugserverProcess (#145021) 888f84f72c07 [ARM] Return the correct chain when expanding READ_REGISTER (#145237) 13a9b86f6279 [NFC][libclc] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNARY_BUILTIN macros (#145458) 2550a637a127 AMDGPU: Remove LDS-direct(param)-loads and VINTERP ops from gfx1250 support (#145631) 494a74882b26 Reapply "ELF: Add branch-to-branch optimization." 08b8d467d425 [AMDGPU][GFX1250] Insert S_WAIT_XCNT for SMEM and VMEM load-stores (#145566) deb346419264 [RISCV] Add Tied operands in Xqcicm instructions and changes to handle a single tied operand in source DAG and instruction (#145538) 7ccc59143136 Merge llvm/main into amd-debug 901e1390c977 [SelectionDAG] Remove UnsafeFPMath check in `visitFADDForFMACombine` (#127770) 948cc91188e5 Reapply "[Win/X86] Make _m_prefetch[w] builtins to avoid winnt.h conflicts (#115099)" (#138360) 77af8bff97a0 [mlir]Moves the StateStack to IR folder from Support folder. (#145598) 505906bff6dd [AMDGPU][True16][CodeGen] do not legalize t16 operand during user scan (#145450) c85466dcd485 Reapply "[msan] Automatically print shadow for failing outlined checks" (#145611) (#145615) 7269d1d6b4fd merge main into amd-staging 3de2af3ef56c AMDGPU: Remove export and related instructions from gfx1250 support (#145624) 215b12f963b1 Merge llvm/main into amd-debug 30922f740e47 Move relocation specifier constants to AArch64:: ed5f8f238d68 [LLVM][DecoderEmitter] Add option to use function table in decodeToMCInst (#144814) f608716b0986 [LLVM][TableGen] Minor cleanup in CGIOperandList (#142721) dbb3e7d1162d [clang] Register all LLVM targets in AllClangUnitTest main (#144428) 3140333872f6 [-Wunsafe-buffer-usage] Support span creation from std::initializer_list and begin/end pairs (#145311) e6d6bb52980e AMDGPU: Remove s_waitcnt from gfx1250 support (#145620) c0a362a09c1a Merge llvm/main into amd-debug d362b43a1f12 merge main into amd-staging (#2811) c04e804a3117 [lldb] Eliminate check for HasLoadedSections (NFC) (#145366) a451fff1ad43 [llvm] fix extern cl::opt definitions for DLL export (#145374) e93a0d0d1ed7 [HLSL][RootSignature] Add `fdx-rootsignature-version` option to specify root signature version (#144813) 52fbefb281ea [clang][clang-scan-deps] Add named modules to format 'experimental-full' (#145221) 87ce754e9847 [llvm] annotate remaining BinaryFormat and DebugInfo library interfaces for DLL export (#145364) 3574560b6b3c [llvm] annotate remaining Support and ADT library interfaces for DLL export (#145354) 5ae00a7ce228 [llvm] annotate remaining Telemetry and ToolDrivers interfaces for DLL export (#145369) c84d620d4d3f [llvm] annotate WindowsDriver and WIndowsManifest interfaces for DLL export (#145567) f37d944152ab [AArch64][SME] Use reportFatalUsageError rather than assert (NFC) (#145491) 5eb5f0d8760c Revert "[msan] Automatically print shadow for failing outlined checks" (#145611) d06c2efd67e5 [AMDGPU] Support v_lshl_add_u64 in gfx1250 (#145591) 51d1385cdf5e [clang Dependency Scanning] Enhance File Caching Diagnostics (#144105) 48a21e69159a [RISCV] Fix a correctness issue in optimizeCondBranch. Prevent optimizing compare with x0. NFC (#145440) 32451484113e Merge llvm/main into amd-debug 9702d37062a3 [RISCV] Support scalable vector vp.reverse/splice with Zvfhmin/Zvfbfmin. (#145588) 9e3bb5bb91ce Reland "[lldb] Add count for number of DWO files loaded in statistics #144424" (#145572) 46d33b6102f2 [AMDGPU][MC] Allow dpp in v_pk_fmac_f16 for GFX9 and GFX10 (#144782) 1b71ea411a9d [msan] Automatically print shadow for failing outlined checks (#145107) 6bab2c50d68d [Comgr][NFC] Update comment for logging APIs a93eb14e8588 [LTO][Legacy] Add new C APIs to query undefined symbols in assembly (#145413) 0a3c5c42a178 Add support for Windows Secure Hot-Patching (redo) (#145565) ebdd5a04f5d6 AMDGPU: Add checks to verify that gfx1250 no longer supports vimage instructions (#145602) 7e3af676312b [lldb] Add more tests MCP protocol types 770d0b028aa8 [DirectX] Fix order of `v2::DescriptorRange` (#145555) fe8a26263a12 AMDGPU: Remove Formatted MUBUF instructions from gfx1250 support (#145590) aa3c5d0297e4 Revert "[lldb][RISCV] fix LR/SC atomic sequence handling in lldb-server" (#145597) 830b2c842e78 [LV] Replace redundant ExtractLastElement of reduction result (NFC). 40bbfd3b28c3 Merge llvm/main into amd-debug 405ed40b9181 merge main into amd-staging 3a71884ab1a5 [flang][OpenMP] Map device pointers on host device as well (#145562) 3413aa83f356 Revert "[AMDGPU] Implement IR variant of isFMAFasterThanFMulAndFAdd (… (#145580) e615544e2bd1 [mlir][EmitC] Add pass to wrap a func in class (#141158) e1cd450c8f7c [NVPTX] fold movs into loads and stores (#144581) 3187d4da24ad [Verifier] Add additional tests for dereferenceable assumptions. c3e25e7fc463 [VPlan] Add VPInst::getNumOperandsForOpcode, use to verify in ctor (NFC) (#142284) b171ebbfffcd [lldb] Defend against infinite recursion in GetClassDescriptor (#145396) 2b5141189f7b [bazel] Add missing comma to BUILD.bazel (#145573) fe0568389d68 [AMDGPU] Require aligned VGPRs for gfx1250 (#145561) f624ba2d9d21 [OpenMP][clang] 6.0: parsing/sema for num_threads 'strict' modifier (#145490) 4d21da002a05 [mlir] Return vectorized values instead of replacing (#144158) 280f60ed6d99 [CIR] Fix NYI AAPCS bit-fields by skipping unsupported case (#145560) f875bab8ecee [HeterogeneousDwarf] Sync with amd-staging and update tests (#2713) ce4d21494764 AMDGPU: Remove MTBUF instructions from gfx1250 support (#145563) 6e1ed0f1b153 Merge llvm/main into amd-debug cd46354dbd10 [WebAssembly] Enable a limited amount of stackification for debug code (#136510) de569ad6b845 [bazel] Add //mlir:IR to Support for #144897 (#145569) 5ff6c8e84372 [RISCV] Add Zvfh scalable vector vp.splice tests. NFC b8ea65025dc6 [clang-doc] document global variables (#145070) 4a682e16f54d merge main into amd-staging (#2799) de2ec228c03c [analyzer] Fix crash when modelling 'getline' function in checkers (#145229) 9e33cb22f991 Fix `pragma-comment.c` test failing on false match (#145455) 52fee553a541 [DWARF] Fix redundant DW_AT_ prefix in HANDLE_DW_AT definition for `INTEL_other_endian` (#145336) ffdfe94a2b41 [bazel] Add //mlir:DialectUtils to TestTransforms for #145376 (#145557) 21423c7fdcee [DirectX] Make firstbithigh intrinsic use first arg as overload type (#145401) 52b27c2bd627 [libc++] Refactor basic_filebuf::overflow() (#144793) 23b0564800f6 [lldb] Fix AppleObjCDeclVendor for classes which have no methods (#145452) 0b8f3cc6b7dc [libc++] Fix no-localisation CI failure on (#145213) 90828e00a09c [CIR] Restore the underscore in dso_local (#145551) 8f7f48a97ea5 [flang][OpenMP][NFC] remove globals with mlir::StateStack (#144898) c74ed8a0d3ca [AMDGPU][Scheduler] Support for rematerializing SGPRs and AGPRs (#140036) 09b43a5a862f [clang][dataflow] Expose simple access to child StorageLocation presence. (#145520) 2b938769c60f [X86][CodeGen] Add Scheduling Model for LNL-P (#139446) f8ed45611b75 Remove PSTL from the top-level monorepo (#143717) 8763d2968d47 [CIR] Add support for bitfields in unions (#145096) 9291ad1c9691 [CIR] Add support for __builtin_expect (#144726) 4b4782bc868b Revert "Add support for Windows Secure Hot-Patching" (#145553) 0c50971460cb [mlir] Walk nested non-symbol table ops in symbol dce (#143353) 418b409df853 [CIR] Add support for member initialization from constructors (#144583) 7150b2c76a71 [RISCV] Optimize vp.splice with 0 offset. (#145533) 0e9e1ce14625 [analyzer][NFC] Make SymExpr::classof methods constexpr (#145526) 1ae786da8e48 [HeterogeneousDwarf] Sync with amd-staging and update tests 8b0d112478ce [Clang][Preprocessor] Expand UCNs in macro concatenation (#145351) 353f75410a19 [LLDB] Add SI_USER and SI_KERNEL to Linux signals (#144800) 7377410ddaf2 [FuzzMutate] Properly handle intrinsics and avoid illegal code genertion (#145495) f18cfb9108fd [InstrProf] Factor out getRecord() and use NamedInstrProfRecord (#145417) 3bc1fc649324 [lldb][RISCV] fix LR/SC atomic sequence handling in lldb-server (#127505) 7d2293d1d953 [InstCombine] KnownBits::isNonNegative should recognize `b - a` after `a <= b` (#145105) a84891698a2a [instcombine] Scalarize operands of vector geps if possible (#145402) cb4fb3aa1888 [NFC] Move areCompatibleSveTypes etc. from ASTContext to SemaARM. (#145429) cc756716cf69 [mlir][NFC] Move LLVM::ModuleTranslation::SaveStack to a shared header (#144897) 410b5cd787de Merge llvm/main into amd-debug f6973baf289a [BOLT][NFC] Split out parsePerfData (#145248) 85d250c96ee1 Use the Windows SDK arguments over the environment (#144805) d80766152c49 [libc++] Fix bitset conversion functions and refactor constructor (#121348) 46ada0d91bec [Comgr] Remove deprecated action from tests fcd82f9cf3b6 MathExtras: Make some templates constexpr NFC (#145522) c8a9579ff9f6 [mlir][xegpu] Add support for distributing `gpu.barrier` (#145434) 70bedc74b91a [CIR] Upstream ChooseExpr for ComplexType (#145163) b3c53025aa16 [CIR][NFC] Merge vector type invalid tests and update names (#145238) 26d318e4a943 Add support for Windows Secure Hot-Patching (#138972) e175ecff9362 [llvm] revisions to `LLVM_ABI` export macro definitions (#144598) 6a8899cee713 [HLSL][RootSignature] Enable resource range analysis for remaining `RootElement`s (#145109) b0c63071fb92 Port #140158 whilst upstream review continues (#2701) 559218f7ee78 [NFC][LLVM][SVE2p2] Add RUN lines to fully verify codegen predicates. da5c442550a3 Reland "[llvm-cov] Export decision coverage to output json (#144335)" (#145325) bb2bd5fb01c1 Revert "[mlir] Improve mlir-query by adding matcher combinators" (#145534) 4359e55838cd [Offload] Properly report errors when jit compiling (#145498) b0ef9125347c Revert "[mlir][mesh] adding option for traversal order in sharding propagation" (#145531) 43d042b350af Revert "[clang][scan-deps] Add option to disable caching stat failures" (#145528) 469cbd454389 merge main into amd-staging b581f9d056ba [HLSL] Add option for VK layouts (#145327) 4847bd5ae40d [mlir][acc] Add support for data clause modifiers (#144806) 117c76ac01e3 Merge llvm/main into amd-debug 2767ff49955f [CIR][NFC] Upstream computeVolatileBitfields (#145414) fba63e3281e7 [NFC][TableGen] Use ArrayRef instead of const vector reference (#145323) 12ba75145efe [NFC][LLVM][SME] Seperate streaming mode only intrinsic tests. bd96918f01cf [LLVM][Support][Cygwin] Add threading support for Cygwin host (#145314) 7a4b3925598c [Support] Remove an outdated MinGW workaround (#145294) 08513281bd14 [BOLT][test] Drop toolname from X86/perf2bolt-spe.test (#145515) 63f30d7d820c [mlir] Migrate away from {TypeRange,ValueRange}(std::nullopt) (NFC) (#145445) 6dad1e87fb7a [mlir][transform][Linalg] NFC - DCE unused options in PadTilingInterfaceOptions 8fec6d11777a llvm-c: Introduce 'LLVMDISubprogramReplaceType' (#143461) 68f09370f99f [Module] Use getDeclarationIfExists() (NFC) 75cf82684971 [KeyInstr][Clang] Fix atomic ops atoms test b77c7138a872 [lld][BP] Fix duplicate section size measurment (#145384) 3e98d2b0311e [lldb] Fix windows build for #145293 9186df9b088f [InlineCost] Simplify extractvalue across callsite (#145054) e04c938cc08a [analyzer][NFC] Add xrefs to a test case that has poor git blame (#145501) 6fe8543a2a15 [analyzer][docs] Mention perfetto for visualizing trace JSONs (#145500) db4dc88d06a5 [X86] combineEXTRACT_SUBVECTOR - remove unnecessary bitcast handling. (#145496) ddc6dca2f20f Merge llvm/main into amd-debug 9f3931b659f6 [AMDGPU] Fold fmed3 when inputs include infinity (#144824) 478583214410 [Offload] Fix cmake warning (#145488) 9aebfde1e70c [flang] Allow `cycle` in `target teams distribute [simd]` (#145462) 352baa386c10 [RemoveDIs] Resolve RemoveRedundantDbgInstrs fwd scan FIXME (#144718) 825ad86aea50 [DAG] Fold nested add(add(reduce(a), b), add(reduce(c), d)) (#115150) db72f6cbe634 [RemoveDIs][NFC] Remove dbg intrinsic handling code from AssignmentTrackingAnalysis (#144674) 8f4da2cbf055 [mlir][affine] Fix min simplification in makeComposedAffineApply (#145376) 1dc46d45fcf7 [RemoveDIs] Fix rotten --implicit-check-not lines (#144711) ddecfa696c49 [KeyInstr][Clang] Atomic ops atoms (#141624) fa5d7c926f5f [lldb][lldb-dap] Fix runInTerminal test program on Windows b8769104f1ef [LAA] Address follow-up suggestions for #128061. 1a264b0ad80d Merge llvm/main into amd-debug 650b1aeebcc0 Merge llvm/main into amd-debug 1345ebe538be Merge llvm/main into amd-debug 4a2fe9f27eaa Merge llvm/main into amd-debug 8a9f87ae4b0a Merge llvm/main into amd-debug 9dfbc0fdd44f Merge llvm/main into amd-debug 70f4831afe38 Merge llvm/main into amd-debug 747f3ee87f91 Merge llvm/main into amd-debug 4254168a99c8 Merge llvm/main into amd-debug cf2c577ab085 Merge llvm/main into amd-debug 2cdffed73491 Merge llvm/main into amd-debug 15f67a54aa09 Merge llvm/main into amd-debug 3a3ed2fd97ec Merge llvm/main into amd-debug 9ccb2911a595 Merge llvm/main into amd-debug eadabc9da156 Merge llvm/main into amd-debug 9bbc3fde50a3 Merge llvm/main into amd-debug 0986883e851f Merge llvm/main into amd-debug fdac2dc3e48f Merge llvm/main into amd-debug 0b89fb6f39dc Merge llvm/main into amd-debug 46b09acf8305 Merge llvm/main into amd-debug e39db390ff8b Merge llvm/main into amd-debug fc55abd89359 Merge llvm/main into amd-debug 3474df1a036e Merge llvm/main into amd-debug 7df99d54b589 Merge llvm/main into amd-debug 366b77707a04 Merge llvm/main into amd-debug b998a63efb8c Merge llvm/main into amd-debug 95bef3d7e2f6 Merge llvm/main into amd-debug 8d0bc8fe619d Merge llvm/main into amd-debug b5ed79793bba Merge llvm/main into amd-debug ce4e3c273019 Merge llvm/main into amd-debug d342b9af1e22 Merge llvm/main into amd-debug 082da87f544c Merge llvm/main into amd-debug 5a4777092703 Merge llvm/main into amd-debug fbccea81bd78 Merge llvm/main into amd-debug 3487fa14673a Merge llvm/main into amd-debug 681a25b2ce97 Merge llvm/main into amd-debug 0ccc64d91f0d Merge llvm/main into amd-debug 670172fbad90 Merge llvm/main into amd-debug 8612d7cfe104 Merge llvm/main into amd-debug ae7abf56f2a9 Merge llvm/main into amd-debug c5a8fbb19206 Merge llvm/main into amd-debug b93bb66ea606 Merge llvm/main into amd-debug 838a01eed273 Merge llvm/main into amd-debug 70245f929b63 Merge llvm/main into amd-debug 75402d1787d3 Merge llvm/main into amd-debug c60f83b8398e Merge llvm/main into amd-debug 9c82511e6301 Merge llvm/main into amd-debug 24117b9e71bd Merge llvm/main into amd-debug 2626c9c24de6 Merge llvm/main into amd-debug 92eb39edd3bd Merge llvm/main into amd-debug e450ca8f9280 Merge llvm/main into amd-debug 4647974cc553 Merge llvm/main into amd-debug 5117cba3aec2 Merge llvm/main into amd-debug 85d609540f71 Merge llvm/main into amd-debug b184a2d7561b Merge llvm/main into amd-debug 7c7afe3b1e18 Merge llvm/main into amd-debug 2e6346c5dc2a Merge llvm/main into amd-debug 3cd2da974633 Merge llvm/main into amd-debug 16051b608dc3 Merge llvm/main into amd-debug 6db01f1f1ed5 Merge llvm/main into amd-debug 56c35ee52d05 Merge llvm/main into amd-debug 8629854c7ca7 Merge llvm/main into amd-debug eab7353c2ac5 Merge llvm/main into amd-debug 7499660c065e Merge llvm/main into amd-debug faa72dce78a2 Merge llvm/main into amd-debug e9d566650336 Merge llvm/main into amd-debug f52ee1afd65a Merge llvm/main into amd-debug 4fe7a37e9d09 Merge llvm/main into amd-debug 11fd1ab11a8d Merge llvm/main into amd-debug e8a0817a5071 Merge llvm/main into amd-debug 5cfc4769e3e6 Merge llvm/main into amd-debug 7e1626624ebc Merge llvm/main into amd-debug 46ed5eb4c789 Merge llvm/main into amd-debug c07a39b4382c Merge llvm/main into amd-debug d0bf5b22e242 Merge llvm/main into amd-debug ca7a15639746 Merge llvm/main into amd-debug git-subtree-dir: external/llvm-project git-subtree-split: 659e9cd047321f679ad8fc0587edec71eb3bd0db --- .ci/compute_projects.py | 1 + .ci/compute_projects_test.py | 12 +- .ci/monolithic-linux.sh | 25 +- .ci/monolithic-windows.sh | 8 +- .github/copilot-instructions.md | 4 + .github/new-prs-labeler.yml | 4 + .github/workflows/hlsl-test-all.yaml | 4 +- .../libcxx-restart-preempted-jobs.yaml | 97 +- amd/comgr/include/amd_comgr.h.in | 6 - amd/comgr/src/comgr-compiler.cpp | 23 +- amd/comgr/test-lit/CMakeLists.txt | 5 +- .../compile-minimal-test-cached-bad-dir.cl | 2 +- .../compile-minimal-test-cached-bad-policy.cl | 2 +- .../compile-minimal-test-cached.cl | 16 +- amd/comgr/test-lit/comgr-sources/common.h | 11 + ...inimal-test.c => compile-opencl-minimal.c} | 12 +- .../test-lit/comgr-sources/data-action.c | 129 + .../test-lit/comgr-sources/get-version.c | 25 + .../test-lit/comgr-sources/status-string.c | 42 + amd/comgr/test-lit/compile-minimal-test.cl | 2 +- amd/comgr/test-lit/compile-opencl-2.cl | 12 + amd/comgr/test-lit/data-action.c | 2 + amd/comgr/test-lit/get-version.c | 2 + amd/comgr/test-lit/status-string.c | 2 + amd/comgr/test-lit/time-statistics.cl | 2 +- amd/comgr/test/CMakeLists.txt | 1 - ...mpile_source_with_device_libs_to_bc_test.c | 28 +- ...rce_with_device_libs_to_bc_with_vfs_test.c | 28 +- amd/comgr/test/options_test.c | 66 - bolt/include/bolt/Core/BinaryContext.h | 10 +- bolt/include/bolt/Core/BinarySection.h | 5 - bolt/include/bolt/Core/MCPlusBuilder.h | 2 +- bolt/include/bolt/Profile/DataAggregator.h | 6 +- bolt/include/bolt/Rewrite/RewriteInstance.h | 6 + bolt/lib/Core/BinaryFunction.cpp | 5 +- bolt/lib/Passes/BinaryPasses.cpp | 33 +- bolt/lib/Passes/Instrumentation.cpp | 3 +- bolt/lib/Passes/PAuthGadgetScanner.cpp | 220 +- bolt/lib/Profile/DataAggregator.cpp | 149 +- bolt/lib/Rewrite/RewriteInstance.cpp | 436 +- .../Target/AArch64/AArch64MCPlusBuilder.cpp | 42 +- bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp | 19 +- bolt/lib/Target/X86/X86MCPlusBuilder.cpp | 91 +- bolt/test/X86/zero-density.s | 32 + .../AArch64/gs-pacret-autiasp.s | 105 +- .../AArch64/gs-pauth-authentication-oracles.s | 20 - .../binary-analysis/AArch64/gs-pauth-calls.s | 84 + .../AArch64/gs-pauth-debug-output.s | 32 +- .../AArch64/gs-pauth-signing-oracles.s | 27 - .../AArch64/gs-pauth-tail-calls.s | 597 ++ bolt/test/code-at-high-address.c | 24 + bolt/test/perf2bolt/X86/perf2bolt-spe.test | 2 +- bolt/test/program-header.test | 14 + bolt/unittests/Core/BinaryContext.cpp | 32 +- bolt/unittests/Core/MemoryMaps.cpp | 16 +- bolt/utils/llvm-bolt-wrapper.py | 2 +- bolt/utils/nfc-check-setup.py | 39 + clang-tools-extra/clang-doc/BitcodeReader.cpp | 236 +- clang-tools-extra/clang-doc/BitcodeReader.h | 7 + clang-tools-extra/clang-doc/BitcodeWriter.cpp | 75 +- clang-tools-extra/clang-doc/BitcodeWriter.h | 18 +- clang-tools-extra/clang-doc/HTMLGenerator.cpp | 6 + .../clang-doc/HTMLMustacheGenerator.cpp | 3 + clang-tools-extra/clang-doc/JSONGenerator.cpp | 287 +- clang-tools-extra/clang-doc/MDGenerator.cpp | 8 + clang-tools-extra/clang-doc/Mapper.cpp | 6 + clang-tools-extra/clang-doc/Mapper.h | 1 + .../clang-doc/Representation.cpp | 32 + clang-tools-extra/clang-doc/Representation.h | 33 +- clang-tools-extra/clang-doc/Serialize.cpp | 81 + clang-tools-extra/clang-doc/Serialize.h | 4 + clang-tools-extra/clang-doc/YAMLGenerator.cpp | 2 + .../ClangTidyDiagnosticConsumer.cpp | 19 + .../clang-tidy/ClangTidyDiagnosticConsumer.h | 10 + .../MisleadingSetterOfReferenceCheck.cpp | 2 + .../bugprone/SizeofExpressionCheck.cpp | 38 +- .../bugprone/SizeofExpressionCheck.h | 1 + .../MissingStdForwardCheck.cpp | 11 +- .../MissingStdForwardCheck.h | 7 +- .../ProBoundsPointerArithmeticCheck.cpp | 16 +- .../ProBoundsPointerArithmeticCheck.h | 3 + .../RvalueReferenceParamNotMovedCheck.cpp | 8 +- .../RvalueReferenceParamNotMovedCheck.h | 1 + .../misc/ConfusableIdentifierCheck.cpp | 235 +- .../misc/ConfusableIdentifierCheck.h | 25 +- .../UnconventionalAssignOperatorCheck.cpp | 7 +- .../clang-tidy/modernize/CMakeLists.txt | 1 + .../modernize/ModernizeTidyModule.cpp | 3 + .../modernize/UseScopedLockCheck.cpp | 311 + .../clang-tidy/modernize/UseScopedLockCheck.h | 54 + .../RedundantInlineSpecifierCheck.cpp | 7 +- clang-tools-extra/clangd/AST.cpp | 2 +- clang-tools-extra/clangd/InlayHints.cpp | 51 +- .../clangd/refactor/tweaks/DefineInline.cpp | 2 +- .../refactor/tweaks/ExtractVariable.cpp | 6 +- clang-tools-extra/clangd/tool/ClangdMain.cpp | 10 +- .../clangd/unittests/CodeCompleteTests.cpp | 30 + clang-tools-extra/docs/ReleaseNotes.rst | 35 + .../checks/bugprone/sizeof-expression.rst | 9 + .../cppcoreguidelines/missing-std-forward.rst | 7 + .../rvalue-reference-param-not-moved.rst | 4 + .../docs/clang-tidy/checks/list.rst | 1 + .../checks/modernize/use-scoped-lock.rst | 101 + .../docs/clangd/DeveloperDocumentation.rst | 2 +- clang-tools-extra/modularize/Modularize.cpp | 4 +- .../test/clang-doc/json/class-template.cpp | 2 +- .../test/clang-doc/json/class.cpp | 47 +- .../test/clang-doc/json/function-requires.cpp | 2 +- .../test/clang-doc/json/method-template.cpp | 2 +- .../test/clang-doc/json/namespace.cpp | 46 +- .../test/clang-doc/json/nested-namespace.cpp | 36 + .../clang-tidy/checkers/Inputs/Headers/mutex | 33 + .../checkers/bugprone/sizeof-expression.cpp | 63 + .../missing-std-forward-custom-function.cpp | 42 + .../pro-bounds-pointer-arithmetic-pr36489.cpp | 9 + .../pro-bounds-pointer-arithmetic.cpp | 51 + ...erence-param-not-moved-custom-function.cpp | 47 + .../checkers/misc/confusable-identifiers.cpp | 59 + .../misc/unconventional-assign-operator.cpp | 13 + ...e-lock-warn-on-using-and-typedef-false.cpp | 31 + ...scoped-lock-warn-on-single-locks-false.cpp | 102 + .../checkers/modernize/use-scoped-lock.cpp | 471 ++ .../redundant-inline-specifier.cpp | 10 + .../unittests/clang-doc/BitcodeTest.cpp | 4 + clang/CMakeLists.txt | 6 + .../bindings/python/tests/cindex/test_file.py | 1 + clang/docs/APINotes.rst | 2 +- clang/docs/ClangFormatStyleOptions.rst | 13 +- clang/docs/DebuggingCoroutines.rst | 1347 ++-- clang/docs/LanguageExtensions.rst | 113 +- clang/docs/ReleaseNotes.rst | 87 +- clang/docs/Toolchain.rst | 5 + .../analyzer/developer-docs/DebugChecks.rst | 13 +- .../PerformanceInvestigation.rst | 2 +- clang/docs/coro-async-task-continuations.png | Bin 0 -> 858961 bytes clang/docs/coro-generator-suspended.png | Bin 0 -> 670202 bytes clang/docs/coro-generator-variables.png | Bin 0 -> 774476 bytes clang/include/clang-c/Index.h | 125 +- clang/include/clang/AST/ASTContext.h | 9 - clang/include/clang/AST/ASTNodeTraverser.h | 2 +- clang/include/clang/AST/Decl.h | 21 +- clang/include/clang/AST/DeclarationName.h | 18 +- clang/include/clang/AST/ExprCXX.h | 8 +- clang/include/clang/AST/ExternalASTSource.h | 15 - clang/include/clang/AST/ODRHash.h | 10 +- clang/include/clang/AST/OpenMPClause.h | 66 +- clang/include/clang/AST/Type.h | 7 +- clang/include/clang/ASTMatchers/ASTMatchers.h | 4 +- clang/include/clang/Analysis/CFG.h | 7 +- clang/include/clang/Basic/AMDGPUTypes.def | 8 + clang/include/clang/Basic/Attr.td | 8 + clang/include/clang/Basic/BuiltinHeaders.def | 1 + clang/include/clang/Basic/Builtins.def | 1 + clang/include/clang/Basic/Builtins.td | 42 + clang/include/clang/Basic/BuiltinsAArch64.def | 8 + clang/include/clang/Basic/BuiltinsAMDGPU.def | 31 +- clang/include/clang/Basic/BuiltinsPPC.def | 6 + clang/include/clang/Basic/BuiltinsX86.td | 12 +- clang/include/clang/Basic/CodeGenOptions.h | 9 + .../include/clang/Basic/DiagnosticASTKinds.td | 2 + .../clang/Basic/DiagnosticDriverKinds.td | 3 + clang/include/clang/Basic/DiagnosticGroups.td | 4 +- .../clang/Basic/DiagnosticParseKinds.td | 3 + .../clang/Basic/DiagnosticSemaKinds.td | 54 +- clang/include/clang/Basic/LangOptions.def | 3 + clang/include/clang/Basic/LangOptions.h | 5 + clang/include/clang/Basic/Module.h | 5 + clang/include/clang/Basic/OpenACCKinds.h | 19 +- clang/include/clang/Basic/OpenMPKinds.def | 7 + clang/include/clang/Basic/OpenMPKinds.h | 6 + clang/include/clang/Basic/Sanitizers.h | 3 +- clang/include/clang/Basic/SourceLocation.h | 6 +- clang/include/clang/Basic/SourceManager.h | 35 +- clang/include/clang/Basic/TargetInfo.h | 10 +- clang/include/clang/Basic/arm_neon.td | 54 +- clang/include/clang/Basic/arm_sve.td | 12 +- .../include/clang/Basic/riscv_andes_vector.td | 46 + clang/include/clang/Basic/riscv_vector.td | 217 +- .../clang/Basic/riscv_vector_common.td | 10 +- .../CIR/Dialect/Builder/CIRBaseBuilder.h | 27 +- clang/include/clang/CIR/Dialect/IR/CIRAttrs.h | 22 +- .../include/clang/CIR/Dialect/IR/CIRAttrs.td | 183 +- .../include/clang/CIR/Dialect/IR/CIRDialect.h | 1 + .../clang/CIR/Dialect/IR/CIRDialect.td | 4 + clang/include/clang/CIR/Dialect/IR/CIROps.td | 377 +- clang/include/clang/CIR/Dialect/IR/CIRTypes.h | 11 +- .../include/clang/CIR/Dialect/IR/CIRTypes.td | 76 +- .../CIR/Interfaces/CIRFPTypeInterface.td | 56 - .../clang/CIR/Interfaces/CIROpInterfaces.td | 6 +- ...RFPTypeInterface.h => CIRTypeInterfaces.h} | 10 +- .../clang/CIR/Interfaces/CIRTypeInterfaces.td | 123 + .../clang/CIR/Interfaces/CMakeLists.txt | 2 +- clang/include/clang/CIR/LoweringHelpers.h | 14 + clang/include/clang/CIR/MissingFeatures.h | 157 +- clang/include/clang/Driver/CommonArgs.h | 2 + clang/include/clang/Driver/Driver.h | 14 +- clang/include/clang/Driver/Options.td | 85 +- clang/include/clang/Format/Format.h | 28 +- clang/include/clang/Interpreter/Interpreter.h | 7 +- .../clang/Interpreter/RemoteJITUtils.h | 38 + .../include/clang/Lex/LexHLSLRootSignature.h | 4 + clang/include/clang/Lex/Lexer.h | 10 +- clang/include/clang/Lex/Preprocessor.h | 27 +- clang/include/clang/Lex/Token.h | 9 +- clang/include/clang/Lex/TokenLexer.h | 5 +- .../clang/Parse/ParseHLSLRootSignature.h | 46 +- clang/include/clang/Parse/Parser.h | 60 +- clang/include/clang/Sema/DeclSpec.h | 4 +- clang/include/clang/Sema/HeuristicResolver.h | 7 + clang/include/clang/Sema/Initialization.h | 7 +- .../clang/Sema/MultiplexExternalSemaSource.h | 2 - clang/include/clang/Sema/Scope.h | 14 +- clang/include/clang/Sema/Sema.h | 15 +- clang/include/clang/Sema/SemaAMDGPU.h | 9 + clang/include/clang/Sema/SemaARM.h | 9 + clang/include/clang/Sema/SemaOpenACC.h | 19 + clang/include/clang/Sema/SemaOpenMP.h | 8 +- clang/include/clang/Serialization/ASTReader.h | 30 +- .../clang/Serialization/ASTRecordReader.h | 11 +- .../clang/Serialization/ASTRecordWriter.h | 11 +- clang/include/clang/Serialization/ASTWriter.h | 13 +- .../Serialization/SourceLocationEncoding.h | 120 +- .../Core/PathSensitive/CallEvent.h | 2 + .../Core/PathSensitive/ExplodedGraph.h | 5 +- .../Core/PathSensitive/SMTConv.h | 3 + .../Core/PathSensitive/SymExpr.h | 6 +- .../Core/PathSensitive/SymbolManager.h | 100 +- .../DependencyScanningFilesystem.h | 60 +- .../DependencyScanningService.h | 6 +- .../DependencyScanningTool.h | 14 + .../clang/Tooling/Transformer/Transformer.h | 13 +- clang/lib/APINotes/APINotesWriter.cpp | 5 +- clang/lib/AST/ASTContext.cpp | 98 +- clang/lib/AST/ASTImporter.cpp | 8 +- clang/lib/AST/ByteCode/Compiler.cpp | 16 +- clang/lib/AST/ByteCode/Compiler.h | 18 +- clang/lib/AST/ByteCode/Descriptor.cpp | 15 + clang/lib/AST/ByteCode/Descriptor.h | 3 + clang/lib/AST/ByteCode/Disasm.cpp | 8 +- clang/lib/AST/ByteCode/FunctionPointer.cpp | 2 - clang/lib/AST/ByteCode/Interp.h | 54 +- clang/lib/AST/ByteCode/InterpBuiltin.cpp | 58 +- .../lib/AST/ByteCode/InterpBuiltinBitCast.cpp | 7 +- clang/lib/AST/ByteCode/InterpFrame.cpp | 1 - clang/lib/AST/ByteCode/Pointer.cpp | 80 +- clang/lib/AST/ByteCode/Pointer.h | 3 + clang/lib/AST/Comment.cpp | 7 + clang/lib/AST/CommentLexer.cpp | 2 +- clang/lib/AST/Decl.cpp | 43 +- clang/lib/AST/DeclBase.cpp | 2 + clang/lib/AST/DeclObjC.cpp | 1 - clang/lib/AST/Expr.cpp | 6 +- clang/lib/AST/ExprCXX.cpp | 4 +- clang/lib/AST/ExprConcepts.cpp | 1 - clang/lib/AST/ExprObjC.cpp | 1 - clang/lib/AST/ItaniumMangle.cpp | 3 +- clang/lib/AST/ODRHash.cpp | 29 +- clang/lib/AST/OpenMPClause.cpp | 5 + clang/lib/AST/RawCommentList.cpp | 7 +- clang/lib/AST/RecordLayoutBuilder.cpp | 7 + clang/lib/AST/StmtOpenACC.cpp | 2 +- clang/lib/AST/StmtPrinter.cpp | 1 - clang/lib/AST/TextNodeDumper.cpp | 12 +- clang/lib/AST/Type.cpp | 9 - clang/lib/AST/TypeLoc.cpp | 6 +- clang/lib/ASTMatchers/Dynamic/Marshallers.h | 2 +- clang/lib/Analysis/CFG.cpp | 8 +- clang/lib/Analysis/CFGStmtMap.cpp | 4 +- clang/lib/Analysis/CallGraph.cpp | 5 +- .../lib/Analysis/FlowSensitive/CNFFormula.cpp | 5 +- clang/lib/Analysis/LiveVariables.cpp | 10 +- clang/lib/Analysis/PathDiagnostic.cpp | 8 +- clang/lib/Analysis/ReachableCode.cpp | 5 +- clang/lib/Analysis/RetainSummaryManager.cpp | 3 +- clang/lib/Analysis/UnsafeBufferUsage.cpp | 40 +- clang/lib/Basic/Attributes.cpp | 6 +- clang/lib/Basic/Diagnostic.cpp | 9 +- clang/lib/Basic/DiagnosticIDs.cpp | 8 +- clang/lib/Basic/FileManager.cpp | 2 +- clang/lib/Basic/OpenMPKinds.cpp | 21 +- clang/lib/Basic/Sanitizers.cpp | 3 +- clang/lib/Basic/Sarif.cpp | 2 +- clang/lib/Basic/SourceLocation.cpp | 4 +- clang/lib/Basic/SourceManager.cpp | 160 +- clang/lib/Basic/Targets/AArch64.cpp | 102 +- clang/lib/Basic/Targets/AArch64.h | 4 +- clang/lib/Basic/Targets/LoongArch.cpp | 72 +- clang/lib/Basic/Targets/LoongArch.h | 1 + clang/lib/Basic/Targets/M68k.cpp | 1 + clang/lib/Basic/Targets/PPC.cpp | 6 + clang/lib/Basic/Targets/RISCV.cpp | 4 +- clang/lib/Basic/Targets/RISCV.h | 2 +- clang/lib/Basic/Targets/SPIR.cpp | 5 + clang/lib/Basic/Targets/SPIR.h | 1 + clang/lib/Basic/Targets/SystemZ.h | 4 +- clang/lib/CIR/CodeGen/CIRGenBuilder.cpp | 5 +- clang/lib/CIR/CodeGen/CIRGenBuilder.h | 35 +- clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp | 90 + clang/lib/CIR/CodeGen/CIRGenCXX.cpp | 2 +- clang/lib/CIR/CodeGen/CIRGenCXXExpr.cpp | 229 +- clang/lib/CIR/CodeGen/CIRGenCall.cpp | 52 +- clang/lib/CIR/CodeGen/CIRGenCall.h | 3 +- clang/lib/CIR/CodeGen/CIRGenClass.cpp | 176 +- clang/lib/CIR/CodeGen/CIRGenExpr.cpp | 88 +- clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp | 60 +- clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp | 16 +- clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp | 107 +- clang/lib/CIR/CodeGen/CIRGenFunction.cpp | 33 +- clang/lib/CIR/CodeGen/CIRGenFunction.h | 91 +- clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp | 89 +- clang/lib/CIR/CodeGen/CIRGenModule.cpp | 199 +- clang/lib/CIR/CodeGen/CIRGenModule.h | 31 +- clang/lib/CIR/CodeGen/CIRGenOpenACC.cpp | 131 + clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp | 435 +- .../CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp | 50 +- clang/lib/CIR/CodeGen/CIRGenStmtOpenACC.cpp | 58 +- .../lib/CIR/CodeGen/CIRGenStmtOpenACCLoop.cpp | 1 + clang/lib/CIR/CodeGen/CIRGenTypeCache.h | 18 +- clang/lib/CIR/CodeGen/CIRGenTypes.cpp | 4 +- clang/lib/CIR/CodeGen/CIRGenValue.h | 34 + clang/lib/CIR/CodeGen/CMakeLists.txt | 1 + clang/lib/CIR/Dialect/IR/CIRAttrs.cpp | 123 +- clang/lib/CIR/Dialect/IR/CIRDialect.cpp | 205 +- clang/lib/CIR/Dialect/IR/CIRTypes.cpp | 13 +- .../Dialect/Transforms/CIRCanonicalize.cpp | 5 +- ...ypeInterface.cpp => CIRTypeInterfaces.cpp} | 6 +- clang/lib/CIR/Interfaces/CMakeLists.txt | 4 +- .../CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp | 309 +- .../CIR/Lowering/DirectToLLVM/LowerToLLVM.h | 92 +- clang/lib/CIR/Lowering/LoweringHelpers.cpp | 40 +- clang/lib/CodeGen/BackendUtil.cpp | 21 +- clang/lib/CodeGen/CGAtomic.cpp | 17 +- clang/lib/CodeGen/CGBuiltin.cpp | 22 +- clang/lib/CodeGen/CGCall.cpp | 7 + clang/lib/CodeGen/CGClass.cpp | 9 +- clang/lib/CodeGen/CGDebugInfo.cpp | 56 +- clang/lib/CodeGen/CGDebugInfo.h | 7 +- clang/lib/CodeGen/CGExprScalar.cpp | 19 +- clang/lib/CodeGen/CGHLSLRuntime.cpp | 25 +- clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 4 +- clang/lib/CodeGen/CGStmtOpenMP.cpp | 2 +- clang/lib/CodeGen/CGVTables.cpp | 4 +- clang/lib/CodeGen/CodeGenFunction.cpp | 10 +- clang/lib/CodeGen/CodeGenFunction.h | 3 + clang/lib/CodeGen/CodeGenModule.cpp | 98 + clang/lib/CodeGen/CodeGenModule.h | 5 + clang/lib/CodeGen/CodeGenPGO.cpp | 3 +- clang/lib/CodeGen/CodeGenTypes.cpp | 3 + clang/lib/CodeGen/ConstantInitBuilder.cpp | 2 +- clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp | 38 +- clang/lib/CodeGen/TargetBuiltins/ARM.cpp | 84 +- clang/lib/CodeGen/TargetBuiltins/X86.cpp | 11 + clang/lib/CodeGen/Targets/RISCV.cpp | 2 +- clang/lib/CodeGen/Targets/SPIR.cpp | 32 +- .../linux/DirectoryWatcher-linux.cpp | 5 - clang/lib/Driver/CMakeLists.txt | 1 - clang/lib/Driver/Driver.cpp | 245 +- clang/lib/Driver/OffloadBundler.cpp | 6 +- clang/lib/Driver/SanitizerArgs.cpp | 2 +- clang/lib/Driver/ToolChain.cpp | 2 +- clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 27 +- .../lib/Driver/ToolChains/Arch/LoongArch.cpp | 10 +- clang/lib/Driver/ToolChains/BareMetal.cpp | 333 +- clang/lib/Driver/ToolChains/BareMetal.h | 29 +- clang/lib/Driver/ToolChains/Clang.cpp | 69 +- clang/lib/Driver/ToolChains/CommonArgs.cpp | 74 +- clang/lib/Driver/ToolChains/Flang.cpp | 9 +- clang/lib/Driver/ToolChains/Gnu.cpp | 72 - clang/lib/Driver/ToolChains/HIPAMD.cpp | 11 +- clang/lib/Driver/ToolChains/HIPSPV.cpp | 19 +- clang/lib/Driver/ToolChains/HLSL.cpp | 40 +- clang/lib/Driver/ToolChains/MSVC.cpp | 19 +- clang/lib/Driver/ToolChains/Managarm.cpp | 1 - clang/lib/Driver/ToolChains/PS4CPU.cpp | 6 +- .../lib/Driver/ToolChains/RISCVToolchain.cpp | 231 - clang/lib/Driver/ToolChains/RISCVToolchain.h | 67 - clang/lib/Edit/Commit.cpp | 9 +- clang/lib/ExtractAPI/DeclarationFragments.cpp | 40 +- clang/lib/Format/BreakableToken.cpp | 3 +- clang/lib/Format/ContinuationIndenter.cpp | 17 +- clang/lib/Format/ContinuationIndenter.h | 15 +- clang/lib/Format/Format.cpp | 2 +- clang/lib/Format/FormatTokenLexer.cpp | 45 +- clang/lib/Format/MacroExpander.cpp | 2 +- clang/lib/Format/QualifierAlignmentFixer.cpp | 25 +- clang/lib/Format/TokenAnnotator.cpp | 7 +- clang/lib/Format/UnwrappedLineFormatter.cpp | 9 +- clang/lib/Format/UnwrappedLineParser.cpp | 14 +- clang/lib/Format/WhitespaceManager.cpp | 8 +- clang/lib/Format/WhitespaceManager.h | 2 +- clang/lib/Frontend/ASTUnit.cpp | 4 +- clang/lib/Frontend/CompilerInvocation.cpp | 72 +- clang/lib/Frontend/FrontendAction.cpp | 8 +- clang/lib/Frontend/SARIFDiagnostic.cpp | 4 +- clang/lib/Frontend/TextDiagnostic.cpp | 6 +- .../ExecuteCompilerInvocation.cpp | 1 - clang/lib/Headers/intrin.h | 23 +- clang/lib/Headers/opencl-c.h | 334 +- clang/lib/Headers/prfchwintrin.h | 23 +- clang/lib/Headers/xmmintrin.h | 5 +- clang/lib/Index/CommentToXML.cpp | 2 +- clang/lib/Index/IndexBody.cpp | 2 +- clang/lib/Index/USRGeneration.cpp | 2 +- clang/lib/Interpreter/CMakeLists.txt | 1 + clang/lib/Interpreter/Interpreter.cpp | 52 +- clang/lib/Interpreter/RemoteJITUtils.cpp | 267 + clang/lib/Lex/DependencyDirectivesScanner.cpp | 52 +- clang/lib/Lex/Lexer.cpp | 35 +- clang/lib/Lex/MacroInfo.cpp | 7 +- clang/lib/Lex/PPDirectives.cpp | 7 +- clang/lib/Lex/PPMacroExpansion.cpp | 22 +- clang/lib/Lex/Preprocessor.cpp | 21 +- clang/lib/Lex/TokenLexer.cpp | 11 + clang/lib/Parse/ParseDeclCXX.cpp | 4 +- clang/lib/Parse/ParseExpr.cpp | 196 +- clang/lib/Parse/ParseExprCXX.cpp | 18 +- clang/lib/Parse/ParseHLSLRootSignature.cpp | 63 +- clang/lib/Parse/ParseOpenACC.cpp | 17 +- clang/lib/Parse/ParseOpenMP.cpp | 243 +- clang/lib/Parse/ParseStmt.cpp | 2 +- clang/lib/Parse/ParseStmtAsm.cpp | 9 +- clang/lib/Parse/ParseTemplate.cpp | 4 +- clang/lib/Parse/Parser.cpp | 5 +- clang/lib/Rewrite/Rewriter.cpp | 2 +- clang/lib/Sema/AnalysisBasedWarnings.cpp | 24 +- clang/lib/Sema/CodeCompleteConsumer.cpp | 4 +- clang/lib/Sema/HeuristicResolver.cpp | 57 + clang/lib/Sema/JumpDiagnostics.cpp | 7 +- .../lib/Sema/MultiplexExternalSemaSource.cpp | 8 - clang/lib/Sema/OpenCLBuiltins.td | 32 + clang/lib/Sema/Scope.cpp | 3 +- clang/lib/Sema/Sema.cpp | 30 +- clang/lib/Sema/SemaAMDGPU.cpp | 77 + clang/lib/Sema/SemaARM.cpp | 123 +- clang/lib/Sema/SemaAttr.cpp | 3 +- clang/lib/Sema/SemaCast.cpp | 209 +- clang/lib/Sema/SemaChecking.cpp | 162 +- clang/lib/Sema/SemaCodeComplete.cpp | 88 +- clang/lib/Sema/SemaConcept.cpp | 4 +- clang/lib/Sema/SemaDecl.cpp | 65 +- clang/lib/Sema/SemaDeclAttr.cpp | 48 + clang/lib/Sema/SemaDeclCXX.cpp | 103 +- clang/lib/Sema/SemaExpr.cpp | 51 +- clang/lib/Sema/SemaExprCXX.cpp | 9 +- clang/lib/Sema/SemaHLSL.cpp | 74 +- clang/lib/Sema/SemaInit.cpp | 69 +- clang/lib/Sema/SemaModule.cpp | 8 +- clang/lib/Sema/SemaObjCProperty.cpp | 2 +- clang/lib/Sema/SemaOpenACC.cpp | 68 +- clang/lib/Sema/SemaOpenACCClause.cpp | 4 +- clang/lib/Sema/SemaOpenMP.cpp | 76 +- clang/lib/Sema/SemaOverload.cpp | 37 +- clang/lib/Sema/SemaPPC.cpp | 4 + clang/lib/Sema/SemaRISCV.cpp | 23 +- clang/lib/Sema/SemaSPIRV.cpp | 2 +- clang/lib/Sema/SemaSwift.cpp | 17 +- clang/lib/Sema/SemaTemplate.cpp | 6 +- clang/lib/Sema/SemaType.cpp | 4 +- clang/lib/Sema/SemaTypeTraits.cpp | 376 +- clang/lib/Sema/TreeTransform.h | 28 +- clang/lib/Serialization/ASTReader.cpp | 67 +- clang/lib/Serialization/ASTReaderDecl.cpp | 5 +- clang/lib/Serialization/ASTReaderStmt.cpp | 2 +- clang/lib/Serialization/ASTWriter.cpp | 59 +- clang/lib/Serialization/ASTWriterDecl.cpp | 5 +- clang/lib/Serialization/ASTWriterStmt.cpp | 4 +- .../Serialization/TemplateArgumentHasher.cpp | 2 + .../Checkers/CStringChecker.cpp | 48 +- .../Checkers/CallAndMessageChecker.cpp | 2 + .../Checkers/LocalizationChecker.cpp | 3 +- .../StaticAnalyzer/Checkers/MallocChecker.cpp | 75 +- .../Checkers/UnixAPIChecker.cpp | 50 +- .../WebKit/RawPtrRefCallArgsChecker.cpp | 2 +- .../Core/BugReporterVisitors.cpp | 2 +- clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 12 + .../StaticAnalyzer/Core/HTMLDiagnostics.cpp | 4 +- clang/lib/Tooling/Core/Replacement.cpp | 7 +- .../DependencyScanningFilesystem.cpp | 68 +- .../DependencyScanningService.cpp | 3 +- .../DependencyScanningTool.cpp | 2 + .../DependencyScanningWorker.cpp | 3 +- .../DependencyScanning/ModuleDepCollector.cpp | 5 +- .../lib/Tooling/Refactoring/AtomicChange.cpp | 3 +- .../Refactoring/Rename/USRLocFinder.cpp | 3 +- clang/lib/Tooling/Transformer/SourceCode.cpp | 4 +- clang/test/AST/ByteCode/builtin-functions.cpp | 8 + .../libcxx/rvalue-reference-param.cpp | 122 + .../libcxx/tuple-decompose-for-range.cpp | 264 + clang/test/AST/ByteCode/literals.cpp | 12 + clang/test/AST/ByteCode/new-delete.cpp | 36 + clang/test/AST/ByteCode/placement-new.cpp | 21 + clang/test/AST/ByteCode/unions.cpp | 120 +- clang/test/AST/HLSL/RootSignatures-AST.hlsl | 31 +- .../test/AST/HLSL/vk.spec-constant.usage.hlsl | 11 + clang/test/AST/absurdly_big_struct.cpp | 13 + clang/test/AST/ast-dump-expr.cpp | 10 + .../AST/ast-print-openacc-cache-construct.cpp | 3 + .../ast-print-openacc-combined-construct.cpp | 4 +- clang/test/Analysis/ArrayDelete.cpp | 2 +- .../WebKit/call-args-safe-functions.mm | 12 + .../Checkers/WebKit/objc-mock-types.h | 1 + .../Analysis/DeleteWithNonVirtualDtor.cpp | 2 +- clang/test/Analysis/PR37855.c | 12 +- clang/test/Analysis/PR38208.c | 5 + clang/test/Analysis/aggrinit-cfg-output.cpp | 2 +- clang/test/Analysis/analyzer_test.py | 53 - clang/test/Analysis/bool-assignment.c | 4 - clang/test/Analysis/call-and-message.c | 27 +- clang/test/Analysis/call-and-message.cpp | 16 + clang/test/Analysis/compound-literals.c | 2 +- clang/test/Analysis/cstring-addrspace.c | 3 +- .../cstring-should-not-invalidate.cpp | 132 + .../test/Analysis/ctu-cxxdefaultinitexpr.cpp | 2 +- clang/test/Analysis/ctu-implicit.c | 2 +- clang/test/Analysis/ctu-import-threshold.c | 4 +- .../Analysis/ctu-lookup-name-with-space.cpp | 2 +- clang/test/Analysis/ctu-main.c | 4 +- clang/test/Analysis/ctu-on-demand-parsing.c | 2 +- .../test/Analysis/ctu-test-import-failure.cpp | 2 +- .../exploded-graph-rewriter/dynamic_types.cpp | 7 +- .../exploded-graph-rewriter/escapes.c | 7 +- .../initializers_under_construction.cpp | 7 +- .../l_name_starts_with_l.cpp | 7 +- .../Analysis/exploded-graph-rewriter/macros.c | 7 +- .../objects_under_construction.cpp | 9 +- .../win_path_forbidden_chars.cpp | 7 +- .../getline-unixapi-invalid-signatures.c | 127 + clang/test/Analysis/gmalloc.c | 2 +- ...dle_constructors_for_default_arguments.cpp | 2 +- .../handle_constructors_with_new_array.cpp | 2 +- clang/test/Analysis/initialization.c | 2 +- clang/test/Analysis/initialization.cpp | 2 +- .../Analysis/lambda-convert-to-func-ptr.cpp | 21 + clang/test/Analysis/lifetime-cfg-output.cpp | 2 +- clang/test/Analysis/lit.local.cfg | 12 +- clang/test/Analysis/loopexit-cfg-output.cpp | 2 +- clang/test/Analysis/method-arg-decay.m | 2 +- clang/test/Analysis/null-deref-static.m | 2 +- clang/test/Analysis/objc-encode.m | 2 +- clang/test/Analysis/openmp-unsupported.c | 2 +- .../pointer-escape-on-conservative-calls.c | 2 +- clang/test/Analysis/print-ranges.cpp | 2 +- clang/test/Analysis/ptr-arith.c | 17 - clang/test/Analysis/reference.cpp | 16 - clang/test/Analysis/scopes-cfg-output.cpp | 2 +- .../test/Analysis/taint-diagnostic-visitor.c | 2 +- .../Analysis/temporaries-callback-order.cpp | 2 +- .../Analysis/unary-sym-expr-z3-refutation.c | 2 +- clang/test/Analysis/undef-call.c | 2 +- .../Analysis/z3-crosscheck-max-attempts.cpp | 15 +- clang/test/Analysis/z3-crosscheck.c | 8 +- clang/test/Analysis/z3/D83660.c | 11 +- .../test/Analysis/z3/crosscheck-statistics.c | 2 - clang/test/Analysis/z3/enabled.c | 3 - clang/test/Analysis/z3/pretty-dump.c | 2 +- clang/test/CIR/CodeGen/align-load.c | 6 +- clang/test/CIR/CodeGen/align-store.c | 2 +- clang/test/CIR/CodeGen/array.cpp | 26 +- clang/test/CIR/CodeGen/assign-operator.cpp | 144 + clang/test/CIR/CodeGen/basic.c | 48 +- clang/test/CIR/CodeGen/basic.cpp | 18 +- clang/test/CIR/CodeGen/binassign.c | 2 +- clang/test/CIR/CodeGen/binop.cpp | 56 +- clang/test/CIR/CodeGen/bitfield-union.c | 30 + clang/test/CIR/CodeGen/bitfields.c | 58 + clang/test/CIR/CodeGen/bitfields.cpp | 28 + clang/test/CIR/CodeGen/bitfields_be.c | 29 +- clang/test/CIR/CodeGen/builtin_bit.cpp | 327 + clang/test/CIR/CodeGen/builtin_call.cpp | 60 +- clang/test/CIR/CodeGen/builtin_printf.cpp | 18 +- clang/test/CIR/CodeGen/call.c | 36 +- clang/test/CIR/CodeGen/call.cpp | 47 +- clang/test/CIR/CodeGen/cast.cpp | 14 +- clang/test/CIR/CodeGen/class.cpp | 6 +- clang/test/CIR/CodeGen/cmp.cpp | 30 +- clang/test/CIR/CodeGen/comma.c | 2 +- clang/test/CIR/CodeGen/complex-builtins.cpp | 35 + clang/test/CIR/CodeGen/complex.cpp | 422 +- clang/test/CIR/CodeGen/compound_assign.cpp | 2 +- clang/test/CIR/CodeGen/ctor-alias.cpp | 75 + clang/test/CIR/CodeGen/ctor.cpp | 126 +- clang/test/CIR/CodeGen/deferred-defs.cpp | 2 +- clang/test/CIR/CodeGen/dso-local.c | 32 +- clang/test/CIR/CodeGen/forrange.cpp | 10 +- clang/test/CIR/CodeGen/generic-selection.c | 24 + clang/test/CIR/CodeGen/if.cpp | 24 +- clang/test/CIR/CodeGen/inline-cxx-func.cpp | 4 +- clang/test/CIR/CodeGen/int-to-bool.cpp | 16 +- clang/test/CIR/CodeGen/linkage-spec.cpp | 28 +- clang/test/CIR/CodeGen/local-vars.cpp | 2 +- clang/test/CIR/CodeGen/loop.cpp | 40 +- clang/test/CIR/CodeGen/member-functions.cpp | 6 +- clang/test/CIR/CodeGen/namespace.cpp | 16 +- clang/test/CIR/CodeGen/new.cpp | 158 + .../CIR/CodeGen/non-type-template-param.cpp | 27 + clang/test/CIR/CodeGen/nullptr-init.cpp | 2 +- clang/test/CIR/CodeGen/opt-info-attr.cpp | 22 + clang/test/CIR/CodeGen/pack-indexing.cpp | 49 + clang/test/CIR/CodeGen/static-vars.c | 12 +- clang/test/CIR/CodeGen/static-vars.cpp | 12 +- clang/test/CIR/CodeGen/string-literals.c | 22 +- clang/test/CIR/CodeGen/string-literals.cpp | 2 +- clang/test/CIR/CodeGen/struct.c | 20 +- clang/test/CIR/CodeGen/struct.cpp | 10 +- clang/test/CIR/CodeGen/switch.cpp | 94 +- clang/test/CIR/CodeGen/switch_flat_op.cpp | 4 +- clang/test/CIR/CodeGen/ternary.cpp | 12 +- clang/test/CIR/CodeGen/typedef.c | 4 +- clang/test/CIR/CodeGen/unary.cpp | 74 +- clang/test/CIR/CodeGen/union.c | 28 +- clang/test/CIR/CodeGen/vector-ext.cpp | 15 + clang/test/CIR/CodeGen/vector.cpp | 15 + clang/test/CIR/CodeGenOpenACC/cache.c | 132 + clang/test/CIR/CodeGenOpenACC/combined-copy.c | 79 +- .../combined-copyin-copyout-create.c | 160 + clang/test/CIR/CodeGenOpenACC/combined.cpp | 4 +- clang/test/CIR/CodeGenOpenACC/compute-copy.c | 63 +- .../compute-copyin-copyout-create.c | 128 + .../data-copy-copyin-copyout-create.c | 218 + clang/test/CIR/CodeGenOpenACC/data.c | 50 +- clang/test/CIR/CodeGenOpenACC/enter-data.c | 125 + clang/test/CIR/CodeGenOpenACC/exit-data.c | 134 + clang/test/CIR/CodeGenOpenACC/host_data.c | 2 +- clang/test/CIR/CodeGenOpenACC/init.c | 2 +- clang/test/CIR/CodeGenOpenACC/kernels.c | 4 +- clang/test/CIR/CodeGenOpenACC/loop.cpp | 2 +- clang/test/CIR/CodeGenOpenACC/parallel.c | 4 +- clang/test/CIR/CodeGenOpenACC/serial.c | 4 +- clang/test/CIR/CodeGenOpenACC/set.c | 2 +- clang/test/CIR/CodeGenOpenACC/shutdown.c | 2 +- clang/test/CIR/CodeGenOpenACC/update.c | 178 + clang/test/CIR/CodeGenOpenACC/wait.c | 2 +- clang/test/CIR/IR/array.cir | 6 +- clang/test/CIR/IR/binassign.cir | 2 +- clang/test/CIR/IR/call.cir | 14 +- clang/test/CIR/IR/cast.cir | 4 +- clang/test/CIR/IR/cmp.cir | 10 +- clang/test/CIR/IR/func.cir | 18 +- clang/test/CIR/IR/invalid-call.cir | 12 +- clang/test/CIR/IR/invalid-complex.cir | 24 + clang/test/CIR/IR/invalid-func.cir | 11 + clang/test/CIR/IR/invalid-opt-info.cir | 13 + .../IR/invalid-vector-create-wrong-size.cir | 16 - .../IR/invalid-vector-create-wrong-type.cir | 17 - ...invalid-vector-shift-wrong-result-type.cir | 17 - ...alid-vector-shuffle-dyn-wrong-operands.cir | 19 - .../IR/invalid-vector-shuffle-wrong-index.cir | 16 - .../test/CIR/IR/invalid-vector-zero-size.cir | 10 - clang/test/CIR/IR/invalid-vector.cir | 105 +- clang/test/CIR/IR/ternary.cir | 2 +- clang/test/CIR/IR/unary.cir | 4 +- clang/test/CIR/IR/vector.cir | 16 +- clang/test/CIR/Lowering/array.cpp | 18 +- clang/test/CIR/Transforms/canonicalize.cir | 12 +- .../CIR/Transforms/complex-create-fold.cir | 2 +- .../test/CIR/Transforms/complex-imag-fold.cir | 23 + .../test/CIR/Transforms/complex-real-fold.cir | 23 + clang/test/CIR/Transforms/hoist-allocas.cir | 6 +- clang/test/CIR/Transforms/if.cir | 4 +- clang/test/CIR/Transforms/loop.cir | 6 +- clang/test/CIR/Transforms/scope.cir | 6 +- clang/test/CIR/Transforms/select.cir | 10 +- clang/test/CIR/Transforms/switch.cir | 20 +- clang/test/CIR/Transforms/ternary-fold.cir | 8 +- clang/test/CIR/Transforms/ternary.cir | 4 +- clang/test/CIR/Transforms/vector-cmp-fold.cir | 24 +- .../CIR/Transforms/vector-create-fold.cir | 2 +- .../vector-shuffle-dynamic-fold.cir | 4 +- .../CIR/Transforms/vector-shuffle-fold.cir | 6 +- clang/test/CIR/Transforms/vector-splat.cir | 4 +- .../CIR/Transforms/vector-ternary-fold.cir | 2 +- clang/test/CIR/func-linkage.cpp | 51 + clang/test/CIR/func-simple.cpp | 20 +- clang/test/CIR/global-var-linkage.cpp | 2 +- clang/test/CIR/mlprint.c | 2 +- clang/test/CMakeLists.txt | 27 +- .../basic/basic.start/basic.start.main/p3.cpp | 5 +- .../CXX/class.access/class.access.dcl/p1.cpp | 11 +- .../basic.namespace/namespace.udecl/p3.cpp | 25 +- .../basic.namespace/namespace.udecl/p4.cpp | 12 +- clang/test/CXX/drs/cwg4xx.cpp | 9 + .../CXX/stmt.stmt/stmt.select/stmt.if/p2.cpp | 22 + clang/test/ClangScanDeps/P1689.cppm | 21 +- .../modules-full-named-modules.cppm | 351 + clang/test/ClangScanDeps/raw-strings.cpp | 148 + clang/test/CodeCompletion/overrides.cpp | 14 + .../skip-explicit-object-parameter.cpp | 14 + .../test/CodeGen/AArch64/attr-fp8-function.c | 37 + clang/test/CodeGen/AArch64/fmv-dependencies.c | 2 +- clang/test/CodeGen/AArch64/neon-intrinsics.c | 389 + clang/test/CodeGen/AArch64/neon-ldst-one.c | 357 + .../AArch64/sve-intrinsics/acle_sve_ld1ro.c | 15 + .../AArch64/sve-intrinsics/acle_sve_ld1rq.c | 15 + .../AArch64/sve-intrinsics/acle_sve_ldff1.c | 32 + .../AArch64/sve-intrinsics/acle_sve_ldnf1.c | 32 + clang/test/CodeGen/LoongArch/bitint.c | 122 + .../LoongArch/inline-asm-gcc-regs-error.c | 9 - .../CodeGen/LoongArch/inline-asm-gcc-regs.c | 62 +- .../CodeGen/PowerPC/builtins-bcd-transform.c | 79 + .../non-policy/non-overloaded/nds_vd4dots.c | 0 .../non-policy/non-overloaded/nds_vd4dotsu.c | 0 .../non-policy/non-overloaded/nds_vd4dotu.c | 0 .../non-overloaded/nds_vfncvtbf16s.c | 108 + .../non-policy/non-overloaded/nds_vfpmadb.c | 1 - .../non-policy/non-overloaded/nds_vfpmadt.c | 1 - .../non-overloaded/nds_vfwcvtsbf16.c | 58 + .../non-policy/overloaded/nds_vd4dots.c | 0 .../non-policy/overloaded/nds_vd4dotsu.c | 0 .../non-policy/overloaded/nds_vd4dotu.c | 0 .../non-policy/overloaded/nds_vfncvtbf16s.c | 108 + .../non-policy/overloaded/nds_vfpmadb.c | 1 - .../non-policy/overloaded/nds_vfpmadt.c | 1 - .../non-policy/overloaded/nds_vfwcvtsbf16.c | 58 + .../policy/non-overloaded/nds_vd4dots.c | 0 .../policy/non-overloaded/nds_vd4dotsu.c | 0 .../policy/non-overloaded/nds_vd4dotu.c | 0 .../policy/non-overloaded/nds_vfncvtbf16s.c | 108 + .../policy/non-overloaded/nds_vfpmadb.c | 1 - .../policy/non-overloaded/nds_vfpmadt.c | 1 - .../policy/non-overloaded/nds_vfwcvtsbf16.c | 58 + .../policy/overloaded/nds_vd4dots.c | 0 .../policy/overloaded/nds_vd4dotsu.c | 0 .../policy/overloaded/nds_vd4dotu.c | 0 .../policy/overloaded/nds_vfncvtbf16s.c | 120 + .../policy/overloaded/nds_vfpmadb.c | 1 - .../policy/overloaded/nds_vfpmadt.c | 1 - .../policy/overloaded/nds_vfwcvtsbf16.c | 63 + .../non-overloaded/sf_vfnrclip_x_f_qf.c | 0 .../non-overloaded/sf_vfnrclip_x_f_qf_rm.c | 0 .../non-overloaded/sf_vfnrclip_xu_f_qf.c | 0 .../non-overloaded/sf_vfnrclip_xu_f_qf_rm.c | 0 .../non-overloaded/sf_vfwmacc_4x4x4.c | 0 .../non-overloaded/sf_vqmacc_2x8x2.c | 0 .../non-overloaded/sf_vqmacc_4x8x4.c | 0 .../non-overloaded/sf_vqmaccsu_2x8x2.c | 0 .../non-overloaded/sf_vqmaccsu_4x8x4.c | 0 .../non-overloaded/sf_vqmaccu_2x8x2.c | 0 .../non-overloaded/sf_vqmaccu_4x8x4.c | 0 .../non-overloaded/sf_vqmaccus_2x8x2.c | 0 .../non-overloaded/sf_vqmaccus_4x8x4.c | 0 .../overloaded/sf_vfnrclip_x_f_qf.c | 0 .../overloaded/sf_vfnrclip_x_f_qf_rm.c | 0 .../overloaded/sf_vfnrclip_xu_f_qf.c | 0 .../overloaded/sf_vfnrclip_xu_f_qf_rm.c | 0 .../non-policy/overloaded/sf_vfwmacc_4x4x4.c | 0 .../non-policy/overloaded/sf_vqmacc_2x8x2.c | 0 .../non-policy/overloaded/sf_vqmacc_4x8x4.c | 0 .../non-policy/overloaded/sf_vqmaccsu_2x8x2.c | 0 .../non-policy/overloaded/sf_vqmaccsu_4x8x4.c | 0 .../non-policy/overloaded/sf_vqmaccu_2x8x2.c | 0 .../non-policy/overloaded/sf_vqmaccu_4x8x4.c | 0 .../non-policy/overloaded/sf_vqmaccus_2x8x2.c | 0 .../non-policy/overloaded/sf_vqmaccus_4x8x4.c | 0 .../non-overloaded/sf_vfnrclip_x_f_qf.c | 0 .../non-overloaded/sf_vfnrclip_x_f_qf_rm.c | 0 .../non-overloaded/sf_vfnrclip_xu_f_qf.c | 0 .../non-overloaded/sf_vfnrclip_xu_f_qf_rm.c | 0 .../policy/non-overloaded/sf_vfwmacc_4x4x4.c | 0 .../policy/non-overloaded/sf_vqmacc_2x8x2.c | 0 .../policy/non-overloaded/sf_vqmacc_4x8x4.c | 0 .../policy/non-overloaded/sf_vqmaccsu_2x8x2.c | 0 .../policy/non-overloaded/sf_vqmaccsu_4x8x4.c | 0 .../policy/non-overloaded/sf_vqmaccu_2x8x2.c | 0 .../policy/non-overloaded/sf_vqmaccu_4x8x4.c | 0 .../policy/non-overloaded/sf_vqmaccus_2x8x2.c | 0 .../policy/non-overloaded/sf_vqmaccus_4x8x4.c | 0 .../policy/overloaded/sf_vfnrclip_x_f_qf.c | 0 .../policy/overloaded/sf_vfnrclip_x_f_qf_rm.c | 0 .../policy/overloaded/sf_vfnrclip_xu_f_qf.c | 0 .../overloaded/sf_vfnrclip_xu_f_qf_rm.c | 0 .../policy/overloaded/sf_vfwmacc_4x4x4.c | 0 .../policy/overloaded/sf_vqmacc_2x8x2.c | 0 .../policy/overloaded/sf_vqmacc_4x8x4.c | 0 .../policy/overloaded/sf_vqmaccsu_2x8x2.c | 0 .../policy/overloaded/sf_vqmaccsu_4x8x4.c | 0 .../policy/overloaded/sf_vqmaccu_2x8x2.c | 0 .../policy/overloaded/sf_vqmaccu_4x8x4.c | 0 .../policy/overloaded/sf_vqmaccus_2x8x2.c | 0 .../policy/overloaded/sf_vqmaccus_4x8x4.c | 0 ...asm-exception-model-flag-parse-ir-input.ll | 17 + .../wasm-invalid-exception-kinds.ll | 8 + .../CodeGen/X86/ms-secure-hotpatch-bad-file.c | 18 + .../CodeGen/X86/ms-secure-hotpatch-cpp.cpp | 24 + .../CodeGen/X86/ms-secure-hotpatch-eh.cpp | 26 + .../CodeGen/X86/ms-secure-hotpatch-globals.c | 135 + .../test/CodeGen/X86/ms-secure-hotpatch-lto.c | 26 + clang/test/CodeGen/X86/ms-secure-hotpatch.c | 23 + .../CodeGen/amdgpu-builtin-is-invocable.c | 28 +- .../CodeGen/amdgpu-builtin-processor-is.c | 29 +- .../amdgpu-feature-builtins-invalid-use.cpp | 53 +- .../test/CodeGen/arm-neon-directed-rounding.c | 42 +- .../arm-sve-vector-bits-vscale-range.c | 80 +- .../test/CodeGen/arm-v8.2a-neon-intrinsics.c | 24 +- .../test/CodeGen/arm64-microsoft-intrinsics.c | 60 + clang/test/CodeGen/arm64-microsoft-sys.c | 65 + clang/test/CodeGen/attr-target-mv.c | 4 + clang/test/CodeGen/bitfield-access-pad.c | 52 +- clang/test/CodeGen/bittest-intrin.c | 129 +- clang/test/CodeGen/builtins-overflow.c | 12 + clang/test/CodeGen/debug-label-inline.c | 2 +- clang/test/CodeGen/debug-label.c | 2 +- clang/test/CodeGen/ext-int-cc.c | 12 +- .../fallow-runtime-check-skip-hot-cutoff.c | 15 + clang/test/CodeGen/logb_scalbn.c | 873 +++ clang/test/CodeGen/pragma-comment.c | 3 + clang/test/CodeGen/visibility.c | 30 +- clang/test/CodeGenCUDA/bf16.cu | 6 +- clang/test/CodeGenCXX/auto-var-init.cpp | 1 + .../test/CodeGenCXX/bitfield-access-empty.cpp | 1 + clang/test/CodeGenCXX/builtin-invoke.cpp | 61 + clang/test/CodeGenCXX/builtins-eh-wasm.cpp | 3 +- .../debug-info-dtor-implicit-args.cpp | 24 + .../microsoft-abi-member-pointers.cpp | 7 + clang/test/CodeGenCXX/visibility.cpp | 40 +- clang/test/CodeGenCXX/wasm-eh.cpp | 6 +- .../AppendStructuredBuffer-elementtype.hlsl | 3 + .../ConsumeStructuredBuffer-elementtype.hlsl | 3 + .../builtins/RWBuffer-elementtype.hlsl | 10 +- .../builtins/RWBuffer-subscript.hlsl | 8 +- .../RWStructuredBuffer-elementtype.hlsl | 5 +- .../StructuredBuffer-elementtype.hlsl | 5 +- .../vk-features/vk.spec-constant.hlsl | 45 +- clang/test/CodeGenOpenCL/amdgpu-features.cl | 2 +- ...ins-amdgcn-gfx1250-async-load-store-lds.cl | 24 + .../builtins-amdgcn-gfx1250-load-tr.cl | 130 + ...iltins-amdgcn-gfx1250-tensor-load-store.cl | 46 + .../CodeGenOpenCL/builtins-amdgcn-gfx1250.cl | 129 + clang/test/DebugInfo/KeyInstructions/atomic.c | 166 + clang/test/DebugInfo/KeyInstructions/flag.cpp | 20 +- .../init-member-memcopyable-2.cpp | 59 + .../init-member-memcopyable.cpp | 62 + clang/test/Driver/HLSL/dxc_fvk_layout.hlsl | 8 + .../aarch64-none-elf/include/c++/8.2.1/.keep | 0 .../aarch64-none-elf/lib/.keep | 0 .../aarch64-none-elf/lib/crt0.o | 0 .../bin/aarch64-none-elf-ld | 1 + .../lib/gcc/aarch64-none-elf/8.2.1/crtbegin.o | 0 .../lib/gcc/aarch64-none-elf/8.2.1/crtend.o | 0 .../aarch64-none-elf/lib/crt0.o | 0 .../aarch64-none-elf/lib/crtbegin.o | 0 .../aarch64-none-elf/lib/crtend.o | 0 .../bin/aarch64-none-elf-ld | 1 + .../armv6m-none-eabi/include/c++/8.2.1/.keep | 0 .../armv6m-none-eabi/lib/.keep | 0 .../armv6m-none-eabi/lib/crt0.o | 0 .../bin/armv6m-none-eabi-ld | 1 + .../lib/gcc/armv6m-none-eabi/8.2.1/crtbegin.o | 0 .../lib/gcc/armv6m-none-eabi/8.2.1/crtend.o | 0 .../armv6m-none-eabi/lib/crt0.o | 0 .../armv6m-none-eabi/lib/crtbegin.o | 0 .../armv6m-none-eabi/lib/crtend.o | 0 .../bin/armv6m-none-eabi-ld | 1 + clang/test/Driver/aarch64-gnutools.c | 4 + .../Driver/aarch64-implied-sve-features.c | 4 +- clang/test/Driver/aarch64-sve-vector-bits.c | 4 + clang/test/Driver/aarch64-toolchain-extra.c | 35 + clang/test/Driver/aarch64-toolchain.c | 159 + .../Driver/amdgpu-openmp-sanitize-options.c | 4 +- clang/test/Driver/arm-gnutools.c | 6 + clang/test/Driver/arm-toolchain-extra.c | 36 + clang/test/Driver/arm-toolchain.c | 160 + clang/test/Driver/autocomplete.c | 1 + clang/test/Driver/baremetal-multilib.yaml | 3 +- clang/test/Driver/baremetal-sysroot.cpp | 8 +- .../test/Driver/baremetal-undefined-symbols.c | 10 + clang/test/Driver/baremetal.cpp | 147 +- clang/test/Driver/check-no-multlib-warning.c | 10 + clang/test/Driver/cl-include.c | 5 + clang/test/Driver/cl-options.c | 6 + clang/test/Driver/dxc_fspv_extension.hlsl | 11 +- clang/test/Driver/dxc_hlsl-rootsig-ver.hlsl | 16 + .../fallow-runtime-check-skip-hot-cutoff.c | 6 + clang/test/Driver/fsanitize.c | 16 +- clang/test/Driver/gcc-toolchain.cpp | 5 - clang/test/Driver/hip-options.hip | 2 +- clang/test/Driver/ir-exception-model.c | 14 + clang/test/Driver/openmp-offload-gpu.c | 2 +- clang/test/Driver/pgo-sample-use-profi.c | 21 +- .../aarch64-fujitsu-monaka.c | 2 +- .../print-enabled-extensions/aarch64-gb10.c | 69 + .../print-enabled-extensions/aarch64-grace.c | 2 +- .../aarch64-olympus.c | 2 +- .../riscv-andes-a25.c | 2 +- .../riscv-andes-a45.c | 2 +- .../riscv-andes-ax25.c | 2 +- .../riscv-andes-ax45.c | 2 +- .../riscv-andes-ax45mpv.c | 2 +- .../riscv-andes-n45.c | 2 +- .../riscv-andes-nx45.c | 2 +- .../riscv-sifive-p870.c | 2 +- .../riscv-sifive-x390.c | 2 +- .../Driver/print-libgcc-file-name-clangrt.c | 9 + .../print-supported-extensions-aarch64.c | 3 +- .../Driver/print-supported-extensions-riscv.c | 4 +- clang/test/Driver/ps5-linker.c | 22 +- clang/test/Driver/riscv-args.c | 6 - clang/test/Driver/riscv-cpus.c | 3 + clang/test/Driver/riscv32-toolchain-extra.c | 7 +- clang/test/Driver/riscv32-toolchain.c | 26 +- clang/test/Driver/riscv64-toolchain-extra.c | 7 +- clang/test/Driver/riscv64-toolchain.c | 20 +- clang/test/Driver/sanitizer-ld.c | 2 +- .../ExtractAPI/constructor_destructor.cpp | 2 +- clang/test/ExtractAPI/global_record.c | 4 +- .../test/ExtractAPI/global_record_multifile.c | 4 +- clang/test/ExtractAPI/macro_undefined.c | 4 +- clang/test/ExtractAPI/pointers.c | 388 + clang/test/Index/inline-assembly.c | 46 + clang/test/Interpreter/out-of-process.cpp | 88 + ...a-attribute-supported-attributes-list.test | 1 + .../Misc/target-invalid-cpu-note/aarch64.c | 1 + clang/test/Modules/ModulesLocalNamespace.cppm | 47 + clang/test/Modules/mingw-exceptions.cppm | 5 + .../Modules/no-transitive-decl-change-4.cppm | 81 + clang/test/Modules/odr_hash.cpp | 23 + clang/test/Modules/pr118137.cppm | 24 + clang/test/Modules/pr145975.cppm | 58 + clang/test/Modules/template-declare.cppm | 39 + .../var-init-side-effects-modulemap.cpp | 51 + clang/test/OpenMP/declare_mapper_messages.c | 63 +- clang/test/OpenMP/declare_target_messages.cpp | 106 +- .../declare_variant_clauses_messages.cpp | 2 +- .../test/OpenMP/openmp-6-future-spellings.cpp | 55 + clang/test/OpenMP/parallel_ast_print.cpp | 42 +- .../OpenMP/parallel_num_threads_messages.cpp | 73 +- clang/test/OpenMP/target_data_ast_print.cpp | 8 +- clang/test/OpenMP/target_map_messages.cpp | 59 +- clang/test/Options/Gis.hlsl | 13 + clang/test/Parser/c23-typeof.m | 7 + clang/test/Parser/c2x-typeof.c | 10 + .../ParserOpenACC/parse-cache-construct.c | 40 +- .../ParserOpenACC/parse-cache-construct.cpp | 18 +- .../Preprocessor/aarch64-target-features.c | 16 +- clang/test/Preprocessor/arm-target-features.c | 5 + .../Preprocessor/macro_paste_identifier_ucn.c | 10 + .../riscv-target-features-andes.c | 10 + clang/test/Sema/Float16.c | 1 + clang/test/Sema/attr-arm-sve-vector-bits.c | 31 +- .../{CodeGen => Sema}/attr-cpuspecific-cpus.c | 4 +- clang/test/Sema/attr-nonstring_safe.c | 51 + clang/test/Sema/attr-visibility.c | 6 + clang/test/Sema/builtins-bcd-transform.c | 30 + clang/test/Sema/builtins-microsoft-arm64.c | 9 + clang/test/Sema/deep_recursion.c | 209 + .../Sema/implicit-int-conversion-on-int.c | 8 + clang/test/Sema/offsetof-64.c | 4 +- .../rvv-andes-required-features-invalid.c | 20 + .../test/Sema/rvv-required-features-invalid.c | 7 + clang/test/Sema/warn-documentation.cpp | 12 + .../Sema/warn-format-overflow-truncation.c | 14 + clang/test/SemaCXX/Float16.cpp | 2 +- clang/test/SemaCXX/P1979.cpp | 38 + ...rch64-streaming-sve-vector-conversions.cpp | 69 + clang/test/SemaCXX/builtin-invoke.cpp | 240 + .../test/SemaCXX/cxx2a-constexpr-dynalloc.cpp | 64 + clang/test/SemaCXX/cxx2c-binding-pack.cpp | 30 +- .../SemaCXX/cxx2c-trivially-relocatable.cpp | 36 + clang/test/SemaCXX/modules.cppm | 4 + clang/test/SemaCXX/nested-name-spec.cpp | 40 +- .../type-traits-unsatisfied-diags-std.cpp | 158 + .../SemaCXX/type-traits-unsatisfied-diags.cpp | 279 + .../test/SemaCXX/unique_object_duplication.h | 45 +- ...ffer-usage-in-container-span-construct.cpp | 60 + .../SemaCXX/wmissing-noreturn-suggestion.cpp | 23 + clang/test/SemaCXX/wreturn-always-throws.cpp | 46 + .../amdgpu-feature-builtins-cant-jump.hip | 62 + ...feature-builtins-return-type-deduction.hip | 31 + clang/test/SemaHLSL/RootSignature-err.hlsl | 4 + .../RootSignature-resource-ranges-err.hlsl | 43 + .../RootSignature-resource-ranges.hlsl | 9 + clang/test/SemaObjCXX/arc-0x.mm | 7 +- clang/test/SemaObjCXX/attr-swift_name-cxx.mm | 36 + .../test/SemaOpenACC/cache-construct-ast.cpp | 91 +- clang/test/SemaOpenACC/cache-construct.cpp | 21 +- .../SemaOpenACC/cache-warn-invalid-varloc.cpp | 29 + .../combined-construct-copyout-ast.cpp | 10 +- .../combined-construct-copyout-clause.c | 8 +- .../compute-construct-copyout-clause.c | 8 +- .../compute-construct-varlist-ast.cpp | 12 +- .../data-construct-copyout-ast.cpp | 6 +- .../data-construct-copyout-clause.c | 12 +- clang/test/SemaOpenACC/declare-construct.cpp | 9 +- clang/test/SemaOpenCL/amd-media-ops.cl | 103 + .../builtins-amdgcn-error-gfx1250-param.cl | 23 + clang/test/lit.cfg.py | 31 +- clang/test/lit.site.cfg.py.in | 4 +- clang/tools/c-index-test/c-index-test.c | 50 + .../clang-fuzzer/handle-llvm/CMakeLists.txt | 1 + .../clang-installapi/ClangInstallAPI.cpp | 4 +- clang/tools/clang-installapi/Options.cpp | 12 +- clang/tools/clang-repl/CMakeLists.txt | 2 + clang/tools/clang-repl/ClangRepl.cpp | 123 +- clang/tools/clang-scan-deps/ClangScanDeps.cpp | 34 +- clang/tools/clang-scan-deps/Opts.td | 1 - clang/tools/libclang/CIndex.cpp | 114 +- clang/tools/libclang/CIndexHigh.cpp | 6 +- clang/tools/libclang/CXIndexDataConsumer.cpp | 6 +- clang/tools/libclang/CXSourceLocation.cpp | 4 +- clang/tools/libclang/Indexing.cpp | 4 +- clang/tools/libclang/libclang.map | 9 + clang/unittests/AST/ASTTraverserTest.cpp | 75 + clang/unittests/AllClangUnitTests.cpp | 28 + clang/unittests/CMakeLists.txt | 1 + clang/unittests/Format/FormatTest.cpp | 29 +- clang/unittests/Format/FormatTestBase.h | 2 +- clang/unittests/Format/FormatTestComments.cpp | 2 +- .../unittests/Format/FormatTestSelective.cpp | 5 + clang/unittests/Format/QualifierFixerTest.cpp | 7 +- clang/unittests/Index/IndexTests.cpp | 4 +- .../Lex/DependencyDirectivesScannerTest.cpp | 31 + clang/unittests/Lex/LexerTest.cpp | 41 +- .../Parse/ParseHLSLRootSignatureTest.cpp | 324 +- .../unittests/Sema/HeuristicResolverTest.cpp | 80 + .../SourceLocationEncodingTest.cpp | 58 - .../DependencyScannerTest.cpp | 55 +- .../DependencyScanningFilesystemTest.cpp | 78 +- clang/utils/TableGen/ClangAttrEmitter.cpp | 10 +- .../TableGen/ClangDiagnosticsEmitter.cpp | 3 +- clang/www/cxx_status.html | 4 +- cmake/Modules/GetClangResourceDir.cmake | 3 +- compiler-rt/cmake/Modules/AddCompilerRT.cmake | 18 + compiler-rt/lib/asan/CMakeLists.txt | 13 + .../lib/asan/asan.link_with_main_exec.txt | 115 + compiler-rt/lib/asan/asan_allocator.cpp | 12 +- compiler-rt/lib/asan/asan_allocator.h | 1 + .../lib/asan/asan_cxx.link_with_main_exec.txt | 21 + compiler-rt/lib/asan/asan_descriptions.cpp | 22 +- compiler-rt/lib/asan/asan_flags.cpp | 32 +- compiler-rt/lib/asan/asan_internal.h | 1 + compiler-rt/lib/asan/asan_new_delete.cpp | 206 +- compiler-rt/lib/asan/asan_rtl.cpp | 52 +- .../lib/asan/tests/asan_noinst_test.cpp | 4 +- compiler-rt/lib/builtins/arm/aeabi_cdcmp.S | 2 +- compiler-rt/lib/builtins/arm/aeabi_cfcmp.S | 2 +- compiler-rt/lib/builtins/arm/aeabi_dcmp.S | 2 +- compiler-rt/lib/builtins/arm/aeabi_fcmp.S | 2 +- compiler-rt/lib/builtins/arm/aeabi_idivmod.S | 2 +- compiler-rt/lib/builtins/arm/aeabi_ldivmod.S | 2 +- compiler-rt/lib/builtins/arm/aeabi_uidivmod.S | 2 +- compiler-rt/lib/builtins/arm/aeabi_uldivmod.S | 2 +- compiler-rt/lib/builtins/assembly.h | 6 + compiler-rt/lib/msan/msan.cpp | 66 +- .../lib/msan/msan_interface_internal.h | 2 + .../lib/tsan/rtl/tsan_interceptors_posix.cpp | 41 + .../lib/tsan/rtl/tsan_interface_java.cpp | 1 - compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cpp | 22 +- compiler-rt/lib/tsan/rtl/tsan_rtl.cpp | 21 +- compiler-rt/lib/tsan/rtl/tsan_rtl_access.cpp | 18 +- compiler-rt/lib/tsan/rtl/tsan_sync.cpp | 14 + .../Windows/alloc_dealloc_mismatch.cpp | 29 + .../test/fuzzer/uncaught-exception.test | 6 +- .../msan_print_shadow_on_outlined_check.cpp | 42 + .../TestCases/Linux/free_aligned_sized.c | 2 +- .../TestCases/Linux/free_sized.c | 2 +- .../ios_commands/iossim_env.py | 12 +- .../ios_commands/iossim_run.py | 12 +- .../test/sanitizer_common/lit.common.cfg.py | 2 +- compiler-rt/test/tsan/java_heap_init2.cpp | 33 + compiler-rt/test/tsan/munmap_clear_shadow.c | 63 + cross-project-tests/CMakeLists.txt | 7 + cross-project-tests/dtlto/README.md | 3 + cross-project-tests/dtlto/ld-dtlto.c | 41 + cross-project-tests/dtlto/lit.local.cfg | 5 + flang-rt/lib/runtime/descriptor-io.cpp | 63 +- flang/CMakeLists.txt | 3 +- flang/docs/Extensions.md | 14 + flang/docs/OpenMP-declare-target.md | 20 +- flang/docs/OpenMP-descriptor-management.md | 11 +- flang/docs/ReleaseNotes.md | 7 + flang/include/flang/Evaluate/complex.h | 2 +- flang/include/flang/Evaluate/tools.h | 11 + flang/include/flang/Lower/AbstractConverter.h | 7 +- flang/include/flang/Lower/LoweringOptions.def | 4 + flang/include/flang/Lower/SymbolMap.h | 4 +- .../flang/Optimizer/Builder/FIRBuilder.h | 4 +- .../flang/Optimizer/Builder/IntrinsicCall.h | 5 +- .../include/flang/Optimizer/CodeGen/CodeGen.h | 3 + .../include/flang/Optimizer/Dialect/FIROps.td | 10 +- .../flang/Optimizer/Dialect/FIRTypes.td | 3 +- .../Optimizer/Dialect/Support/KindMapping.h | 2 +- .../flang/Optimizer/Passes/CommandLineOpts.h | 13 + flang/include/flang/Optimizer/Support/Utils.h | 26 - flang/include/flang/Parser/message.h | 6 +- flang/include/flang/Parser/parse-tree.h | 5 +- .../flang/Semantics/runtime-type-info.h | 4 + .../include/flang/Support/Fortran-features.h | 7 +- flang/include/flang/Support/OpenMP-features.h | 14 +- flang/lib/Evaluate/fold-implementation.h | 105 +- flang/lib/Evaluate/tools.cpp | 5 + flang/lib/Evaluate/type.cpp | 47 +- flang/lib/Frontend/CompilerInvocation.cpp | 50 +- flang/lib/Frontend/FrontendAction.cpp | 13 +- flang/lib/Frontend/FrontendActions.cpp | 4 - flang/lib/Lower/Allocatable.cpp | 25 +- flang/lib/Lower/Bridge.cpp | 24 +- flang/lib/Lower/CallInterface.cpp | 10 +- flang/lib/Lower/ConvertCall.cpp | 4 +- flang/lib/Lower/ConvertConstant.cpp | 7 +- flang/lib/Lower/ConvertExprToHLFIR.cpp | 14 +- flang/lib/Lower/ConvertVariable.cpp | 46 +- flang/lib/Lower/HostAssociations.cpp | 4 +- flang/lib/Lower/Mangler.cpp | 6 +- flang/lib/Lower/OpenACC.cpp | 7 +- flang/lib/Lower/OpenMP/Atomic.cpp | 281 +- .../lib/Lower/OpenMP/DataSharingProcessor.cpp | 2 +- flang/lib/Lower/OpenMP/OpenMP.cpp | 118 +- .../Lower/OpenMP/PrivateReductionUtils.cpp | 32 +- .../lib/Lower/OpenMP/PrivateReductionUtils.h | 4 +- flang/lib/Lower/OpenMP/ReductionProcessor.cpp | 26 +- flang/lib/Lower/SymbolMap.cpp | 4 + flang/lib/Optimizer/Builder/Character.cpp | 2 +- flang/lib/Optimizer/Builder/IntrinsicCall.cpp | 202 +- flang/lib/Optimizer/Builder/MutableBox.cpp | 2 +- .../Optimizer/Builder/PPCIntrinsicCall.cpp | 3 +- flang/lib/Optimizer/CodeGen/CodeGen.cpp | 116 +- flang/lib/Optimizer/CodeGen/FIROpPatterns.cpp | 11 +- flang/lib/Optimizer/CodeGen/TypeConverter.cpp | 4 +- flang/lib/Optimizer/Dialect/FIRType.cpp | 6 +- .../HLFIR/Transforms/ConvertToFIR.cpp | 5 +- .../Transforms/OptimizedBufferization.cpp | 57 +- .../OpenACC/FIROpenACCTypeInterfaces.cpp | 37 +- .../lib/Optimizer/Passes/CommandLineOpts.cpp | 6 + flang/lib/Optimizer/Passes/Pipelines.cpp | 1 + .../lib/Optimizer/Transforms/AddAliasTags.cpp | 30 +- .../lib/Optimizer/Transforms/AddDebugInfo.cpp | 117 +- .../Optimizer/Transforms/CUFDeviceGlobal.cpp | 10 +- .../Transforms/DebugTypeGenerator.cpp | 236 +- .../Optimizer/Transforms/DebugTypeGenerator.h | 74 +- .../Transforms/PolymorphicOpConversion.cpp | 95 +- flang/lib/Parser/message.cpp | 31 +- flang/lib/Parser/openmp-parsers.cpp | 2 +- flang/lib/Parser/preprocessor.cpp | 8 +- flang/lib/Parser/prescan.cpp | 54 +- flang/lib/Parser/prescan.h | 17 +- flang/lib/Parser/token-sequence.cpp | 3 +- flang/lib/Parser/unparse.cpp | 7 +- flang/lib/Semantics/CMakeLists.txt | 8 +- flang/lib/Semantics/canonicalize-omp.cpp | 97 +- .../lib/Semantics/check-directive-structure.h | 2 + flang/lib/Semantics/check-io.cpp | 2 + flang/lib/Semantics/check-omp-atomic.cpp | 1295 ++++ flang/lib/Semantics/check-omp-loop.cpp | 671 ++ .../lib/Semantics/check-omp-metadirective.cpp | 548 ++ flang/lib/Semantics/check-omp-structure.cpp | 2820 +------ flang/lib/Semantics/check-omp-structure.h | 8 - flang/lib/Semantics/openmp-utils.cpp | 393 + flang/lib/Semantics/openmp-utils.h | 66 + flang/lib/Semantics/resolve-directives.cpp | 108 +- flang/lib/Semantics/resolve-names.cpp | 27 +- flang/lib/Semantics/semantics.cpp | 4 +- flang/lib/Support/Fortran-features.cpp | 14 +- flang/module/cooperative_groups.f90 | 56 + .../test/Driver/bbc-openmp-version-macro.f90 | 11 +- .../Driver/flang-openmp-version-macro.f90 | 8 - flang/test/Driver/fopenmp-version.F90 | 25 + flang/test/Driver/fveclib-codegen.f90 | 4 + flang/test/Driver/fveclib.f90 | 3 +- flang/test/Driver/omp-driver-offload.f90 | 6 +- flang/test/Driver/tco-emit-final-mlir.fir | 19 + flang/test/Evaluate/fold-dim.f90 | 2 +- flang/test/Evaluate/fold-nearest.f90 | 22 +- flang/test/Evaluate/fold-out_of_range.f90 | 80 +- flang/test/Evaluate/fold-unsigned.f90 | 2 +- flang/test/Evaluate/folding03.f90 | 76 +- flang/test/Evaluate/folding04.f90 | 22 +- flang/test/Evaluate/folding05.f90 | Bin 10993 -> 11212 bytes flang/test/Evaluate/folding06.f90 | 4 +- flang/test/Evaluate/folding14.f90 | 4 +- flang/test/Evaluate/folding28.f90 | 2 +- flang/test/Fir/CUDA/cuda-device-global.f90 | 13 + .../OpenACC/openacc-type-categories-class.f90 | 46 + .../test/Fir/convert-nontemporal-to-llvm.fir | 18 +- flang/test/Fir/convert-to-llvm.fir | 4 +- flang/test/Fir/simd-nontemporal.fir | 12 +- flang/test/HLFIR/declare-codegen.fir | 18 + flang/test/HLFIR/opt-scalar-assign.fir | 50 +- .../OpenMP/map-types-and-sizes.f90 | 36 +- ...u-target-desc-cast-to-global-addrspace.f90 | 18 + ...ug-cyclic-derived-type-caching-complex.f90 | 116 + ...bug-cyclic-derived-type-caching-simple.f90 | 39 + .../skip-external-rtti-definition.F90 | 47 + flang/test/Lower/CUDA/cuda-cooperative.cuf | 99 + flang/test/Lower/CUDA/cuda-runtime-check.cuf | 38 +- flang/test/Lower/HLFIR/custom-intrinsic.f90 | 16 +- flang/test/Lower/Intrinsics/acosd.f90 | 14 +- flang/test/Lower/Intrinsics/asind.f90 | 14 +- .../Lower/Intrinsics/ieee_class_queries.f90 | 2 +- flang/test/Lower/Intrinsics/product.f90 | 4 +- flang/test/Lower/Intrinsics/sum.f90 | 4 +- flang/test/Lower/OpenMP/atomic-update.f90 | 12 +- .../OpenMP/minmax-optional-parameters.f90 | 68 + ...nested-loop-transformation-construct01.f90 | 20 + ...nested-loop-transformation-construct02.f90 | 20 + .../parallel-firstprivate-clause-scalar.f90 | 20 +- .../OpenMP/reduction-array-intrinsic.f90 | 8 +- .../Lower/OpenMP/target-data-if-false.f90 | 25 + .../OpenMP/target-data-skip-mapper-calls.f90 | 30 + ...oop-reduction-allocatable-array-minmax.f90 | 58 +- .../wsloop-reduction-logical-and-byref.f90 | 8 +- .../OpenMP/wsloop-reduction-logical-and.f90 | 8 +- .../wsloop-reduction-logical-eqv-byref.f90 | 8 +- .../OpenMP/wsloop-reduction-logical-eqv.f90 | 8 +- .../OpenMP/wsloop-reduction-logical-kinds.f90 | 24 + .../wsloop-reduction-logical-neqv-byref.f90 | 8 +- .../OpenMP/wsloop-reduction-logical-neqv.f90 | 8 +- .../wsloop-reduction-logical-or-byref.f90 | 8 +- .../OpenMP/wsloop-reduction-logical-or.f90 | 8 +- .../OpenMP/wsloop-reduction-max-byref.f90 | 10 +- .../Lower/OpenMP/wsloop-reduction-max.f90 | 10 +- .../OpenMP/wsloop-reduction-min-byref.f90 | 10 +- .../Lower/OpenMP/wsloop-reduction-min.f90 | 10 +- flang/test/Lower/complex-operations.f90 | 4 +- flang/test/Lower/math-lowering/aint.f90 | 8 +- flang/test/Lower/select-type-2.f90 | 8 +- flang/test/Lower/select-type.f90 | 72 +- .../variable-common-viewed-as-module-var.f90 | 37 + flang/test/Parser/OpenMP/declare-variant.f90 | 27 + .../loop-transformation-construct01.f90 | 74 + .../loop-transformation-construct02.f90 | 85 + flang/test/Parser/issue-146362.1.f90 | 5 + flang/test/Parser/issue-146362.2.f90 | 18 + flang/test/Preprocessing/bug1077.F90 | 7 + flang/test/Preprocessing/bug518.F | 2 +- flang/test/Preprocessing/pp111.F90 | 2 +- flang/test/Preprocessing/pp112.F90 | 2 +- flang/test/Preprocessing/pp115.F90 | 2 +- flang/test/Preprocessing/pp116.F90 | 2 +- flang/test/Semantics/OpenACC/acc-branch.f90 | 2 +- flang/test/Semantics/OpenACC/acc-data.f90 | 2 +- .../OpenACC/acc-declare-validity.f90 | 2 +- flang/test/Semantics/OpenACC/acc-serial.f90 | 6 +- .../Semantics/OpenMP/allocate-align01.f90 | 2 +- flang/test/Semantics/OpenMP/allocate01.f90 | 2 +- .../Semantics/OpenMP/clause-validity01.f90 | 4 +- .../Semantics/OpenMP/combined-constructs.f90 | 8 +- flang/test/Semantics/OpenMP/copying.f90 | 8 +- .../OpenMP/declarative-directive01.f90 | 8 +- .../Semantics/OpenMP/declare-target01.f90 | 26 +- .../Semantics/OpenMP/declare-target02.f90 | 30 +- .../Semantics/OpenMP/declare-target03.f90 | 2 +- .../Semantics/OpenMP/declare-target06.f90 | 2 +- flang/test/Semantics/OpenMP/deprecation.f90 | 12 +- .../Semantics/OpenMP/do05-positivecase.f90 | 14 + .../loop-transformation-construct01.f90 | 100 + flang/test/Semantics/OpenMP/nested-target.f90 | 14 +- flang/test/Semantics/OpenMP/requires04.f90 | 2 +- flang/test/Semantics/OpenMP/requires05.f90 | 2 +- flang/test/Semantics/OpenMP/single03.f90 | 2 +- flang/test/Semantics/OpenMP/single04.f90 | 12 +- flang/test/Semantics/OpenMP/target01.f90 | 8 +- .../test/Semantics/OpenMP/threadprivate03.f90 | 2 +- .../test/Semantics/OpenMP/use_device_ptr1.f90 | 2 +- flang/test/Semantics/allocate09.f90 | 4 +- flang/test/Semantics/argshape01.f90 | 4 +- flang/test/Semantics/assign02.f90 | 14 +- flang/test/Semantics/assign09.f90 | 4 +- flang/test/Semantics/associate01.f90 | 2 +- flang/test/Semantics/associated.f90 | 14 +- flang/test/Semantics/bind-c02.f90 | 4 +- flang/test/Semantics/bind-c04.f90 | 2 +- flang/test/Semantics/bind-c06.f90 | 6 +- flang/test/Semantics/bind-c11.f90 | 2 +- flang/test/Semantics/bind-c13.f90 | 4 +- flang/test/Semantics/bind-c17.f90 | 2 +- flang/test/Semantics/bindings01.f90 | 6 +- flang/test/Semantics/bindings03.f90 | 4 +- flang/test/Semantics/block-data01.f90 | 2 +- .../test/Semantics/boz-literal-constants.f90 | 2 +- flang/test/Semantics/bug1046.f90 | 15 + flang/test/Semantics/bug1056.f90 | 13 + flang/test/Semantics/bug1092.F90 | 26 + flang/test/Semantics/bug144453.f90 | 10 + flang/test/Semantics/c7108.f90 | 4 +- flang/test/Semantics/c_f_pointer.f90 | 8 +- flang/test/Semantics/c_loc01.f90 | 6 +- flang/test/Semantics/call01.f90 | 6 +- flang/test/Semantics/call02.f90 | 6 +- flang/test/Semantics/call03.f90 | 12 +- flang/test/Semantics/call05.f90 | 4 +- flang/test/Semantics/call07.f90 | 6 +- flang/test/Semantics/call09.f90 | 2 +- flang/test/Semantics/call10.f90 | 2 +- flang/test/Semantics/call14.f90 | 4 +- flang/test/Semantics/call24.f90 | 2 +- flang/test/Semantics/call27.f90 | 4 +- flang/test/Semantics/call30.f90 | 30 +- flang/test/Semantics/call31.f90 | 4 +- flang/test/Semantics/call33.f90 | 2 +- flang/test/Semantics/call34.f90 | 6 +- flang/test/Semantics/call35.f90 | 4 +- flang/test/Semantics/call36.f90 | 2 +- flang/test/Semantics/call37.f90 | 14 +- flang/test/Semantics/call38.f90 | 4 +- flang/test/Semantics/call41.f90 | 2 +- flang/test/Semantics/call42.f90 | 12 +- flang/test/Semantics/call43.f90 | 6 +- flang/test/Semantics/call44.f90 | 4 +- flang/test/Semantics/case01.f90 | 12 +- flang/test/Semantics/common-blocks.f90 | 4 +- flang/test/Semantics/contiguous01.f90 | 16 +- flang/test/Semantics/cuf01.cuf | 8 +- flang/test/Semantics/cuf03.cuf | 10 +- flang/test/Semantics/cuf04.cuf | 4 +- flang/test/Semantics/cuf09.cuf | 2 +- flang/test/Semantics/data06.f90 | 4 +- flang/test/Semantics/data17.f90 | 4 +- flang/test/Semantics/declarations04.f90 | 2 +- flang/test/Semantics/declarations05.f90 | 2 +- flang/test/Semantics/declarations07.f90 | 4 +- flang/test/Semantics/deferred01.f90 | 2 +- flang/test/Semantics/definable02.f90 | 4 +- flang/test/Semantics/dim01.f90 | 16 +- flang/test/Semantics/dosemantics02.f90 | 4 +- flang/test/Semantics/dosemantics03.f90 | 36 +- flang/test/Semantics/dosemantics12.f90 | 6 +- flang/test/Semantics/expr-errors05.f90 | 14 +- flang/test/Semantics/expr-errors06.f90 | 2 +- flang/test/Semantics/final03.f90 | 2 +- flang/test/Semantics/forall01.f90 | 22 +- flang/test/Semantics/forall02.f90 | 6 +- .../Semantics/function-result-extent-max.f90 | 30 + flang/test/Semantics/generic03.f90 | 2 +- flang/test/Semantics/generic06.f90 | 4 +- flang/test/Semantics/global01.f90 | 4 +- flang/test/Semantics/ichar01.f90 | 4 +- flang/test/Semantics/ignore_tkr01.f90 | 10 +- flang/test/Semantics/int-literals.f90 | 4 +- flang/test/Semantics/intrinsics02.f90 | 2 +- flang/test/Semantics/kinds05b.f90 | 4 +- flang/test/Semantics/label18.f90 | 4 +- flang/test/Semantics/local-vs-global.f90 | 32 +- flang/test/Semantics/long-name.f90 | 6 +- flang/test/Semantics/modfile43.f90 | 2 +- flang/test/Semantics/null-init.f90 | 2 +- flang/test/Semantics/null01.f90 | 6 +- flang/test/Semantics/pointer01.f90 | 2 +- flang/test/Semantics/procinterface02.f90 | 2 +- flang/test/Semantics/procinterface04.f90 | 4 +- flang/test/Semantics/resolve05.f90 | 8 +- flang/test/Semantics/resolve108.f90 | 4 +- flang/test/Semantics/resolve11.f90 | 4 +- flang/test/Semantics/resolve114.f90 | 20 +- flang/test/Semantics/resolve118.f90 | 2 +- flang/test/Semantics/resolve17.f90 | 6 +- flang/test/Semantics/resolve18.f90 | 8 +- flang/test/Semantics/resolve20.f90 | 4 +- flang/test/Semantics/resolve24.f90 | 8 +- flang/test/Semantics/resolve30.f90 | 2 +- flang/test/Semantics/resolve31.f90 | 8 +- flang/test/Semantics/resolve35.f90 | 10 +- flang/test/Semantics/resolve37.f90 | 14 +- flang/test/Semantics/resolve45.f90 | 6 +- flang/test/Semantics/resolve46.f90 | 4 +- flang/test/Semantics/resolve55.f90 | 20 + flang/test/Semantics/resolve58.f90 | 8 +- flang/test/Semantics/resolve59.f90 | 6 +- flang/test/Semantics/resolve60.f90 | 2 +- flang/test/Semantics/resolve61.f90 | 2 +- flang/test/Semantics/resolve65.f90 | 4 +- flang/test/Semantics/resolve67.f90 | 4 +- flang/test/Semantics/resolve69.f90 | 6 +- flang/test/Semantics/resolve77.f90 | 4 +- flang/test/Semantics/resolve78.f90 | 10 +- flang/test/Semantics/resolve79.f90 | 10 +- flang/test/Semantics/resolve80.f90 | 12 +- flang/test/Semantics/resolve81.f90 | 38 +- flang/test/Semantics/resolve82.f90 | 20 +- flang/test/Semantics/resolve83.f90 | 12 +- flang/test/Semantics/resolve85.f90 | 10 +- flang/test/Semantics/resolve90.f90 | 2 +- flang/test/Semantics/resolve99.f90 | 4 +- flang/test/Semantics/separate-mp02.f90 | 2 +- flang/test/Semantics/spec-expr.f90 | 2 +- flang/test/Semantics/stmt-func01.f90 | 16 +- flang/test/Semantics/stmt-func02.f90 | 6 +- flang/test/Semantics/structconst03.f90 | 2 +- flang/test/Semantics/structconst04.f90 | 2 +- flang/test/Semantics/structconst08.f90 | 10 +- flang/test/Semantics/structconst10.f90 | 8 +- flang/test/Semantics/symbol15.f90 | 19 +- flang/test/Semantics/transfer01.f90 | 10 +- flang/test/Semantics/undef-result01.f90 | 8 +- flang/test/Semantics/windows.f90 | 2 +- .../test/Transforms/debug-omp-target-op-1.fir | 40 + .../test/Transforms/debug-omp-target-op-2.fir | 53 + flang/test/Transforms/tbaa-for-local-vars.fir | 92 + .../Transforms/tbaa-with-dummy-scope2.fir | 9 +- flang/test/lib/OpenACC/CMakeLists.txt | 4 + .../lib/OpenACC/TestOpenACCInterfaces.cpp | 9 + flang/tools/bbc/bbc.cpp | 1 + flang/tools/f18/CMakeLists.txt | 16 +- flang/tools/tco/tco.cpp | 11 +- .../unittests/Common/FortranFeaturesTest.cpp | 8 + libc/config/gpu/amdgpu/entrypoints.txt | 18 + libc/config/gpu/nvptx/entrypoints.txt | 18 + libc/config/linux/arm/entrypoints.txt | 2 + libc/config/linux/x86_64/entrypoints.txt | 4 + libc/include/llvm-libc-types/jmp_buf.h | 2 +- libc/include/wchar.yaml | 29 + libc/src/__support/CPP/new.h | 8 + libc/src/__support/GPU/allocator.cpp | 59 +- libc/src/__support/GPU/allocator.h | 2 + libc/src/__support/macros/optimization.h | 4 +- .../macros/properties/cpu_features.h | 2 +- libc/src/__support/wchar/CMakeLists.txt | 3 + .../__support/wchar/character_converter.cpp | 25 +- .../src/__support/wchar/character_converter.h | 1 + libc/src/__support/wchar/mbrtowc.cpp | 7 +- libc/src/__support/wchar/wcrtomb.cpp | 5 +- libc/src/setjmp/arm/CMakeLists.txt | 16 + libc/src/setjmp/arm/sigsetjmp.cpp | 65 + libc/src/stdlib/gpu/aligned_alloc.cpp | 18 +- libc/src/stdlib/gpu/realloc.cpp | 20 +- libc/src/string/memory_utils/CMakeLists.txt | 1 + .../string/memory_utils/arm/inline_memcpy.h | 217 + libc/src/string/memory_utils/inline_memcpy.h | 3 + libc/src/string/memory_utils/utils.h | 2 +- libc/src/wchar/CMakeLists.txt | 45 + libc/src/wchar/mbrtowc.cpp | 2 +- libc/src/wchar/wcpncpy.h | 2 +- libc/src/wchar/wcrtomb.cpp | 2 +- libc/src/wchar/wcscspn.cpp | 34 + libc/src/wchar/wcscspn.h | 22 + libc/src/wchar/wcsnlen.cpp | 25 + libc/src/wchar/wcsnlen.h | 22 + libc/src/wchar/wcsspn.h | 2 +- libc/src/wchar/wcstok.cpp | 50 + libc/src/wchar/wcstok.h | 22 + libc/src/wchar/wctomb.cpp | 35 + libc/src/wchar/wctomb.h | 22 + .../integration/src/stdlib/gpu/CMakeLists.txt | 30 + .../src/stdlib/gpu/aligned_alloc.cpp | 29 + .../integration/src/stdlib/gpu/malloc.cpp | 1 + .../integration/src/stdlib/gpu/realloc.cpp | 44 + .../src/__support/wchar/utf32_to_8_test.cpp | 42 + .../src/__support/wchar/utf8_to_32_test.cpp | 11 +- libc/test/src/math/tanpif16_test.cpp | 2 +- libc/test/src/wchar/CMakeLists.txt | 47 + libc/test/src/wchar/mbrtowc_test.cpp | 63 +- libc/test/src/wchar/wcrtomb_test.cpp | 39 +- libc/test/src/wchar/wcscspn_test.cpp | 67 + libc/test/src/wchar/wcsnlen_test.cpp | 54 + libc/test/src/wchar/wcstok_test.cpp | 181 + libc/test/src/wchar/wctomb_test.cpp | 73 + libclc/CMakeLists.txt | 3 + libclc/clc/include/clc/clcmacro.h | 218 - libclc/clc/include/clc/common/clc_degrees.h | 4 +- libclc/clc/include/clc/common/clc_radians.h | 4 +- libclc/clc/include/clc/common/clc_sign.h | 4 +- libclc/clc/include/clc/common/clc_step.h | 4 +- .../clc/include/clc/geometric/binary_decl.inc | 4 +- .../clc/include/clc/geometric/binary_def.inc | 6 +- .../clc/include/clc/geometric/clc_distance.h | 4 +- libclc/clc/include/clc/geometric/clc_dot.h | 4 +- .../include/clc/geometric/clc_fast_distance.h | 5 +- .../include/clc/geometric/clc_fast_length.h | 5 +- .../clc/geometric/clc_fast_normalize.h | 5 +- libclc/clc/include/clc/geometric/clc_length.h | 4 +- .../clc/include/clc/geometric/clc_normalize.h | 4 +- .../clc/include/clc/geometric/unary_decl.inc | 2 +- .../clc/include/clc/geometric/unary_def.inc | 6 +- libclc/clc/include/clc/integer/clc_add_sat.h | 4 +- libclc/clc/include/clc/integer/clc_clz.h | 4 +- libclc/clc/include/clc/integer/clc_ctz.h | 4 +- libclc/clc/include/clc/integer/clc_hadd.h | 4 +- libclc/clc/include/clc/integer/clc_mad24.h | 4 +- libclc/clc/include/clc/integer/clc_mad_sat.h | 4 +- libclc/clc/include/clc/integer/clc_mul24.h | 4 +- libclc/clc/include/clc/integer/clc_mul_hi.h | 4 +- libclc/clc/include/clc/integer/clc_popcount.h | 4 +- libclc/clc/include/clc/integer/clc_rhadd.h | 4 +- libclc/clc/include/clc/integer/clc_rotate.h | 4 +- libclc/clc/include/clc/integer/clc_sub_sat.h | 4 +- .../include/clc/internal/math/clc_sw_fma.h | 4 +- .../binary_decl_with_scalar_second_arg.inc | 8 +- .../include/clc/math/binary_def_via_fp32.inc | 6 +- libclc/clc/include/clc/math/clc_acos.h | 4 +- libclc/clc/include/clc/math/clc_acosh.h | 4 +- libclc/clc/include/clc/math/clc_acospi.h | 4 +- libclc/clc/include/clc/math/clc_asin.h | 4 +- libclc/clc/include/clc/math/clc_asinh.h | 4 +- libclc/clc/include/clc/math/clc_asinpi.h | 4 +- libclc/clc/include/clc/math/clc_atan.h | 4 +- libclc/clc/include/clc/math/clc_atan2.h | 4 +- libclc/clc/include/clc/math/clc_atan2pi.h | 4 +- libclc/clc/include/clc/math/clc_atanh.h | 4 +- libclc/clc/include/clc/math/clc_atanpi.h | 4 +- libclc/clc/include/clc/math/clc_cbrt.inc | 4 +- libclc/clc/include/clc/math/clc_ceil.h | 4 +- libclc/clc/include/clc/math/clc_copysign.h | 4 +- libclc/clc/include/clc/math/clc_cos.h | 4 +- libclc/clc/include/clc/math/clc_cosh.h | 4 +- libclc/clc/include/clc/math/clc_cospi.h | 4 +- libclc/clc/include/clc/math/clc_erf.h | 4 +- libclc/clc/include/clc/math/clc_erfc.h | 4 +- libclc/clc/include/clc/math/clc_exp.h | 4 +- libclc/clc/include/clc/math/clc_exp10.h | 4 +- libclc/clc/include/clc/math/clc_exp2.h | 4 +- libclc/clc/include/clc/math/clc_exp_helper.h | 2 - libclc/clc/include/clc/math/clc_expm1.h | 4 +- libclc/clc/include/clc/math/clc_fabs.h | 4 +- libclc/clc/include/clc/math/clc_fdim.h | 4 +- libclc/clc/include/clc/math/clc_floor.h | 4 +- libclc/clc/include/clc/math/clc_fma.h | 4 +- libclc/clc/include/clc/math/clc_fmax.h | 4 +- libclc/clc/include/clc/math/clc_fmin.h | 4 +- libclc/clc/include/clc/math/clc_fmod.h | 4 +- libclc/clc/include/clc/math/clc_fract.h | 4 +- libclc/clc/include/clc/math/clc_frexp.h | 4 +- libclc/clc/include/clc/math/clc_half_cos.h | 5 +- libclc/clc/include/clc/math/clc_half_divide.h | 5 +- libclc/clc/include/clc/math/clc_half_exp.h | 5 +- libclc/clc/include/clc/math/clc_half_exp10.h | 5 +- libclc/clc/include/clc/math/clc_half_exp2.h | 5 +- libclc/clc/include/clc/math/clc_half_log.h | 5 +- libclc/clc/include/clc/math/clc_half_log10.h | 5 +- libclc/clc/include/clc/math/clc_half_log2.h | 5 +- libclc/clc/include/clc/math/clc_half_powr.h | 5 +- libclc/clc/include/clc/math/clc_half_recip.h | 5 +- libclc/clc/include/clc/math/clc_half_rsqrt.h | 5 +- libclc/clc/include/clc/math/clc_half_sin.h | 5 +- libclc/clc/include/clc/math/clc_half_sqrt.h | 5 +- libclc/clc/include/clc/math/clc_half_tan.h | 5 +- libclc/clc/include/clc/math/clc_hypot.h | 4 +- libclc/clc/include/clc/math/clc_ilogb.h | 4 +- libclc/clc/include/clc/math/clc_lgamma.h | 4 +- libclc/clc/include/clc/math/clc_lgamma_r.h | 4 +- libclc/clc/include/clc/math/clc_log.h | 4 +- libclc/clc/include/clc/math/clc_log10.h | 4 +- libclc/clc/include/clc/math/clc_log1p.h | 4 +- libclc/clc/include/clc/math/clc_log2.h | 4 +- libclc/clc/include/clc/math/clc_logb.h | 4 +- libclc/clc/include/clc/math/clc_mad.h | 4 +- libclc/clc/include/clc/math/clc_maxmag.h | 4 +- libclc/clc/include/clc/math/clc_minmag.h | 4 +- libclc/clc/include/clc/math/clc_modf.h | 4 +- libclc/clc/include/clc/math/clc_nan.h | 4 +- libclc/clc/include/clc/math/clc_nan.inc | 1 + libclc/clc/include/clc/math/clc_native_cos.h | 5 +- .../clc/include/clc/math/clc_native_divide.h | 5 +- libclc/clc/include/clc/math/clc_native_exp.h | 5 +- .../clc/include/clc/math/clc_native_exp10.h | 5 +- libclc/clc/include/clc/math/clc_native_exp2.h | 5 +- libclc/clc/include/clc/math/clc_native_log.h | 5 +- .../clc/include/clc/math/clc_native_log10.h | 5 +- libclc/clc/include/clc/math/clc_native_log2.h | 5 +- libclc/clc/include/clc/math/clc_native_powr.h | 5 +- .../clc/include/clc/math/clc_native_recip.h | 5 +- .../clc/include/clc/math/clc_native_rsqrt.h | 5 +- libclc/clc/include/clc/math/clc_native_sin.h | 5 +- libclc/clc/include/clc/math/clc_native_sqrt.h | 5 +- libclc/clc/include/clc/math/clc_native_tan.h | 5 +- libclc/clc/include/clc/math/clc_nextafter.h | 4 +- libclc/clc/include/clc/math/clc_pow.h | 4 +- libclc/clc/include/clc/math/clc_pown.h | 6 +- libclc/clc/include/clc/math/clc_powr.h | 4 +- libclc/clc/include/clc/math/clc_remainder.h | 4 +- libclc/clc/include/clc/math/clc_remquo.h | 4 +- libclc/clc/include/clc/math/clc_rint.h | 4 +- libclc/clc/include/clc/math/clc_rootn.h | 6 +- libclc/clc/include/clc/math/clc_round.h | 4 +- libclc/clc/include/clc/math/clc_rsqrt.h | 4 +- libclc/clc/include/clc/math/clc_sin.h | 4 +- libclc/clc/include/clc/math/clc_sincos.h | 4 +- .../clc/include/clc/math/clc_sincos_helpers.h | 4 - libclc/clc/include/clc/math/clc_sinh.h | 4 +- libclc/clc/include/clc/math/clc_sinpi.h | 4 +- libclc/clc/include/clc/math/clc_sqrt.h | 4 +- libclc/clc/include/clc/math/clc_tan.h | 4 +- libclc/clc/include/clc/math/clc_tanh.h | 4 +- libclc/clc/include/clc/math/clc_tanpi.h | 4 +- libclc/clc/include/clc/math/clc_tgamma.h | 4 +- libclc/clc/include/clc/math/clc_trunc.h | 4 +- libclc/clc/include/clc/math/gentype.inc | 4 + libclc/clc/include/clc/math/remquo_decl.inc | 20 +- libclc/clc/include/clc/math/unary_decl.inc | 2 +- .../clc/math/unary_decl_with_int_ptr.inc | 16 +- .../clc/math/unary_decl_with_int_return.inc | 2 +- .../include/clc/math/unary_decl_with_ptr.inc | 16 +- .../include/clc/math/unary_def_via_fp32.inc | 4 +- .../clc/math/unary_def_with_int_ptr.inc | 12 +- .../clc/math/unary_def_with_int_return.inc | 6 +- .../include/clc/math/unary_def_with_ptr.inc | 12 +- libclc/clc/include/clc/misc/clc_shuffle.h | 4 +- libclc/clc/include/clc/misc/clc_shuffle2.h | 4 +- libclc/clc/include/clc/misc/shuffle2_decl.inc | 16 +- libclc/clc/include/clc/misc/shuffle2_def.inc | 12 +- libclc/clc/include/clc/misc/shuffle_decl.inc | 8 +- libclc/clc/include/clc/misc/shuffle_def.inc | 12 +- .../include/clc/relational/binary_decl.inc | 3 +- .../clc/include/clc/relational/clc_isfinite.h | 4 +- .../include/clc/relational/clc_isgreater.h | 4 +- .../clc/relational/clc_isgreaterequal.h | 4 +- .../clc/include/clc/relational/clc_isless.h | 4 +- .../include/clc/relational/clc_islessequal.h | 4 +- .../clc/relational/clc_islessgreater.h | 4 +- .../clc/include/clc/relational/clc_isnormal.h | 4 +- .../include/clc/relational/clc_isnotequal.h | 4 +- .../include/clc/relational/clc_isordered.h | 4 +- .../include/clc/relational/clc_isunordered.h | 4 +- .../clc/include/clc/relational/clc_signbit.h | 4 +- .../clc/include/clc/relational/unary_decl.inc | 2 +- libclc/clc/include/clc/shared/binary_decl.inc | 4 +- .../binary_decl_with_int_second_arg.inc | 3 +- .../binary_decl_with_scalar_second_arg.inc | 8 +- libclc/clc/include/clc/shared/binary_def.inc | 6 +- .../clc/shared/binary_def_scalarize.inc | 131 + .../binary_def_with_int_second_arg.inc | 6 +- .../binary_def_with_scalar_second_arg.inc | 8 +- .../clc/include/clc/shared/ternary_decl.inc | 5 +- libclc/clc/include/clc/shared/ternary_def.inc | 6 +- .../clc/shared/ternary_def_scalarize.inc | 153 + libclc/clc/include/clc/shared/unary_decl.inc | 2 +- libclc/clc/include/clc/shared/unary_def.inc | 6 +- .../clc/shared/unary_def_scalarize.inc | 97 + libclc/clc/lib/amdgcn/math/clc_fmax.cl | 8 +- libclc/clc/lib/amdgcn/math/clc_fmin.cl | 8 +- .../clc/lib/amdgcn/math/clc_ldexp_override.cl | 17 +- libclc/clc/lib/amdgpu/math/clc_native_exp2.cl | 11 +- libclc/clc/lib/amdgpu/math/clc_sqrt_fp64.cl | 5 +- libclc/clc/lib/clspv/math/clc_sw_fma.cl | 6 +- libclc/clc/lib/generic/integer/clc_add_sat.cl | 2 +- libclc/clc/lib/generic/integer/clc_clz.cl | 11 +- libclc/clc/lib/generic/integer/clc_ctz.cl | 11 +- .../clc/lib/generic/integer/clc_popcount.cl | 2 +- libclc/clc/lib/generic/integer/clc_sub_sat.cl | 2 +- libclc/clc/lib/generic/math/clc_ceil.cl | 2 +- libclc/clc/lib/generic/math/clc_copysign.cl | 28 +- libclc/clc/lib/generic/math/clc_erf.cl | 14 +- libclc/clc/lib/generic/math/clc_erfc.cl | 14 +- libclc/clc/lib/generic/math/clc_fabs.cl | 2 +- libclc/clc/lib/generic/math/clc_floor.cl | 2 +- libclc/clc/lib/generic/math/clc_fmax.cl | 28 +- libclc/clc/lib/generic/math/clc_fmin.cl | 27 +- libclc/clc/lib/generic/math/clc_fmod.cl | 18 +- libclc/clc/lib/generic/math/clc_half_cos.cl | 2 +- libclc/clc/lib/generic/math/clc_half_exp.cl | 2 +- libclc/clc/lib/generic/math/clc_half_exp10.cl | 2 +- libclc/clc/lib/generic/math/clc_half_exp2.cl | 2 +- libclc/clc/lib/generic/math/clc_half_log.cl | 2 +- libclc/clc/lib/generic/math/clc_half_log10.cl | 2 +- libclc/clc/lib/generic/math/clc_half_log2.cl | 2 +- libclc/clc/lib/generic/math/clc_half_powr.cl | 2 +- libclc/clc/lib/generic/math/clc_half_rsqrt.cl | 2 +- libclc/clc/lib/generic/math/clc_half_sin.cl | 2 +- libclc/clc/lib/generic/math/clc_half_sqrt.cl | 2 +- libclc/clc/lib/generic/math/clc_half_tan.cl | 2 +- libclc/clc/lib/generic/math/clc_ldexp.cl | 12 +- libclc/clc/lib/generic/math/clc_lgamma_r.cl | 7 + libclc/clc/lib/generic/math/clc_log.cl | 10 +- libclc/clc/lib/generic/math/clc_log10.cl | 12 +- libclc/clc/lib/generic/math/clc_log2.cl | 12 +- libclc/clc/lib/generic/math/clc_nan.inc | 4 + libclc/clc/lib/generic/math/clc_native_cos.cl | 2 +- libclc/clc/lib/generic/math/clc_native_exp.cl | 2 +- .../clc/lib/generic/math/clc_native_exp2.cl | 2 +- libclc/clc/lib/generic/math/clc_native_log.cl | 2 +- .../clc/lib/generic/math/clc_native_log10.cl | 2 +- .../clc/lib/generic/math/clc_native_log2.cl | 2 +- libclc/clc/lib/generic/math/clc_native_sin.cl | 2 +- .../clc/lib/generic/math/clc_native_sqrt.cl | 2 +- libclc/clc/lib/generic/math/clc_pow.inc | 13 +- libclc/clc/lib/generic/math/clc_pown.inc | 13 +- libclc/clc/lib/generic/math/clc_powr.inc | 13 +- libclc/clc/lib/generic/math/clc_remainder.cl | 19 +- libclc/clc/lib/generic/math/clc_rint.cl | 2 +- libclc/clc/lib/generic/math/clc_rootn.inc | 13 +- libclc/clc/lib/generic/math/clc_round.cl | 2 +- .../lib/generic/math/clc_sincos_helpers.cl | 4 - libclc/clc/lib/generic/math/clc_sw_fma.cl | 6 +- libclc/clc/lib/generic/math/clc_tgamma.cl | 14 +- libclc/clc/lib/generic/math/clc_trunc.cl | 2 +- libclc/clc/lib/r600/math/clc_fmax.cl | 15 +- libclc/clc/lib/r600/math/clc_fmin.cl | 15 +- libclc/clc/lib/r600/math/clc_native_rsqrt.cl | 5 +- .../clc/lib/r600/math/clc_rsqrt_override.cl | 12 +- libclc/cmake/modules/AddLibclc.cmake | 117 +- .../include/clc/opencl/atomic/atom_add.h | 6 +- .../include/clc/opencl/atomic/atom_and.h | 6 +- .../clc/opencl/atomic/atom_decl_int32.inc | 4 +- .../clc/opencl/atomic/atom_decl_int64.inc | 4 +- .../include/clc/opencl/atomic/atom_max.h | 6 +- .../include/clc/opencl/atomic/atom_min.h | 6 +- .../include/clc/opencl/atomic/atom_or.h | 6 +- .../include/clc/opencl/atomic/atom_sub.h | 6 +- .../include/clc/opencl/atomic/atom_xchg.h | 6 +- .../include/clc/opencl/atomic/atom_xor.h | 6 +- .../include/clc/opencl/atomic/atomic_add.h | 2 +- .../include/clc/opencl/atomic/atomic_and.h | 2 +- .../include/clc/opencl/atomic/atomic_decl.inc | 4 +- .../include/clc/opencl/atomic/atomic_max.h | 2 +- .../include/clc/opencl/atomic/atomic_min.h | 2 +- .../include/clc/opencl/atomic/atomic_or.h | 2 +- .../include/clc/opencl/atomic/atomic_sub.h | 2 +- .../include/clc/opencl/atomic/atomic_xchg.h | 6 +- .../include/clc/opencl/atomic/atomic_xor.h | 2 +- libclc/opencl/include/clc/opencl/clc.h | 14 +- .../include/clc/opencl/common/degrees.h | 4 +- .../include/clc/opencl/common/radians.h | 4 +- .../opencl/include/clc/opencl/common/sign.h | 4 +- .../include/clc/opencl/geometric/distance.h | 4 +- .../opencl/include/clc/opencl/geometric/dot.h | 4 +- .../clc/opencl/geometric/fast_distance.h | 5 +- .../clc/opencl/geometric/fast_length.h | 5 +- .../clc/opencl/geometric/fast_normalize.h | 5 +- .../include/clc/opencl/geometric/length.h | 4 +- .../include/clc/opencl/geometric/normalize.h | 4 +- .../opencl/include/clc/opencl/integer/abs.h | 7 + .../include/clc/opencl/integer/abs_diff.h | 7 + .../include/clc/opencl/integer/add_sat.h | 11 +- .../opencl/include/clc/opencl/integer/clz.h | 11 +- .../opencl/include/clc/opencl/integer/ctz.h | 11 +- .../opencl/include/clc/opencl/integer/hadd.h | 11 +- .../opencl/include/clc/opencl/integer/mad24.h | 11 +- .../include/clc/opencl/integer/mad_hi.h | 11 +- .../include/clc/opencl/integer/mad_sat.h | 11 +- .../opencl/include/clc/opencl/integer/mul24.h | 11 +- .../include/clc/opencl/integer/mul_hi.h | 11 +- .../include/clc/opencl/integer/popcount.h | 11 +- .../opencl/include/clc/opencl/integer/rhadd.h | 9 +- .../include/clc/opencl/integer/rotate.h | 11 +- .../include/clc/opencl/integer/sub_sat.h | 9 +- .../include/clc/opencl/integer/upsample.h | 7 + libclc/opencl/include/clc/opencl/math/acos.h | 4 +- libclc/opencl/include/clc/opencl/math/acosh.h | 4 +- .../opencl/include/clc/opencl/math/acospi.h | 4 +- libclc/opencl/include/clc/opencl/math/asin.h | 4 +- libclc/opencl/include/clc/opencl/math/asinh.h | 4 +- .../opencl/include/clc/opencl/math/asinpi.h | 4 +- libclc/opencl/include/clc/opencl/math/atan.h | 4 +- libclc/opencl/include/clc/opencl/math/atan2.h | 4 +- .../opencl/include/clc/opencl/math/atan2pi.h | 4 +- libclc/opencl/include/clc/opencl/math/atanh.h | 4 +- .../opencl/include/clc/opencl/math/atanpi.h | 4 +- libclc/opencl/include/clc/opencl/math/cbrt.h | 4 +- libclc/opencl/include/clc/opencl/math/ceil.h | 4 +- .../opencl/include/clc/opencl/math/copysign.h | 4 +- libclc/opencl/include/clc/opencl/math/cos.h | 4 +- libclc/opencl/include/clc/opencl/math/cosh.h | 4 +- libclc/opencl/include/clc/opencl/math/cospi.h | 4 +- libclc/opencl/include/clc/opencl/math/erf.h | 4 +- libclc/opencl/include/clc/opencl/math/erfc.h | 4 +- libclc/opencl/include/clc/opencl/math/exp.h | 4 +- libclc/opencl/include/clc/opencl/math/exp10.h | 4 +- libclc/opencl/include/clc/opencl/math/exp2.h | 4 +- libclc/opencl/include/clc/opencl/math/expm1.h | 4 +- libclc/opencl/include/clc/opencl/math/fabs.h | 4 +- libclc/opencl/include/clc/opencl/math/fdim.h | 4 +- libclc/opencl/include/clc/opencl/math/floor.h | 4 +- libclc/opencl/include/clc/opencl/math/fma.h | 4 +- libclc/opencl/include/clc/opencl/math/fmax.h | 4 +- libclc/opencl/include/clc/opencl/math/fmin.h | 4 +- libclc/opencl/include/clc/opencl/math/fmod.h | 4 +- libclc/opencl/include/clc/opencl/math/fract.h | 4 +- libclc/opencl/include/clc/opencl/math/frexp.h | 4 +- .../opencl/include/clc/opencl/math/half_cos.h | 5 +- .../include/clc/opencl/math/half_divide.h | 4 +- .../opencl/include/clc/opencl/math/half_exp.h | 5 +- .../include/clc/opencl/math/half_exp10.h | 5 +- .../include/clc/opencl/math/half_exp2.h | 5 +- .../opencl/include/clc/opencl/math/half_log.h | 5 +- .../include/clc/opencl/math/half_log10.h | 5 +- .../include/clc/opencl/math/half_log2.h | 5 +- .../include/clc/opencl/math/half_powr.h | 4 +- .../include/clc/opencl/math/half_recip.h | 5 +- .../include/clc/opencl/math/half_rsqrt.h | 5 +- .../opencl/include/clc/opencl/math/half_sin.h | 5 +- .../include/clc/opencl/math/half_sqrt.h | 5 +- .../opencl/include/clc/opencl/math/half_tan.h | 5 +- libclc/opencl/include/clc/opencl/math/hypot.h | 4 +- libclc/opencl/include/clc/opencl/math/ilogb.h | 4 +- libclc/opencl/include/clc/opencl/math/ldexp.h | 5 + .../opencl/include/clc/opencl/math/ldexp.inc | 4 +- .../opencl/include/clc/opencl/math/lgamma.h | 4 +- .../opencl/include/clc/opencl/math/lgamma_r.h | 4 +- libclc/opencl/include/clc/opencl/math/log.h | 4 +- libclc/opencl/include/clc/opencl/math/log10.h | 4 +- libclc/opencl/include/clc/opencl/math/log1p.h | 4 +- libclc/opencl/include/clc/opencl/math/log2.h | 4 +- libclc/opencl/include/clc/opencl/math/logb.h | 4 +- libclc/opencl/include/clc/opencl/math/mad.h | 4 +- .../opencl/include/clc/opencl/math/maxmag.h | 4 +- .../opencl/include/clc/opencl/math/minmag.h | 4 +- libclc/opencl/include/clc/opencl/math/modf.h | 4 +- .../include/clc/opencl/math/native_cos.h | 5 +- .../include/clc/opencl/math/native_divide.h | 4 +- .../include/clc/opencl/math/native_exp.h | 5 +- .../include/clc/opencl/math/native_exp10.h | 5 +- .../include/clc/opencl/math/native_exp2.h | 5 +- .../include/clc/opencl/math/native_log.h | 5 +- .../include/clc/opencl/math/native_log10.h | 5 +- .../include/clc/opencl/math/native_log2.h | 5 +- .../include/clc/opencl/math/native_powr.h | 4 +- .../include/clc/opencl/math/native_recip.h | 5 +- .../include/clc/opencl/math/native_rsqrt.h | 5 +- .../include/clc/opencl/math/native_sin.h | 5 +- .../include/clc/opencl/math/native_sqrt.h | 5 +- .../include/clc/opencl/math/native_tan.h | 5 +- .../include/clc/opencl/math/nextafter.h | 4 +- libclc/opencl/include/clc/opencl/math/pow.h | 4 +- libclc/opencl/include/clc/opencl/math/pown.h | 6 +- libclc/opencl/include/clc/opencl/math/powr.h | 4 +- .../include/clc/opencl/math/remainder.h | 4 +- .../opencl/include/clc/opencl/math/remquo.h | 4 +- libclc/opencl/include/clc/opencl/math/rint.h | 4 +- libclc/opencl/include/clc/opencl/math/rootn.h | 6 +- libclc/opencl/include/clc/opencl/math/round.h | 4 +- libclc/opencl/include/clc/opencl/math/rsqrt.h | 4 +- libclc/opencl/include/clc/opencl/math/sin.h | 4 +- .../opencl/include/clc/opencl/math/sincos.h | 4 +- libclc/opencl/include/clc/opencl/math/sinh.h | 4 +- libclc/opencl/include/clc/opencl/math/sinpi.h | 4 +- libclc/opencl/include/clc/opencl/math/sqrt.h | 4 +- libclc/opencl/include/clc/opencl/math/tan.h | 4 +- libclc/opencl/include/clc/opencl/math/tanh.h | 4 +- libclc/opencl/include/clc/opencl/math/tanpi.h | 4 +- .../opencl/include/clc/opencl/math/tgamma.h | 4 +- libclc/opencl/include/clc/opencl/math/trunc.h | 4 +- .../opencl/include/clc/opencl/misc/shuffle.h | 4 +- .../opencl/include/clc/opencl/misc/shuffle2.h | 4 +- .../opencl/include/clc/opencl/opencl-base.h | 26 + .../include/clc/opencl/relational/isfinite.h | 4 +- .../include/clc/opencl/relational/isgreater.h | 4 +- .../clc/opencl/relational/isgreaterequal.h | 4 +- .../include/clc/opencl/relational/isless.h | 4 +- .../clc/opencl/relational/islessequal.h | 4 +- .../clc/opencl/relational/islessgreater.h | 4 +- .../include/clc/opencl/relational/isnormal.h | 4 +- .../clc/opencl/relational/isnotequal.h | 4 +- .../include/clc/opencl/relational/isordered.h | 4 +- .../clc/opencl/relational/isunordered.h | 4 +- .../include/clc/opencl/relational/signbit.h | 4 +- libclc/opencl/lib/clspv/math/fma.cl | 8 +- libclc/opencl/lib/generic/common/degrees.cl | 18 +- libclc/opencl/lib/generic/common/radians.cl | 18 +- libclc/opencl/lib/generic/integer/abs.cl | 2 +- libclc/opencl/lib/generic/integer/abs_diff.cl | 2 +- libclc/opencl/lib/generic/integer/add_sat.cl | 2 +- libclc/opencl/lib/generic/integer/clz.cl | 2 +- libclc/opencl/lib/generic/integer/ctz.cl | 2 +- libclc/opencl/lib/generic/integer/hadd.cl | 2 +- libclc/opencl/lib/generic/integer/mad24.cl | 2 +- libclc/opencl/lib/generic/integer/mad_hi.cl | 2 +- libclc/opencl/lib/generic/integer/mad_sat.cl | 2 +- libclc/opencl/lib/generic/integer/mul24.cl | 2 +- libclc/opencl/lib/generic/integer/mul_hi.cl | 2 +- libclc/opencl/lib/generic/integer/popcount.cl | 2 +- libclc/opencl/lib/generic/integer/rhadd.cl | 2 +- libclc/opencl/lib/generic/integer/rotate.cl | 2 +- libclc/opencl/lib/generic/integer/sub_sat.cl | 2 +- libclc/opencl/lib/generic/integer/upsample.cl | 2 +- libclc/opencl/lib/generic/math/fma.cl | 18 +- libclc/opencl/lib/generic/math/ldexp.cl | 21 +- libclc/opencl/lib/generic/math/mad.cl | 18 +- libclc/opencl/lib/generic/math/nextafter.cl | 24 +- libclc/opencl/lib/generic/math/pown.cl | 2 +- libclc/opencl/lib/generic/math/rootn.cl | 2 +- .../lib/generic/relational/binary_def.inc | 4 +- .../lib/generic/relational/unary_def.inc | 4 +- libclc/opencl/lib/spirv/math/fma.cl | 8 +- libcxx/.clang-format | 9 +- libcxx/docs/FeatureTestMacroTable.rst | 4 + libcxx/docs/ReleaseNotes/21.rst | 6 +- libcxx/docs/Status/Cxx23Papers.csv | 2 +- libcxx/docs/Status/Cxx2cPapers.csv | 2 +- libcxx/docs/UserDocumentation.rst | 5 - libcxx/include/CMakeLists.txt | 13 +- libcxx/include/__chrono/formatter.h | 4 +- libcxx/include/__concepts/common_with.h | 2 +- libcxx/include/__config | 71 +- libcxx/include/__coroutine/coroutine_handle.h | 2 +- libcxx/include/__coroutine/coroutine_traits.h | 2 +- .../__coroutine/noop_coroutine_handle.h | 2 +- .../include/__coroutine/trivial_awaitables.h | 2 +- libcxx/include/__filesystem/path.h | 1 - libcxx/include/__filesystem/u8path.h | 7 +- .../include/__flat_map/key_value_iterator.h | 28 + libcxx/include/__flat_map/utils.h | 22 +- libcxx/include/__flat_set/flat_set.h | 278 +- libcxx/include/__flat_set/utils.h | 8 +- .../__functional/boyer_moore_searcher.h | 12 +- .../include/__functional/reference_wrapper.h | 32 +- libcxx/include/__hash_table | 114 +- libcxx/include/__iterator/product_iterator.h | 76 + libcxx/include/__locale_dir/check_grouping.h | 31 + libcxx/include/__locale_dir/get_c_locale.h | 40 + libcxx/include/__locale_dir/messages.h | 143 + libcxx/include/__locale_dir/money.h | 873 +++ libcxx/include/__locale_dir/num.h | 1072 +++ libcxx/include/__locale_dir/scan_keyword.h | 143 + libcxx/include/__locale_dir/time.h | 766 ++ libcxx/include/__locale_dir/wbuffer_convert.h | 430 ++ libcxx/include/__locale_dir/wstring_convert.h | 254 + libcxx/include/__memory/shared_ptr.h | 2 +- libcxx/include/__memory/unique_ptr.h | 2 +- libcxx/include/__mutex/lock_guard.h | 10 +- libcxx/include/__mutex/mutex.h | 8 +- libcxx/include/__ostream/basic_ostream.h | 4 +- libcxx/include/__ostream/print.h | 2 +- libcxx/include/__ranges/zip_view.h | 22 + libcxx/include/__thread/thread.h | 2 +- libcxx/include/__tree | 208 +- .../__type_traits/add_lvalue_reference.h | 54 - libcxx/include/__type_traits/add_pointer.h | 16 +- ...add_rvalue_reference.h => add_reference.h} | 44 +- .../include/__type_traits/common_reference.h | 11 +- libcxx/include/__type_traits/copy_cvref.h | 3 +- libcxx/include/__type_traits/decay.h | 44 +- .../has_unique_object_representation.h | 8 +- libcxx/include/__type_traits/invoke.h | 167 +- libcxx/include/__type_traits/is_array.h | 24 +- libcxx/include/__type_traits/is_assignable.h | 3 +- .../include/__type_traits/is_bounded_array.h | 21 +- libcxx/include/__type_traits/is_const.h | 20 +- .../include/__type_traits/is_constructible.h | 3 +- .../__type_traits/is_core_convertible.h | 9 + .../__type_traits/is_nothrow_assignable.h | 3 +- .../__type_traits/is_nothrow_constructible.h | 3 +- libcxx/include/__type_traits/is_pointer.h | 33 - libcxx/include/__type_traits/is_swappable.h | 2 +- .../__type_traits/is_trivially_assignable.h | 3 +- .../is_trivially_constructible.h | 3 +- libcxx/include/__type_traits/is_volatile.h | 20 +- .../__type_traits/remove_all_extents.h | 22 +- libcxx/include/__type_traits/remove_cvref.h | 4 - libcxx/include/__type_traits/remove_extent.h | 22 +- libcxx/include/bitset | 184 +- libcxx/include/complex | 1 + libcxx/include/experimental/iterator | 5 + libcxx/include/experimental/memory | 2 +- libcxx/include/flat_map | 9 + libcxx/include/flat_set | 9 + libcxx/include/fstream | 77 +- libcxx/include/functional | 5 + libcxx/include/future | 13 +- libcxx/include/iomanip | 9 +- libcxx/include/istream | 7 +- libcxx/include/locale | 3488 +-------- libcxx/include/map | 45 +- libcxx/include/module.modulemap.in | 38 +- libcxx/include/mutex | 11 +- libcxx/include/ostream | 5 + libcxx/include/set | 16 +- libcxx/include/shared_mutex | 56 +- libcxx/include/sstream | 2 +- libcxx/include/string | 22 +- libcxx/include/tuple | 6 + libcxx/include/type_traits | 3 +- libcxx/include/unordered_map | 153 +- libcxx/include/variant | 31 + libcxx/include/version | 4 + libcxx/modules/std/functional.inc | 4 + libcxx/src/atomic.cpp | 7 +- .../associative_container_benchmarks.h | 56 +- .../containers/associative/flat_map.bench.cpp | 2 +- .../associative/flat_multimap.bench.cpp | 2 +- .../associative/unordered_set.bench.cpp | 2 + libcxx/test/configs/cmake-bridge.cfg.in | 3 + .../gnu/hash/specializations.pass.cpp | 31 + .../gnu/hash/specializations.verify.cpp} | 7 +- .../gnu/hash_map/const_iterator.verify.cpp} | 13 +- libcxx/test/extensions/gnu/lit.local.cfg | 5 + .../flat.set/insert.temporary.pass.cpp | 5 +- .../flat.set/insert_range.pass.cpp | 18 +- .../extensions/hash/specializations.pass.cpp | 36 - .../ios.base.cons/dtor.uninitialized.pass.cpp | 2 +- .../iterators/product_iterator.pass.cpp | 66 + .../locale.categories/__scan_keyword.pass.cpp | 5 +- ...ad_safety_annotations_not_enabled.pass.cpp | 5 +- .../thread_safety_lock_guard.pass.cpp | 12 +- .../thread_safety_lock_unlock.pass.cpp | 12 +- .../thread_safety_missing_unlock.verify.cpp | 16 +- ...thread_safety_requires_capability.pass.cpp | 12 +- .../thread_safety.verify.cpp | 13 +- .../thread_safety.verify.cpp | 17 +- .../test/libcxx/transitive_includes/cxx26.csv | 18 - .../func.require/bullet_1_2_3.pass.cpp | 5 +- .../conditional-compile-flags.sh.cpp | 0 .../additional_compile_flags/lit.local.cfg | 0 .../substitutes-in-compile-flags.sh.cpp | 0 .../substitutes-in-run.sh.cpp | 0 .../compile-error.compile.fail.cpp | 0 .../compile-success.compile.fail.cpp | 0 .../compile-error.compile.pass.cpp | 0 .../compile-success.compile.pass.cpp | 0 .../link-error.compile.pass.cpp | 0 .../run-error.compile.pass.cpp | 0 .../compile-error.compile.pass.mm | 0 .../compile-success.compile.pass.mm | 0 .../link-error.compile.pass.mm | 0 .../compile.pass.mm/run-error.compile.pass.mm | 0 .../build_run.sh.cpp | 0 .../convenience_substitutions/verify.sh.cpp | 0 .../test/{libcxx => }/selftest/dsl/dsl.sh.py | 2 +- .../{libcxx => }/selftest/dsl/lit.local.cfg | 0 libcxx/test/selftest/file_dependencies/a.txt | 0 .../absolute-and-relative-paths.sh.cpp | 0 .../test/selftest/file_dependencies/dir/b.txt | 0 .../substitute-in-dependencies.sh.cpp | 0 .../selftest/gen.cpp/empty.gen.cpp | 0 .../{libcxx => }/selftest/gen.cpp/one.gen.cpp | 0 .../{libcxx => }/selftest/gen.cpp/two.gen.cpp | 0 .../link.fail.cpp/compile-error.link.fail.cpp | 0 .../link.fail.cpp/link-error.link.fail.cpp | 0 .../link.fail.cpp/link-success.link.fail.cpp | 0 .../link.pass.cpp/compile-error.link.pass.cpp | 0 .../link.pass.cpp/link-error.link.pass.cpp | 0 .../link.pass.cpp/link-success.link.pass.cpp | 0 .../link.pass.cpp/run-error.link.pass.cpp | 0 .../link.pass.mm/compile-error.link.pass.mm | 0 .../link.pass.mm/link-error.link.pass.mm | 0 .../link.pass.mm/link-success.link.pass.mm | 0 .../link.pass.mm/run-error.link.pass.mm | 0 .../test/{libcxx => selftest}/lit.local.cfg | 0 .../selftest/modules/no-modules.sh.cpp | 4 + .../modules/std-and-std.compat-module.sh.cpp | 4 + .../selftest/modules/std-module.sh.cpp | 4 + .../selftest/modules/std.compat-module.sh.cpp | 4 + .../selftest/pass.cpp/compile-error.pass.cpp | 0 .../selftest/pass.cpp/link-error.pass.cpp | 0 .../selftest/pass.cpp/run-error.pass.cpp | 0 .../selftest/pass.cpp/run-success.pass.cpp | 0 .../selftest/pass.cpp/werror.pass.cpp | 0 .../selftest/pass.mm/compile-error.pass.mm | 0 .../selftest/pass.mm/link-error.pass.mm | 0 .../selftest/pass.mm/no-arc.pass.mm | 0 .../selftest/pass.mm/run-error.pass.mm | 0 .../selftest/pass.mm/run-success.pass.mm | 0 .../pass.mm/use-objective-cxx.pass.mm | 0 .../selftest/remote-substitutions.sh.cpp | 0 .../selftest/sh.cpp/run-error.sh.cpp | 0 .../selftest/sh.cpp/run-success.sh.cpp | 0 .../selftest/sh.cpp/substitutions.sh.cpp | 0 .../selftest/sh.cpp/werror.sh.cpp | 0 .../selftest/shell-no-escape-builtins.sh.cpp | 0 .../selftest/stdin-is-piped.sh.cpp | 0 .../selftest/test_macros.pass.cpp | 0 .../selftest/tmpdir-exists.sh.cpp | 0 .../no-diagnostics-unmarked.verify.cpp | 0 .../verify.cpp/no-diagnostics.verify.cpp | 0 .../selftest/verify.cpp/no-werror.verify.cpp | 0 .../verify.cpp/right-diagnostic.verify.cpp | 0 .../verify.cpp/wrong-diagnostic.verify.cpp | 0 .../insert_iter_iter.pass.cpp | 23 +- .../flat.set/flat.set.capacity/empty.pass.cpp | 14 +- .../flat.set.capacity/max_size.pass.cpp | 7 +- .../flat.set/flat.set.capacity/size.pass.cpp | 17 +- .../flat.set/flat.set.cons/alloc.pass.cpp | 26 +- .../assign_initializer_list.pass.cpp | 14 +- .../flat.set/flat.set.cons/compare.pass.cpp | 80 +- .../flat.set.cons/containers.pass.cpp | 106 +- .../flat.set/flat.set.cons/copy.pass.cpp | 21 +- .../flat.set.cons/copy_alloc.pass.cpp | 47 +- .../flat.set.cons/copy_assign.pass.cpp | 27 +- .../flat.set/flat.set.cons/default.pass.cpp | 42 +- .../flat.set.cons/dtor_noexcept.pass.cpp | 28 +- .../flat.set.cons/initializer_list.pass.cpp | 121 +- .../flat.set/flat.set.cons/iter_iter.pass.cpp | 98 +- .../flat.set/flat.set.cons/move.pass.cpp | 64 +- .../flat.set.cons/move_alloc.pass.cpp | 51 +- .../flat.set.cons/move_assign.pass.cpp | 51 +- .../flat.set/flat.set.cons/range.pass.cpp | 93 +- .../flat.set.cons/sorted_container.pass.cpp | 91 +- .../sorted_initializer_list.pass.cpp | 122 +- .../flat.set.cons/sorted_iter_iter.pass.cpp | 94 +- .../flat.set.erasure/erase_if.pass.cpp | 26 +- .../flat.set.iterators/iterator.pass.cpp | 14 +- .../iterator_comparison.pass.cpp | 14 +- .../reverse_iterator.pass.cpp | 52 +- .../flat.set.modifiers/clear.pass.cpp | 15 +- .../flat.set.modifiers/emplace.pass.cpp | 21 +- .../flat.set.modifiers/emplace_hint.pass.cpp | 21 +- .../flat.set.modifiers/erase_iter.pass.cpp | 14 +- .../erase_iter_iter.pass.cpp | 14 +- .../flat.set.modifiers/erase_key.pass.cpp | 14 +- .../erase_key_transparent.pass.cpp | 29 +- .../flat.set.modifiers/extract.pass.cpp | 14 +- .../flat.set.modifiers/insert_cv.pass.cpp | 14 +- .../insert_initializer_list.pass.cpp | 14 +- .../insert_iter_cv.pass.cpp | 14 +- .../insert_iter_iter.pass.cpp | 14 +- .../insert_iter_rv.pass.cpp | 18 +- .../flat.set.modifiers/insert_range.pass.cpp | 16 +- .../flat.set.modifiers/insert_rv.pass.cpp | 18 +- .../insert_sorted_initializer_list.pass.cpp | 14 +- .../insert_sorted_iter_iter.pass.cpp | 14 +- .../insert_transparent.pass.cpp | 14 +- .../flat.set.modifiers/replace.pass.cpp | 14 +- .../flat.set.modifiers/swap_free.pass.cpp | 15 +- .../flat.set.modifiers/swap_member.pass.cpp | 14 +- .../flat.set/flat.set.observers/comp.pass.cpp | 9 +- .../flat.set.operations/contains.pass.cpp | 14 +- .../contains_transparent.pass.cpp | 14 +- .../flat.set.operations/count.pass.cpp | 14 +- .../count_transparent.pass.cpp | 14 +- .../flat.set.operations/equal_range.pass.cpp | 14 +- .../equal_range_transparent.pass.cpp | 14 +- .../flat.set.operations/find.pass.cpp | 14 +- .../find_transparent.pass.cpp | 14 +- .../flat.set.operations/lower_bound.pass.cpp | 14 +- .../lower_bound_transparent.pass.cpp | 14 +- .../flat.set.operations/upper_bound.pass.cpp | 14 +- .../upper_bound_transparent.pass.cpp | 14 +- .../container.adaptors/flat.set/helpers.h | 2 +- .../flat.set/incomplete_type.pass.cpp | 11 +- .../flat.set/op_compare.pass.cpp | 16 +- .../container.adaptors/flat_helpers.h | 15 +- .../unord.set.cnstr/assign_copy.pass.cpp | 14 + .../fstreams/filebuf.virtuals/setbuf.pass.cpp | 2 +- .../ext.manip/get_money.pass.cpp | 3 +- .../ext.manip/get_time.pass.cpp | 4 +- .../ext.manip/put_time.pass.cpp | 3 +- .../istream.unformatted/sync.pass.cpp | 2 +- .../mandatory_inclusions.gen.py | 180 + .../functional.version.compile.pass.cpp | 33 + .../type_traits.version.compile.pass.cpp | 33 + .../version.version.compile.pass.cpp | 66 + .../get_long_double_fr_FR.pass.cpp | 2 +- .../put_long_double_fr_FR.pass.cpp | 2 +- .../grouping.pass.cpp | 2 +- .../facet.num.get.members/get_double.pass.cpp | 2 +- .../facet.num.get.members/get_float.pass.cpp | 2 +- .../get_long_double.pass.cpp | 2 +- .../locale.time.get.byname/get_date.pass.cpp | 4 +- .../get_monthname.pass.cpp | 4 +- .../locale.time.get.byname/get_one.pass.cpp | 4 +- .../locale.time.get.byname/get_time.pass.cpp | 4 +- .../get_weekday.pass.cpp | 4 +- .../locale.time.get.byname/get_year.pass.cpp | 4 +- .../locale.time.get.members/get_date.pass.cpp | 4 +- .../locale.time.get.members/get_many.pass.cpp | 4 +- .../get_monthname.pass.cpp | 4 +- .../locale.time.get.members/get_one.pass.cpp | 4 +- .../locale.time.get.members/get_time.pass.cpp | 4 +- .../get_weekday.pass.cpp | 4 +- .../locale.time.get.members/get_year.pass.cpp | 4 +- .../tuple_element.compile.pass.cpp | 2 +- .../complex.tuple/tuple_size.compile.pass.cpp | 2 +- .../thread_create_failure.pass.cpp | 61 + .../futures.async/wait_on_destruct.pass.cpp | 42 + .../equality/equality.T2.pass.cpp | 8 +- .../equality/equality.other_expected.pass.cpp | 22 +- .../equality/equality.unexpected.pass.cpp | 8 +- .../equality/equality.other_expected.pass.cpp | 22 +- .../equality/equality.unexpected.pass.cpp | 8 +- libcxx/test/std/utilities/expected/types.h | 13 - .../refwrap/common_reference.compile.pass.cpp | 152 + .../common_reference.compile.pass.cpp | 58 +- .../bitset.members/to_ullong.pass.cpp | 68 +- .../bitset.members/to_ulong.pass.cpp | 66 +- .../tuple/tuple.tuple/tuple.rel/eq.pass.cpp | 25 +- .../size_incompatible_comparison.verify.cpp | 3 + .../pairs/pairs.spec/comparison.pass.cpp | 15 +- .../variant/variant.relops/relops.pass.cpp | 49 + .../relops_bool_conv.verify.cpp | 11 +- libcxx/test/support/concat_macros.h | 1 + libcxx/test/support/test_comparisons.h | 41 + .../header_exportable_declarations.cpp | 2 + libcxx/utils/ci/buildkite-pipeline-trigger.sh | 34 + libcxx/utils/gdb/libcxx/printers.py | 14 +- .../generate_feature_test_macro_components.py | 10 + libcxx/utils/libcxx/test/features.py | 21 +- libcxx/utils/libcxx/test/params.py | 1 - libcxxabi/CMakeLists.txt | 4 + libcxxabi/src/demangle/ItaniumDemangle.h | 4 +- libcxxabi/test/DemangleTestCases.inc | 1 + libcxxabi/test/configs/cmake-bridge.cfg.in | 2 +- lld/COFF/Config.h | 1 + lld/COFF/Driver.cpp | 16 +- lld/COFF/InputFiles.cpp | 40 +- lld/ELF/Arch/AArch64.cpp | 58 + lld/ELF/Arch/LoongArch.cpp | 151 +- lld/ELF/Arch/TargetImpl.h | 93 + lld/ELF/Arch/X86_64.cpp | 70 + lld/ELF/Config.h | 5 + lld/ELF/Driver.cpp | 7 + lld/ELF/InputSection.cpp | 6 +- lld/ELF/LTO.cpp | 7 + lld/ELF/Options.td | 16 +- lld/ELF/Relocations.cpp | 46 +- lld/ELF/Relocations.h | 1 + lld/ELF/ScriptParser.cpp | 2 + lld/ELF/Target.h | 1 + lld/docs/DTLTO.rst | 42 + lld/docs/ReleaseNotes.rst | 4 + lld/docs/index.rst | 1 + lld/docs/ld.lld.1 | 9 +- .../lld/Common/BPSectionOrdererBase.inc | 4 +- lld/test/COFF/exported-dllmain.test | 57 + lld/test/COFF/winsysroot.test | 4 + lld/test/ELF/aarch64-branch-to-branch.s | 84 + lld/test/ELF/dtlto/files.test | 99 + lld/test/ELF/dtlto/options.test | 40 + lld/test/ELF/dtlto/partitions.test | 40 + lld/test/ELF/linkerscript/align-section.test | 21 +- lld/test/ELF/loongarch-relax-tlsdesc.s | 256 +- lld/test/ELF/loongarch-tlsdesc-pcrel20-s2.s | 59 +- lld/test/ELF/loongarch-tlsdesc.s | 65 +- lld/test/ELF/lto/lazy-debug.ll | 107 + lld/test/ELF/x86-64-branch-to-branch.s | 135 + lld/test/MachO/icf-safe-thunks-dwarf.ll | 4 +- lld/test/MachO/icf-safe-thunks.ll | 4 +- lld/test/lit.cfg.py | 1 + lld/test/wasm/compress-relocs.ll | 26 - lld/test/wasm/compress-relocs.s | 129 + lld/test/wasm/compress-relocs64.s | 92 + lld/wasm/InputChunks.cpp | 46 +- .../bindings/interface/SBDebuggerExtensions.i | 13 + lldb/cmake/modules/LLDBFramework.cmake | 3 +- lldb/docs/index.rst | 1 + lldb/docs/resources/contributing.rst | 2 +- lldb/docs/resources/lldbgdbremote.md | 17 + lldb/docs/use/mcp.md | 85 + lldb/include/lldb/API/SBBreakpoint.h | 5 + lldb/include/lldb/API/SBStatisticsOptions.h | 3 +- lldb/include/lldb/Breakpoint/Breakpoint.h | 2 + .../lldb/Breakpoint/BreakpointLocation.h | 9 +- .../lldb/Breakpoint/BreakpointResolver.h | 3 +- lldb/include/lldb/Core/Debugger.h | 8 +- lldb/include/lldb/Core/EmulateInstruction.h | 61 + lldb/include/lldb/Core/IOHandler.h | 4 + lldb/include/lldb/Core/ProtocolServer.h | 5 +- lldb/include/lldb/Core/Statusline.h | 4 +- .../lldb/DataFormatters/FormattersHelpers.h | 8 + .../include/lldb/Expression/DWARFExpression.h | 4 +- lldb/include/lldb/Expression/IRMemoryMap.h | 10 +- lldb/include/lldb/Host/Editline.h | 2 + lldb/include/lldb/Host/PipeBase.h | 10 +- lldb/include/lldb/Host/posix/HostInfoPosix.h | 2 + lldb/include/lldb/Host/posix/PipePosix.h | 10 +- .../lldb/Host/windows/MainLoopWindows.h | 19 +- lldb/include/lldb/Host/windows/PipeWindows.h | 13 +- lldb/include/lldb/Symbol/ObjectFile.h | 17 +- lldb/include/lldb/Symbol/SymbolFile.h | 8 + lldb/include/lldb/Target/MemoryTagManager.h | 12 +- lldb/include/lldb/Target/Statistics.h | 8 +- lldb/include/lldb/Utility/Broadcaster.h | 2 +- lldb/include/lldb/Utility/Event.h | 1 - lldb/include/lldb/Utility/IOObject.h | 7 +- lldb/include/lldb/ValueObject/DILEval.h | 6 +- lldb/include/lldb/lldb-forward.h | 2 +- lldb/include/lldb/lldb-private-interfaces.h | 3 +- lldb/include/lldb/lldb-types.h | 2 +- .../Python/lldbsuite/test/builders/builder.py | 26 +- .../Python/lldbsuite/test/gdbclientutils.py | 10 + .../Python/lldbsuite/test/lldbutil.py | 87 + .../Python/lldbsuite/test/make/Makefile.rules | 4 + .../compressed_pair.h | 26 +- .../test/tools/lldb-dap/lldbdap_testcase.py | 7 +- lldb/scripts/framework-header-fix.py | 8 +- lldb/scripts/version-header-fix.py | 29 +- lldb/source/API/CMakeLists.txt | 2 +- lldb/source/API/SBBreakpoint.cpp | 12 + lldb/source/Breakpoint/Breakpoint.cpp | 112 +- lldb/source/Breakpoint/BreakpointIDList.cpp | 4 +- lldb/source/Breakpoint/BreakpointLocation.cpp | 49 +- .../Breakpoint/BreakpointLocationList.cpp | 5 +- lldb/source/Breakpoint/BreakpointOptions.cpp | 6 +- .../Breakpoint/BreakpointResolverName.cpp | 17 +- lldb/source/Breakpoint/Watchpoint.cpp | 6 +- lldb/source/Breakpoint/WatchpointOptions.cpp | 4 +- .../Commands/CommandObjectBreakpoint.cpp | 5 +- .../Commands/CommandObjectProtocolServer.cpp | 63 +- lldb/source/Commands/CommandObjectStats.cpp | 14 +- lldb/source/Commands/CommandObjectTarget.cpp | 5 +- lldb/source/Commands/Options.td | 16 +- lldb/source/Core/Debugger.cpp | 30 +- lldb/source/Core/EmulateInstruction.cpp | 92 + lldb/source/Core/FormatEntity.cpp | 4 +- lldb/source/Core/IOHandler.cpp | 7 + lldb/source/Core/ProtocolServer.cpp | 34 +- lldb/source/Core/Statusline.cpp | 42 +- lldb/source/Core/Telemetry.cpp | 32 +- .../DataFormatters/FormattersHelpers.cpp | 25 + lldb/source/Expression/DWARFExpression.cpp | 139 +- lldb/source/Expression/IRExecutionUnit.cpp | 19 +- lldb/source/Expression/IRMemoryMap.cpp | 50 +- lldb/source/Expression/LLVMUserExpression.cpp | 40 +- lldb/source/Expression/Materializer.cpp | 106 +- lldb/source/Host/common/Editline.cpp | 37 +- lldb/source/Host/common/File.cpp | 4 + lldb/source/Host/common/JSONTransport.cpp | 3 +- lldb/source/Host/common/Socket.cpp | 5 +- lldb/source/Host/macosx/objcxx/Host.mm | 37 +- .../posix/ConnectionFileDescriptorPosix.cpp | 31 +- lldb/source/Host/posix/HostInfoPosix.cpp | 6 + lldb/source/Host/posix/MainLoopPosix.cpp | 2 +- lldb/source/Host/posix/PipePosix.cpp | 31 +- .../Host/posix/ProcessLauncherPosixFork.cpp | 3 +- lldb/source/Host/windows/MainLoopWindows.cpp | 193 +- lldb/source/Host/windows/PipeWindows.cpp | 23 +- lldb/source/Interpreter/ScriptInterpreter.cpp | 2 +- .../Instruction/ARM/EmulateInstructionARM.cpp | 13 + .../Instruction/ARM/EmulateInstructionARM.h | 18 + .../LoongArch/EmulateInstructionLoongArch.cpp | 122 +- .../LoongArch/EmulateInstructionLoongArch.h | 2 - .../RISCV/EmulateInstructionRISCV.cpp | 143 +- .../RISCV/EmulateInstructionRISCV.h | 37 +- .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 155 +- .../Plugins/Language/CPlusPlus/LibCxx.cpp | 122 +- .../Plugins/Language/CPlusPlus/LibCxx.h | 4 +- .../Language/CPlusPlus/LibCxxUnorderedMap.cpp | 6 +- .../Plugins/Language/CPlusPlus/LibStdcpp.cpp | 190 +- .../Plugins/Language/CPlusPlus/LibStdcpp.h | 6 +- .../CPlusPlus/LibStdcppUniquePointer.cpp | 26 +- .../AppleObjCClassDescriptorV2.cpp | 5 +- .../AppleObjCRuntime/AppleObjCRuntimeV2.cpp | 21 +- .../AppleObjCRuntime/AppleObjCRuntimeV2.h | 5 + .../ObjectFile/Mach-O/ObjectFileMachO.cpp | 324 +- .../ObjectFile/Mach-O/ObjectFileMachO.h | 2 + .../Platform/MacOSX/PlatformDarwin.cpp | 50 +- .../Process/FreeBSD/NativeProcessFreeBSD.cpp | 12 +- .../Process/Linux/NativeProcessLinux.cpp | 12 +- .../Process/MacOSX-Kernel/CMakeLists.txt | 1 - .../MacOSX-Kernel/RegisterContextKDP_i386.cpp | 114 - .../MacOSX-Kernel/RegisterContextKDP_i386.h | 38 - .../Process/MacOSX-Kernel/ThreadKDP.cpp | 5 - .../Plugins/Process/Utility/CMakeLists.txt | 2 - .../Plugins/Process/Utility/LinuxSignals.cpp | 4 + .../Utility/MemoryTagManagerAArch64MTE.cpp | 10 +- .../Utility/MemoryTagManagerAArch64MTE.h | 2 +- .../NativeProcessSoftwareSingleStep.cpp | 108 +- .../Utility/NativeProcessSoftwareSingleStep.h | 3 +- .../Utility/RegisterContextDarwin_i386.cpp | 958 --- .../Utility/RegisterContextDarwin_i386.h | 208 - .../Utility/RegisterContextMach_i386.cpp | 60 - .../Utility/RegisterContextMach_i386.h | 35 - .../gdb-remote/GDBRemoteClientBase.cpp | 9 +- .../Process/gdb-remote/GDBRemoteClientBase.h | 6 +- .../gdb-remote/GDBRemoteCommunication.cpp | 249 +- .../gdb-remote/GDBRemoteCommunication.h | 14 +- .../GDBRemoteCommunicationClient.cpp | 6 +- .../GDBRemoteCommunicationServerPlatform.cpp | 44 +- .../GDBRemoteCommunicationServerPlatform.h | 4 +- .../Process/gdb-remote/ProcessGDBRemote.cpp | 66 +- .../Plugins/Process/mach-core/CMakeLists.txt | 1 + .../mach-core/RegisterContextUnifiedCore.cpp | 312 + .../mach-core/RegisterContextUnifiedCore.h | 57 + .../Process/mach-core/ThreadMachCore.cpp | 56 +- lldb/source/Plugins/Protocol/MCP/Protocol.h | 2 + .../Protocol/MCP/ProtocolServerMCP.cpp | 30 +- .../Plugins/Protocol/MCP/ProtocolServerMCP.h | 6 +- lldb/source/Plugins/Protocol/MCP/Tool.cpp | 109 +- lldb/source/Plugins/Protocol/MCP/Tool.h | 24 +- .../SymbolFile/DWARF/DWARFDataExtractor.cpp | 12 +- .../SymbolFile/DWARF/DWARFDataExtractor.h | 8 - .../SymbolFile/DWARF/DWARFFormValue.cpp | 37 +- .../Plugins/SymbolFile/DWARF/DWARFUnit.cpp | 15 +- .../Plugins/SymbolFile/DWARF/DWARFUnit.h | 3 + .../SymbolFile/DWARF/SymbolFileDWARF.cpp | 29 + .../SymbolFile/DWARF/SymbolFileDWARF.h | 5 + lldb/source/Symbol/SaveCoreOptions.cpp | 2 +- lldb/source/Target/Process.cpp | 2 +- lldb/source/Target/StackFrame.cpp | 1 + lldb/source/Target/Statistics.cpp | 12 +- lldb/source/Target/Target.cpp | 10 +- lldb/source/Utility/IOObject.cpp | 9 + lldb/source/Utility/SelectHelper.cpp | 2 +- lldb/source/ValueObject/DILEval.cpp | 191 +- lldb/source/ValueObject/DILParser.cpp | 26 +- .../TestCallStdStringFunction.py | 1 - .../TestExpressionInSyscall.py | 13 +- ...estSharedPtrDbgInfoContentFromStdModule.py | 2 +- .../shared_ptr/TestSharedPtrFromStdModule.py | 6 +- .../TestDbgInfoContentWeakPtrFromStdModule.py | 4 +- .../weak_ptr/TestWeakPtrFromStdModule.py | 6 +- .../ir-interpreter/TestIRInterpreter.py | 14 +- .../frame/var-dil/basics/BitField}/Makefile | 1 - .../BitField/TestFrameVarDILBitField.py | 43 + .../frame/var-dil/basics/BitField/main.cpp | 42 + .../basics/GlobalVariableLookup/Makefile | 2 +- .../TestFrameVarDILGlobalVariableLookup.py | 23 +- .../basics/GlobalVariableLookup/extern.cpp | 10 + .../basics/GlobalVariableLookup/main.cpp | 3 + .../var-dil/basics/Indirection}/Makefile | 2 - .../Indirection/TestFrameVarDILIndirection.py | 46 + .../frame/var-dil/basics/Indirection/main.cpp | 12 + .../MemberOf/TestFrameVarDILMemberOf.py | 19 +- .../TestFrameVarDILMemberOfAnonymousMember.py | 35 +- .../basics/PointerDereference/Makefile | 3 + .../TestFrameVarDILPointerDereference.py | 48 + .../basics/PointerDereference/main.cpp | 34 + .../frame/var-dil/basics/QualifiedId/Makefile | 3 + .../QualifiedId/TestFrameVarDILQualifiedId.py | 31 + .../frame/var-dil/basics/QualifiedId/main.cpp | 16 + .../basics/SyntheticDereference/Makefile | 3 + .../TestFrameVarDILSyntheticDereference.py | 34 + .../basics/SyntheticDereference/main.cpp | 26 + .../wrapPtrSynthProvider.py | 29 + .../TestPlatformLaunchGDBServer.py | 69 +- .../commands/protocol/TestMCPUnixSocket.py | 34 + .../commands/statistics/basic/TestStats.py | 203 +- .../API/commands/statistics/basic/baz.cpp | 12 + .../API/commands/statistics/basic/third.cpp | 7 + .../after_rebuild/Makefile | 1 + .../TestLocationsAfterRebuild.py | 59 + .../breakpoint_locations/after_rebuild/main.c | 1 + .../after_rebuild/second_main.c | 1 + .../after_rebuild/third_main.c | 1 + .../breakpoint/hardware_breakpoints/base.py | 10 + .../TestHWBreakMultiThread.py | 7 +- .../TestRequireHWBreakpoints.py | 8 +- .../simple_hw_breakpoints/Makefile | 7 + .../TestSimpleHWBreakpoints.py | 50 + .../simple_hw_breakpoints/main.c | 7 + .../TestWriteMemoryWithHWBreakpoint.py | 5 +- .../generic/atomic/Makefile | 3 + .../atomic/TestDataFormatterStdAtomic.py} | 17 +- .../{libcxx => generic}/atomic/main.cpp | 26 +- .../{libcxx => generic}/chrono/Makefile | 4 +- .../chrono/TestDataFormatterStdChrono.py} | 14 +- .../{libcxx => generic}/chrono/main.cpp | 0 .../deque/TestDataFormatterGenericDeque.py | 74 +- .../data-formatter-stl/generic/deque/main.cpp | 25 +- .../data-formatter-stl/generic/map/Makefile | 3 + .../map/TestDataFormatterStdMap.py} | 27 +- .../data-formatter-stl/generic/map/main.cpp | 80 + .../set/TestDataFormatterGenericSet.py | 2 +- .../generic/shared_ptr/Makefile | 3 + .../TestDataFormatterStdSharedPtr.py} | 76 +- .../generic/shared_ptr/main.cpp | 38 + .../generic/unique_ptr/Makefile | 4 + .../TestDataFormatterStdUniquePtr.py | 157 + .../{libcxx => generic}/unique_ptr/main.cpp | 25 +- .../{libstdcpp/map => generic/vbool}/Makefile | 3 +- .../vbool/TestDataFormatterStdVBool.py | 33 +- .../data-formatter-stl/generic/vbool/main.cpp | 65 + .../generic/vector/Makefile | 3 + .../vector/TestDataFormatterStdVector.py} | 43 +- .../generic/vector/main.cpp | 40 + .../libcxx-simulators/invalid-vector/main.cpp | 2 +- .../TestDataFormatterLibcxxStringSimulator.py | 2 +- .../libcxx-simulators/string/main.cpp | 6 +- ...stDataFormatterLibcxxUniquePtrSimulator.py | 2 +- .../libcxx-simulators/unique_ptr/main.cpp | 3 +- .../data-formatter-stl/libcxx/atomic/Makefile | 5 - .../deque/TestDataFormatterLibcxxDeque.py | 87 - .../data-formatter-stl/libcxx/deque/main.cpp | 30 - .../libcxx/{vbool => invalid-string}/Makefile | 3 +- .../TestDataFormatterLibcxxInvalidString.py | 38 + .../libcxx/invalid-string/main.cpp | 110 + .../data-formatter-stl/libcxx/map/main.cpp | 82 - .../libcxx/shared_ptr/Makefile | 8 - .../libcxx/shared_ptr/main.cpp | 18 - .../string/TestDataFormatterLibcxxString.py | 21 - .../data-formatter-stl/libcxx/string/main.cpp | 103 - .../libcxx/unique_ptr/Makefile | 8 - .../TestDataFormatterLibcxxUniquePtr.py | 117 - .../{map => unordered_map-iterator}/Makefile | 0 .../TestDataFormatterLibccUnorderedMap.py | 63 + .../libcxx/unordered_map-iterator/main.cpp | 53 + .../libcxx/unordered_map/Makefile | 6 - .../libcxx/unordered_map/main.cpp | 28 - .../vbool/TestDataFormatterLibcxxVBool.py | 76 - .../data-formatter-stl/libcxx/vbool/main.cpp | 65 - .../data-formatter-stl/libcxx/vector/Makefile | 6 - .../data-formatter-stl/libcxx/vector/main.cpp | 41 - .../libstdcpp/map/TestDataFormatterStdMap.py | 301 - .../data-formatter-stl/libstdcpp/map/main.cpp | 55 - .../libstdcpp/smart_ptr/Makefile | 6 - .../smart_ptr/TestDataFormatterStdSmartPtr.py | 52 - .../libstdcpp/smart_ptr/main.cpp | 26 - .../TestDataFormatterStdUniquePtr.py | 134 - .../TestDataFormatterInvalidStdUniquePtr.py | 4 - .../libstdcpp/unique_ptr/invalid/main.cpp | 11 - .../libstdcpp/unique_ptr/main.cpp | 35 - .../TestDataFormatterLibStdcxxVariant.py | 11 +- .../libstdcpp/variant/main.cpp | 25 +- .../libstdcpp/vbool/Makefile | 6 - .../libstdcpp/vbool/main.cpp | 63 - .../libstdcpp/vector/Makefile | 6 - .../vector/TestDataFormatterStdVector.py | 220 - .../libstdcpp/vector/main.cpp | 31 - .../gdb_remote_client/TestGDBRemoteClient.py | 72 + .../postmortem/elf-core/expr/TestExpr.py | 52 + .../elf-core/expr/linux-x86_64.core | Bin 0 -> 40960 bytes .../postmortem/elf-core/expr/linux-x86_64.out | Bin 0 -> 10816 bytes .../postmortem/elf-core/expr/main.cpp | 15 + .../TestProgressReporting.py | 22 + .../statusline/TestStatusline.py | 21 +- .../API/lang/cpp/char8_t/TestCxxChar8_t.py | 4 +- .../lang/objc/class-without-methods/Makefile | 5 + .../lang/objc/class-without-methods/Point.h | 4 + .../lang/objc/class-without-methods/Point.m | 7 + .../TestObjCClassWithoutMethods.py | 11 + .../lang/objc/class-without-methods/main.m | 7 + .../TestAArch64LinuxMTEMemoryTagCoreFile.py | 23 + .../aarch64/mte_core_file/core.mte.notags | Bin 0 -> 32768 bytes .../API/linux/aarch64/mte_core_file/main.c | 7 +- .../lc-note/additional-registers/Makefile | 11 + .../TestMetadataRegisters.py | 150 + .../additional-registers/add-lcnote.cpp | 385 + .../lc-note/additional-registers/main.c | 11 + lldb/test/API/macosx/simulator/Makefile | 5 +- .../macosx/simulator/TestSimulatorPlatform.py | 42 +- lldb/test/API/macosx/simulator/hello.c | 5 - lldb/test/API/macosx/simulator/hello.cpp | 14 + .../python_api/debugger/TestDebuggerAPI.py | 8 + lldb/test/API/riscv/step/Makefile | 3 + lldb/test/API/riscv/step/TestSoftwareStep.py | 79 + lldb/test/API/riscv/step/branch.c | 22 + .../step/incomplete_sequence_without_lr.c | 22 + .../step/incomplete_sequence_without_sc.c | 21 + lldb/test/API/riscv/step/main.c | 22 + .../TestDAP_breakpointAssembly.py | 14 +- .../tools/lldb-dap/console/TestDAP_console.py | 4 +- .../restart/TestDAP_restart_runInTerminal.py | 4 +- .../runInTerminal/TestDAP_runInTerminal.py | 5 +- .../API/tools/lldb-dap/runInTerminal/main.c | 4 + .../tools/lldb-dap/server/TestDAP_server.py | 4 +- .../API/tools/lldb-dap/step/TestDAP_step.py | 38 + lldb/test/API/tools/lldb-dap/step/main.cpp | 14 +- lldb/test/API/tools/lldb-dap/step/other.h | 7 + .../lldb-server/TestAppleSimulatorOSType.py | 72 +- .../Shell/Scripts/Inputs/Main/SBAddress.h | 1 + .../Shell/Scripts/TestFrameworkFixScript.test | 1 + .../Shell/Scripts/TestVersionFixScript.test | 2 +- lldb/tools/lldb-dap/Breakpoint.cpp | 4 +- lldb/tools/lldb-dap/DAP.cpp | 81 + lldb/tools/lldb-dap/DAP.h | 42 +- lldb/tools/lldb-dap/DAPError.h | 5 + .../Handler/DisassembleRequestHandler.cpp | 13 +- .../Handler/LocationsRequestHandler.cpp | 22 +- .../lldb-dap/Handler/SourceRequestHandler.cpp | 32 +- .../Handler/StackTraceRequestHandler.cpp | 2 +- lldb/tools/lldb-dap/JSONUtils.cpp | 14 +- lldb/tools/lldb-dap/JSONUtils.h | 5 +- lldb/tools/lldb-dap/ProgressEvent.h | 13 +- .../lldb-dap/Protocol/ProtocolRequests.h | 2 +- .../tools/lldb-dap/Protocol/ProtocolTypes.cpp | 2 +- lldb/tools/lldb-dap/Protocol/ProtocolTypes.h | 3 +- lldb/tools/lldb-dap/ProtocolUtils.cpp | 73 +- lldb/tools/lldb-dap/ProtocolUtils.h | 19 +- lldb/tools/lldb-dap/SourceBreakpoint.cpp | 8 +- lldb/tools/lldb-dap/tool/lldb-dap.cpp | 2 - lldb/tools/lldb-server/lldb-gdbserver.cpp | 6 +- lldb/tools/lldb-server/lldb-platform.cpp | 43 +- lldb/tools/lldb-test/lldb-test.cpp | 10 +- lldb/unittests/Core/CommunicationTest.cpp | 3 +- lldb/unittests/DAP/TestBase.cpp | 2 +- lldb/unittests/DAP/TestBase.h | 2 +- lldb/unittests/Host/CMakeLists.txt | 4 +- lldb/unittests/Host/FileTest.cpp | 16 +- lldb/unittests/Host/HostTest.cpp | 3 +- lldb/unittests/Host/JSONTransportTest.cpp | 4 +- lldb/unittests/Host/MainLoopTest.cpp | 72 +- lldb/unittests/Host/PipeTest.cpp | 25 +- lldb/unittests/Host/SocketTest.cpp | 4 +- lldb/unittests/Host/posix/SupportTest.cpp | 19 +- .../LoongArch/TestLoongArchEmulator.cpp | 42 +- .../MemoryTagManagerAArch64MTETest.cpp | 51 +- .../Protocol/ProtocolMCPServerTest.cpp | 21 +- lldb/unittests/Protocol/ProtocolMCPTest.cpp | 97 + .../unittests/SymbolFile/DWARF/CMakeLists.txt | 1 + .../SymbolFile/DWARF/DWARF64UnitTest.cpp | 86 + .../TestingSupport/Host/PipeTestUtilities.h | 6 +- llvm/CMakeLists.txt | 19 +- llvm/Maintainers.md | 5 +- llvm/cmake/modules/AddLLVM.cmake | 6 +- llvm/cmake/modules/HandleLLVMOptions.cmake | 2 +- llvm/docs/AMDGPUUsage.rst | 45 +- llvm/docs/AliasAnalysis.rst | 14 - llvm/docs/CMake.rst | 6 +- llvm/docs/CodingStandards.rst | 21 +- llvm/docs/CommandGuide/llvm-objdump.rst | 2 +- llvm/docs/DeveloperPolicy.rst | 319 +- llvm/docs/Extensions.rst | 21 - llvm/docs/GitHub.rst | 2 + llvm/docs/HowToAddABuilder.rst | 7 +- llvm/docs/HowToReleaseLLVM.rst | 14 +- llvm/docs/HowToUpdateDebugInfo.rst | 38 +- llvm/docs/InterfaceExportAnnotations.rst | 7 +- llvm/docs/LangRef.rst | 52 +- llvm/docs/MLGO.rst | 52 +- llvm/docs/QualGroup.rst | 60 + llvm/docs/RISCVUsage.rst | 6 + llvm/docs/ReleaseNotes.md | 3 + llvm/docs/SPIRVUsage.rst | 9 + llvm/docs/SourceLevelDebugging.rst | 57 +- llvm/docs/index.rst | 4 + .../BuildingAJIT/Chapter1/KaleidoscopeJIT.h | 1 + .../BuildingAJIT/Chapter2/KaleidoscopeJIT.h | 1 + .../BuildingAJIT/Chapter3/KaleidoscopeJIT.h | 1 + .../BuildingAJIT/Chapter4/KaleidoscopeJIT.h | 1 + .../Kaleidoscope/include/KaleidoscopeJIT.h | 1 + .../LLJITWithExecutorProcessControl.cpp | 1 + .../LLJITWithThinLTOSummaries.cpp | 4 +- .../OrcV2CBindingsBasicUsage.c | 10 +- .../OrcV2CBindingsDumpObjects.c | 5 +- .../OrcV2CBindingsIRTransforms.c | 4 +- .../OrcV2CBindingsLazy/OrcV2CBindingsLazy.c | 10 +- .../OrcV2CBindingsMCJITLikeMemoryManager.c | 11 +- .../OrcV2CBindingsRemovableCode.c | 11 +- .../OrcV2CBindingsVeryLazy.c | 10 +- .../SpeculativeJIT/SpeculativeJIT.cpp | 1 + llvm/include/llvm-c/DebugInfo.h | 10 + llvm/include/llvm-c/Orc.h | 26 +- llvm/include/llvm-c/lto.h | 17 +- llvm/include/llvm/ADT/APFloat.h | 25 +- llvm/include/llvm/ADT/APInt.h | 2 +- llvm/include/llvm/ADT/ArrayRef.h | 112 +- llvm/include/llvm/ADT/BitVector.h | 4 +- llvm/include/llvm/ADT/Bitset.h | 2 +- llvm/include/llvm/ADT/DynamicAPInt.h | 11 +- llvm/include/llvm/ADT/STLExtras.h | 6 + llvm/include/llvm/ADT/STLForwardCompat.h | 66 +- llvm/include/llvm/ADT/SlowDynamicAPInt.h | 17 +- llvm/include/llvm/ADT/SmallPtrSet.h | 2 +- llvm/include/llvm/ADT/TinyPtrVector.h | 64 +- .../llvm/Analysis/BlockFrequencyInfoImpl.h | 38 +- .../llvm/Analysis/BranchProbabilityInfo.h | 4 +- llvm/include/llvm/Analysis/DXILResource.h | 4 +- .../Analysis/FunctionPropertiesAnalysis.h | 25 +- llvm/include/llvm/Analysis/IR2Vec.h | 69 +- llvm/include/llvm/Analysis/IVDescriptors.h | 42 +- llvm/include/llvm/Analysis/InlineAdvisor.h | 4 + .../llvm/Analysis/InlineModelFeatureMaps.h | 16 +- .../llvm/Analysis/LoopAccessAnalysis.h | 4 - llvm/include/llvm/Analysis/MLInlineAdvisor.h | 1 + .../Analysis/ScalarEvolutionPatternMatch.h | 3 + .../include/llvm/Analysis/TargetLibraryInfo.h | 8 +- .../llvm/Analysis/TargetTransformInfo.h | 18 +- .../llvm/Analysis/TargetTransformInfoImpl.h | 18 +- llvm/include/llvm/Analysis/ValueTracking.h | 23 +- llvm/include/llvm/BinaryFormat/DXContainer.h | 63 +- .../BinaryFormat/DXContainerConstants.def | 206 +- llvm/include/llvm/BinaryFormat/Dwarf.def | 13 +- llvm/include/llvm/BinaryFormat/Dwarf.h | 1 + llvm/include/llvm/BinaryFormat/ELF.h | 4 +- llvm/include/llvm/BinaryFormat/GOFF.h | 85 + llvm/include/llvm/BinaryFormat/Wasm.h | 4 +- llvm/include/llvm/Bitcode/BitcodeReader.h | 2 +- llvm/include/llvm/Bitcode/LLVMBitCodes.h | 1 + llvm/include/llvm/CodeGen/BasicTTIImpl.h | 18 +- .../llvm/CodeGen/GlobalISel/CallLowering.h | 9 + .../llvm/CodeGen/GlobalISel/CombinerHelper.h | 13 +- .../llvm/CodeGen/GlobalISel/LegalizerHelper.h | 5 + llvm/include/llvm/CodeGen/MachineOperand.h | 2 +- llvm/include/llvm/CodeGen/Passes.h | 3 + llvm/include/llvm/CodeGen/PseudoSourceValue.h | 4 +- .../include/llvm/CodeGen/RuntimeLibcallUtil.h | 4 + llvm/include/llvm/CodeGen/SDPatternMatch.h | 91 +- llvm/include/llvm/CodeGen/SelectionDAG.h | 5 + llvm/include/llvm/CodeGen/SelectionDAGISel.h | 6 +- llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 18 + llvm/include/llvm/CodeGen/TargetLowering.h | 19 +- .../CodeGen/TargetLoweringObjectFileImpl.h | 5 + llvm/include/llvm/CodeGenTypes/LowLevelType.h | 5 +- .../llvm/CodeGenTypes/MachineValueType.h | 9 +- llvm/include/llvm/Config/llvm-config.h.cmake | 5 +- .../DebugInfo/CodeView/CodeViewSymbols.def | 2 + .../llvm/DebugInfo/CodeView/SymbolRecord.h | 27 +- .../llvm/DebugInfo/DWARF/DWARFCFIPrinter.h | 8 +- .../llvm/DebugInfo/DWARF/DWARFCFIProgram.h | 22 +- .../DWARF/DWARFDataExtractorSimple.h | 6 +- .../llvm/DebugInfo/DWARF/DWARFDebugFrame.h | 2 + .../llvm/DebugInfo/DWARF/DWARFExpression.h | 25 +- .../DebugInfo/LogicalView/Core/LVObject.h | 8 + .../LogicalView/Core/LVSourceLanguage.h | 3 +- .../LogicalView/Readers/LVDWARFReader.h | 9 + llvm/include/llvm/Demangle/ItaniumDemangle.h | 4 +- .../llvm/Demangle/MicrosoftDemangleNodes.h | 179 +- llvm/include/llvm/ExecutionEngine/Orc/COFF.h | 5 +- .../Orc/EPCGenericMemoryAccess.h | 131 +- .../Orc/ExecutorProcessControl.h | 201 +- .../Orc/InProcessMemoryAccess.h | 68 + llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h | 3 +- .../llvm/ExecutionEngine/Orc/MemoryAccess.h | 195 + .../Orc/SelfExecutorProcessControl.h | 76 + .../ExecutionEngine/Orc/Shared/OrcRTBridge.h | 10 +- .../Orc/Shared/TargetProcessControlTypes.h | 4 +- .../ExecutionEngine/Orc/SymbolStringPool.h | 8 +- .../ExecutionEngine/Orc/ThreadSafeModule.h | 78 +- .../llvm/ExecutionEngine/RuntimeDyld.h | 2 +- .../llvm/Frontend/Directive/Spelling.h | 4 +- .../llvm/Frontend/Driver/CodeGenOptions.h | 2 +- .../llvm/Frontend/HLSL/HLSLRootSignature.h | 195 +- .../Frontend/HLSL/RootSignatureMetadata.h | 56 + ...tureUtils.h => RootSignatureValidations.h} | 71 +- .../Frontend/OpenMP/DirectiveNameParser.h | 77 + llvm/include/llvm/Frontend/OpenMP/OMP.td | 50 +- .../llvm/Frontend/OpenMP/OMPIRBuilder.h | 8 +- llvm/include/llvm/IR/Argument.h | 3 + llvm/include/llvm/IR/Attributes.td | 13 + llvm/include/llvm/IR/CMakeLists.txt | 3 + llvm/include/llvm/IR/DIBuilder.h | 95 +- llvm/include/llvm/IR/DebugInfoMetadata.h | 600 +- llvm/include/llvm/IR/DebugLoc.h | 49 +- llvm/include/llvm/IR/Function.h | 5 +- llvm/include/llvm/IR/IRBuilder.h | 8 +- llvm/include/llvm/IR/Instruction.h | 2 +- llvm/include/llvm/IR/Intrinsics.td | 4 +- llvm/include/llvm/IR/IntrinsicsAArch64.td | 16 +- llvm/include/llvm/IR/IntrinsicsAMDGPU.td | 83 + llvm/include/llvm/IR/IntrinsicsARM.td | 32 +- llvm/include/llvm/IR/IntrinsicsPowerPC.td | 8 + llvm/include/llvm/IR/LegacyPassManagers.h | 3 +- llvm/include/llvm/IR/OptBisect.h | 12 +- llvm/include/llvm/IR/PatternMatch.h | 7 + llvm/include/llvm/IR/ProfDataUtils.h | 23 + llvm/include/llvm/IR/RuntimeLibcalls.def | 701 -- llvm/include/llvm/IR/RuntimeLibcalls.h | 85 +- llvm/include/llvm/IR/RuntimeLibcalls.td | 1661 +++++ llvm/include/llvm/IR/RuntimeLibcallsImpl.td | 32 + llvm/include/llvm/IR/Type.h | 2 +- llvm/include/llvm/InitializePasses.h | 1 + llvm/include/llvm/LTO/legacy/LTOModule.h | 8 + llvm/include/llvm/LinkAllPasses.h | 6 +- .../llvm/MC/DXContainerRootSignature.h | 2 +- llvm/include/llvm/MC/MCAsmBackend.h | 43 +- llvm/include/llvm/MC/MCAsmInfo.h | 7 +- llvm/include/llvm/MC/MCAssembler.h | 13 +- llvm/include/llvm/MC/MCCodeView.h | 5 + llvm/include/llvm/MC/MCContext.h | 17 +- llvm/include/llvm/MC/MCDXContainerStreamer.h | 3 - llvm/include/llvm/MC/MCExpr.h | 42 +- llvm/include/llvm/MC/MCFixup.h | 29 +- llvm/include/llvm/MC/MCFixupKindInfo.h | 47 - llvm/include/llvm/MC/MCFragment.h | 576 -- llvm/include/llvm/MC/MCGOFFAttributes.h | 92 + llvm/include/llvm/MC/MCGOFFObjectWriter.h | 20 + llvm/include/llvm/MC/MCGOFFStreamer.h | 7 +- llvm/include/llvm/MC/MCInst.h | 11 +- llvm/include/llvm/MC/MCMachObjectWriter.h | 2 - llvm/include/llvm/MC/MCObjectFileInfo.h | 4 - llvm/include/llvm/MC/MCObjectStreamer.h | 5 +- .../llvm/MC/MCParser/MCParsedAsmOperand.h | 12 +- llvm/include/llvm/MC/MCSPIRVStreamer.h | 3 - llvm/include/llvm/MC/MCSchedule.h | 12 +- llvm/include/llvm/MC/MCSection.h | 578 +- llvm/include/llvm/MC/MCSectionGOFF.h | 100 +- llvm/include/llvm/MC/MCStreamer.h | 4 +- llvm/include/llvm/MC/MCSymbol.h | 2 +- llvm/include/llvm/MC/MCSymbolGOFF.h | 26 + llvm/include/llvm/MC/MCWasmStreamer.h | 2 - llvm/include/llvm/MC/MCWinCOFFStreamer.h | 2 - llvm/include/llvm/MC/MCXCOFFStreamer.h | 1 - llvm/include/llvm/MCA/CodeEmitter.h | 3 +- llvm/include/llvm/Object/DXContainer.h | 26 +- llvm/include/llvm/Object/ELF.h | 2 +- .../include/llvm/ObjectYAML/DXContainerYAML.h | 12 +- llvm/include/llvm/Pass.h | 7 +- llvm/include/llvm/PassAnalysisSupport.h | 24 +- .../ProfileData/Coverage/CoverageMapping.h | 10 + .../llvm/ProfileData/InstrProfReader.h | 2 +- llvm/include/llvm/ProfileData/SampleProf.h | 4 +- .../llvm/ProfileData/SampleProfWriter.h | 4 +- llvm/include/llvm/SandboxIR/Value.h | 1 + llvm/include/llvm/Support/Compiler.h | 45 +- llvm/include/llvm/Support/ConvertUTF.h | 6 +- llvm/include/llvm/Support/Error.h | 2 +- llvm/include/llvm/Support/FileSystem.h | 2 +- llvm/include/llvm/Support/JSON.h | 4 +- llvm/include/llvm/Support/KnownFPClass.h | 12 +- llvm/include/llvm/Support/MathExtras.h | 20 +- llvm/include/llvm/Support/Path.h | 10 +- llvm/include/llvm/Support/PrettyStackTrace.h | 2 +- llvm/include/llvm/Support/ProgramStack.h | 7 +- llvm/include/llvm/Support/Signals.h | 35 + llvm/include/llvm/Support/TextEncoding.h | 8 +- llvm/include/llvm/Support/Timer.h | 2 +- llvm/include/llvm/Support/TrailingObjects.h | 55 +- llvm/include/llvm/TableGen/Record.h | 16 +- llvm/include/llvm/TableGen/SetTheory.h | 6 +- llvm/include/llvm/TableGen/StringMatcher.h | 2 +- .../include/llvm/Target/GlobalISel/Combine.td | 14 +- llvm/include/llvm/Target/Target.td | 6 +- llvm/include/llvm/Target/TargetMachine.h | 10 + .../llvm/TargetParser/SubtargetFeature.h | 2 +- llvm/include/llvm/TargetParser/TargetParser.h | 150 +- llvm/include/llvm/TargetParser/Triple.h | 20 +- llvm/include/llvm/Telemetry/Telemetry.h | 10 +- .../Testing/Demangle/DemangleTestCases.inc | 1 + .../ToolDrivers/llvm-dlltool/DlltoolDriver.h | 4 +- .../llvm/ToolDrivers/llvm-lib/LibDriver.h | 5 +- .../llvm/Transforms/HipStdPar/HipStdPar.h | 7 + llvm/include/llvm/Transforms/IPO/Attributor.h | 41 + .../Instrumentation/LowerAllowCheckPass.h | 1 + .../llvm/Transforms/Utils/PredicateInfo.h | 12 +- .../Vectorize/LoopVectorizationLegality.h | 8 + .../SandboxVectorizer/SeedCollector.h | 3 +- llvm/include/llvm/WindowsDriver/MSVCPaths.h | 72 +- .../WindowsManifest/WindowsManifestMerger.h | 14 +- llvm/include/llvm/XRay/InstrumentationMap.h | 2 +- llvm/include/llvm/XRay/Trace.h | 2 +- llvm/include/module.modulemap | 1 - llvm/lib/Analysis/BasicAliasAnalysis.cpp | 4 + llvm/lib/Analysis/BranchProbabilityInfo.cpp | 7 +- llvm/lib/Analysis/ConstantFolding.cpp | 47 +- llvm/lib/Analysis/DependenceAnalysis.cpp | 170 +- .../Analysis/DevelopmentModeInlineAdvisor.cpp | 10 +- .../Analysis/FunctionPropertiesAnalysis.cpp | 111 +- llvm/lib/Analysis/HashRecognize.cpp | 103 +- llvm/lib/Analysis/IR2Vec.cpp | 171 +- llvm/lib/Analysis/IVDescriptors.cpp | 61 +- .../IndirectCallPromotionAnalysis.cpp | 11 +- llvm/lib/Analysis/InlineAdvisor.cpp | 29 + llvm/lib/Analysis/InlineCost.cpp | 15 +- llvm/lib/Analysis/InstructionSimplify.cpp | 13 +- llvm/lib/Analysis/LazyValueInfo.cpp | 8 +- llvm/lib/Analysis/LoopAccessAnalysis.cpp | 103 +- llvm/lib/Analysis/LoopPass.cpp | 2 +- llvm/lib/Analysis/MLInlineAdvisor.cpp | 37 +- llvm/lib/Analysis/RegionPass.cpp | 2 +- llvm/lib/Analysis/TargetLibraryInfo.cpp | 8 +- llvm/lib/Analysis/ValueTracking.cpp | 165 +- .../models/seedEmbeddingVocab75D.json | 133 +- llvm/lib/AsmParser/LLParser.cpp | 149 +- llvm/lib/BinaryFormat/DXContainer.cpp | 69 + llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 32 +- llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 106 +- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 179 +- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 41 +- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 28 +- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | 2 + llvm/lib/CodeGen/AsmPrinter/DIE.cpp | 5 +- .../AsmPrinter/DbgEntityHistoryCalculator.cpp | 18 +- .../CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 9 +- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 50 +- .../CodeGen/AsmPrinter/DwarfExpression.cpp | 2 + llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 18 +- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h | 3 +- llvm/lib/CodeGen/AsmPrinter/WinException.cpp | 6 +- .../CodeGen/AssignmentTrackingAnalysis.cpp | 320 +- llvm/lib/CodeGen/BranchFolding.cpp | 7 + llvm/lib/CodeGen/CMakeLists.txt | 1 + llvm/lib/CodeGen/CodeGenPrepare.cpp | 7 + llvm/lib/CodeGen/CodeGenTargetMachineImpl.cpp | 6 +- llvm/lib/CodeGen/FaultMaps.cpp | 8 - .../lib/CodeGen/GlobalISel/CombinerHelper.cpp | 43 +- llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 2 +- .../CodeGen/GlobalISel/LegalizerHelper.cpp | 86 +- llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 2 +- llvm/lib/CodeGen/GlobalISel/Utils.cpp | 2 +- llvm/lib/CodeGen/GlobalMergeFunctions.cpp | 1 + llvm/lib/CodeGen/IfConversion.cpp | 35 +- llvm/lib/CodeGen/InterleavedAccessPass.cpp | 199 +- .../LiveDebugValues/InstrRefBasedImpl.cpp | 29 +- llvm/lib/CodeGen/MachineDomTreeUpdater.cpp | 9 +- llvm/lib/CodeGen/MachineDominators.cpp | 30 +- llvm/lib/CodeGen/MachineLICM.cpp | 6 +- llvm/lib/CodeGen/MachineLoopInfo.cpp | 7 +- llvm/lib/CodeGen/MachineOutliner.cpp | 17 + llvm/lib/CodeGen/MachinePassManager.cpp | 15 +- llvm/lib/CodeGen/MachinePostDominators.cpp | 33 +- llvm/lib/CodeGen/MachineScheduler.cpp | 28 +- llvm/lib/CodeGen/RegAllocScore.cpp | 17 +- llvm/lib/CodeGen/RegisterCoalescer.cpp | 8 +- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 434 +- .../lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 9 +- .../SelectionDAG/LegalizeFloatTypes.cpp | 36 +- .../SelectionDAG/ResourcePriorityQueue.cpp | 4 +- .../SelectionDAG/ScheduleDAGRRList.cpp | 6 +- .../lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 157 +- .../SelectionDAGAddressAnalysis.cpp | 6 +- .../SelectionDAG/SelectionDAGBuilder.cpp | 33 +- .../CodeGen/SelectionDAG/TargetLowering.cpp | 75 +- llvm/lib/CodeGen/TargetLoweringBase.cpp | 9 +- .../CodeGen/TargetLoweringObjectFileImpl.cpp | 78 +- llvm/lib/CodeGen/TargetOptionsImpl.cpp | 7 +- llvm/lib/CodeGen/TargetPassConfig.cpp | 3 + llvm/lib/CodeGen/WindowsSecureHotPatching.cpp | 617 ++ .../Parallel/DWARFLinkerCompileUnit.cpp | 6 +- llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp | 7 + .../CodeView/SymbolRecordMapping.cpp | 7 + .../DebugInfo/DWARF/LowLevel/CMakeLists.txt | 14 + llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp | 9 +- .../DebugInfo/LogicalView/Core/LVScope.cpp | 2 +- .../LogicalView/Readers/LVDWARFReader.cpp | 15 +- .../DebugInfo/PDB/Native/GSIStreamBuilder.cpp | 2 +- llvm/lib/DebugInfo/PDB/UDTLayout.cpp | 1 - llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 9 +- .../ExecutionEngine/JITLink/ELF_aarch64.cpp | 2 +- .../ExecutionEngine/JITLink/MachO_arm64.cpp | 2 +- .../JITLink/XCOFFLinkGraphBuilder.cpp | 2 +- llvm/lib/ExecutionEngine/JITLink/aarch64.cpp | 2 +- llvm/lib/ExecutionEngine/JITLink/ppc64.cpp | 2 +- llvm/lib/ExecutionEngine/JITLink/x86_64.cpp | 2 +- llvm/lib/ExecutionEngine/Orc/CMakeLists.txt | 2 + .../Orc/ExecutorProcessControl.cpp | 217 +- .../Orc/InProcessMemoryAccess.cpp | 134 + llvm/lib/ExecutionEngine/Orc/LLJIT.cpp | 16 +- .../ExecutionEngine/Orc/OrcV2CBindings.cpp | 6 +- llvm/lib/ExecutionEngine/Orc/SectCreate.cpp | 3 +- .../Orc/SelfExecutorProcessControl.cpp | 172 + .../Orc/Shared/OrcRTBridge.cpp | 19 +- .../ExecutionEngine/Orc/SimpleRemoteEPC.cpp | 10 +- llvm/lib/ExecutionEngine/Orc/Speculation.cpp | 2 - .../Orc/TargetProcess/OrcRTBootstrap.cpp | 100 +- .../ExecutionEngine/Orc/ThreadSafeModule.cpp | 81 +- llvm/lib/FileCheck/FileCheck.cpp | 54 +- llvm/lib/FileCheck/FileCheckImpl.h | 24 +- llvm/lib/Frontend/HLSL/CMakeLists.txt | 5 +- llvm/lib/Frontend/HLSL/HLSLRootSignature.cpp | 244 + .../Frontend/HLSL/HLSLRootSignatureUtils.cpp | 577 -- .../Frontend/HLSL/RootSignatureMetadata.cpp | 194 + .../HLSL/RootSignatureValidations.cpp | 84 + llvm/lib/Frontend/OpenMP/CMakeLists.txt | 1 + .../Frontend/OpenMP/DirectiveNameParser.cpp | 83 + llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 53 +- llvm/lib/FuzzMutate/IRMutator.cpp | 49 +- llvm/lib/FuzzMutate/RandomIRBuilder.cpp | 88 +- llvm/lib/IR/AsmWriter.cpp | 12 +- llvm/lib/IR/Attributes.cpp | 3 +- llvm/lib/IR/AutoUpgrade.cpp | 6 + llvm/lib/IR/DIBuilder.cpp | 110 +- llvm/lib/IR/DebugInfo.cpp | 17 +- llvm/lib/IR/DebugInfoMetadata.cpp | 139 +- llvm/lib/IR/DebugLoc.cpp | 26 +- llvm/lib/IR/Function.cpp | 14 +- llvm/lib/IR/IRBuilder.cpp | 2 +- llvm/lib/IR/Instructions.cpp | 6 +- llvm/lib/IR/LLVMContextImpl.h | 119 +- llvm/lib/IR/LegacyPassManager.cpp | 6 +- llvm/lib/IR/MDBuilder.cpp | 9 +- llvm/lib/IR/Metadata.cpp | 7 +- llvm/lib/IR/Module.cpp | 44 +- llvm/lib/IR/OptBisect.cpp | 14 +- llvm/lib/IR/Pass.cpp | 8 +- llvm/lib/IR/ProfDataUtils.cpp | 52 +- llvm/lib/IR/RuntimeLibcalls.cpp | 680 +- llvm/lib/IR/Type.cpp | 2 +- llvm/lib/IR/Verifier.cpp | 112 +- llvm/lib/IR/ZOSLibcallNames.def | 100 - llvm/lib/LTO/LTO.cpp | 12 +- llvm/lib/MC/CMakeLists.txt | 1 + llvm/lib/MC/ConstantPools.cpp | 2 +- llvm/lib/MC/DXContainerRootSignature.cpp | 45 +- llvm/lib/MC/ELFObjectWriter.cpp | 49 +- llvm/lib/MC/GOFFObjectWriter.cpp | 344 +- llvm/lib/MC/MCAsmBackend.cpp | 36 +- llvm/lib/MC/MCAsmInfo.cpp | 19 +- llvm/lib/MC/MCAsmStreamer.cpp | 36 +- llvm/lib/MC/MCAssembler.cpp | 351 +- llvm/lib/MC/MCCodeView.cpp | 25 +- llvm/lib/MC/MCContext.cpp | 48 +- llvm/lib/MC/MCDXContainerStreamer.cpp | 3 - llvm/lib/MC/MCDisassembler/Disassembler.h | 2 +- llvm/lib/MC/MCDwarf.cpp | 10 +- llvm/lib/MC/MCELFStreamer.cpp | 14 +- llvm/lib/MC/MCExpr.cpp | 25 +- llvm/lib/MC/MCFragment.cpp | 186 +- llvm/lib/MC/MCGOFFStreamer.cpp | 20 + llvm/lib/MC/MCInst.cpp | 31 +- llvm/lib/MC/MCMachOStreamer.cpp | 20 - llvm/lib/MC/MCObjectFileInfo.cpp | 58 +- llvm/lib/MC/MCObjectStreamer.cpp | 66 +- llvm/lib/MC/MCObjectWriter.cpp | 1 - llvm/lib/MC/MCParser/AsmParser.cpp | 40 +- llvm/lib/MC/MCParser/MCAsmParser.cpp | 4 +- llvm/lib/MC/MCParser/MasmParser.cpp | 2 +- llvm/lib/MC/MCPseudoProbe.cpp | 6 +- llvm/lib/MC/MCRegisterInfo.cpp | 2 +- llvm/lib/MC/MCSPIRVStreamer.cpp | 15 - llvm/lib/MC/MCSchedule.cpp | 1 + llvm/lib/MC/MCSection.cpp | 67 +- llvm/lib/MC/MCSectionELF.cpp | 3 +- llvm/lib/MC/MCSectionGOFF.cpp | 143 + llvm/lib/MC/MCStreamer.cpp | 8 +- llvm/lib/MC/MCSubtargetInfo.cpp | 1 + llvm/lib/MC/MCSymbol.cpp | 1 - llvm/lib/MC/MCWasmStreamer.cpp | 21 - llvm/lib/MC/MCWin64EH.cpp | 2 +- llvm/lib/MC/MCWinCOFFStreamer.cpp | 28 +- llvm/lib/MC/MCXCOFFStreamer.cpp | 22 +- llvm/lib/MC/MachObjectWriter.cpp | 13 +- llvm/lib/MC/WasmObjectWriter.cpp | 4 +- llvm/lib/MC/WinCOFFObjectWriter.cpp | 7 +- llvm/lib/MC/XCOFFObjectWriter.cpp | 10 +- llvm/lib/MCA/CodeEmitter.cpp | 6 +- llvm/lib/MCA/InstrBuilder.cpp | 3 +- llvm/lib/ObjCopy/COFF/COFFWriter.cpp | 7 +- llvm/lib/Object/ArchiveWriter.cpp | 4 +- llvm/lib/Object/ELF.cpp | 60 +- llvm/lib/Object/ELFObjectFile.cpp | 3 +- llvm/lib/Object/IRSymtab.cpp | 8 +- llvm/lib/Object/OffloadBundle.cpp | 3 +- llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp | 5 + llvm/lib/ObjectYAML/DXContainerYAML.cpp | 124 +- llvm/lib/ObjectYAML/ELFYAML.cpp | 1 - llvm/lib/Option/Arg.cpp | 17 +- llvm/lib/Passes/PassBuilder.cpp | 245 +- llvm/lib/Passes/PassBuilderPipelines.cpp | 7 +- llvm/lib/Passes/PassRegistry.def | 123 +- llvm/lib/Passes/StandardInstrumentations.cpp | 2 +- llvm/lib/ProfileData/InstrProf.cpp | 25 +- llvm/lib/ProfileData/InstrProfReader.cpp | 6 +- llvm/lib/Support/Signals.cpp | 206 +- llvm/lib/Support/TextEncoding.cpp | 2 +- llvm/lib/Support/Unix/Signals.inc | 15 + llvm/lib/Support/Unix/Threading.inc | 15 +- llvm/lib/Support/Windows/Process.inc | 5 - llvm/lib/Support/Windows/Signals.inc | 65 +- llvm/lib/Support/Z3Solver.cpp | 3 +- llvm/lib/TableGen/DetailedRecordsBackend.cpp | 4 +- llvm/lib/TableGen/Error.cpp | 12 +- llvm/lib/TableGen/Main.cpp | 4 +- llvm/lib/TableGen/Record.cpp | 12 +- llvm/lib/TableGen/StringMatcher.cpp | 9 +- llvm/lib/TableGen/StringToOffsetTable.cpp | 6 +- llvm/lib/TableGen/TGLexer.cpp | 38 +- llvm/lib/TableGen/TGLexer.h | 58 +- llvm/lib/TableGen/TGParser.cpp | 48 +- llvm/lib/TableGen/TGParser.h | 6 +- llvm/lib/Target/AArch64/AArch64.td | 12 +- llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp | 14 +- llvm/lib/Target/AArch64/AArch64Features.td | 20 +- .../Target/AArch64/AArch64FrameLowering.cpp | 10 +- .../Target/AArch64/AArch64ISelLowering.cpp | 1488 ++-- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 89 +- llvm/lib/Target/AArch64/AArch64InstrInfo.td | 51 +- .../AArch64/AArch64LoadStoreOptimizer.cpp | 4 +- .../lib/Target/AArch64/AArch64MCInstLower.cpp | 83 +- .../AArch64/AArch64MachineFunctionInfo.h | 14 + .../Target/AArch64/AArch64PerfectShuffle.h | 42 + llvm/lib/Target/AArch64/AArch64Processors.td | 39 +- .../Target/AArch64/AArch64PromoteConstant.cpp | 4 + .../lib/Target/AArch64/AArch64SMEInstrInfo.td | 2 + .../lib/Target/AArch64/AArch64SVEInstrInfo.td | 98 +- .../Target/AArch64/AArch64SchedNeoverseN2.td | 2 +- .../AArch64/AArch64SelectionDAGInfo.cpp | 16 +- .../Target/AArch64/AArch64TargetMachine.cpp | 12 +- .../lib/Target/AArch64/AArch64TargetMachine.h | 3 + .../AArch64/AArch64TargetObjectFile.cpp | 10 +- .../AArch64/AArch64TargetTransformInfo.cpp | 48 +- .../AArch64/AsmParser/AArch64AsmParser.cpp | 321 +- .../AArch64ExternalSymbolizer.cpp | 20 +- .../AArch64/GISel/AArch64LegalizerInfo.cpp | 16 +- .../MCTargetDesc/AArch64AsmBackend.cpp | 114 +- .../MCTargetDesc/AArch64ELFObjectWriter.cpp | 241 +- .../MCTargetDesc/AArch64InstPrinter.cpp | 10 + .../AArch64/MCTargetDesc/AArch64MCAsmInfo.cpp | 151 +- .../AArch64/MCTargetDesc/AArch64MCAsmInfo.h | 159 +- .../MCTargetDesc/AArch64MCCodeEmitter.cpp | 94 +- .../AArch64/MCTargetDesc/AArch64MCExpr.cpp | 5 +- .../AArch64/MCTargetDesc/AArch64MCExpr.h | 174 - .../MCTargetDesc/AArch64MachObjectWriter.cpp | 40 +- .../MCTargetDesc/AArch64TargetStreamer.h | 2 +- .../AArch64WinCOFFObjectWriter.cpp | 30 +- llvm/lib/Target/AMDGPU/AMDGPU.h | 11 + llvm/lib/Target/AMDGPU/AMDGPU.td | 30 +- .../AMDGPU/AMDGPUExpandFeaturePredicates.cpp | 48 +- llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp | 118 +- .../Target/AMDGPU/AMDGPUInsertDelayAlu.cpp | 19 +- .../AMDGPU/AMDGPUInstCombineIntrinsic.cpp | 47 +- llvm/lib/Target/AMDGPU/AMDGPUPassRegistry.def | 3 + .../AMDGPU/AMDGPURegBankLegalizeHelper.cpp | 9 +- .../AMDGPU/AMDGPURegBankLegalizeHelper.h | 6 +- .../Target/AMDGPU/AMDGPURegisterBankInfo.cpp | 42 + .../AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp | 304 + .../Target/AMDGPU/AMDGPUSearchableTables.td | 6 + llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | 1 + .../lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 11 +- .../AMDGPU/AMDGPUTargetTransformInfo.cpp | 59 +- .../Target/AMDGPU/AMDGPUTargetTransformInfo.h | 15 +- .../AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 54 +- llvm/lib/Target/AMDGPU/BUFInstructions.td | 53 +- llvm/lib/Target/AMDGPU/CMakeLists.txt | 1 + llvm/lib/Target/AMDGPU/DSDIRInstructions.td | 4 +- llvm/lib/Target/AMDGPU/DSInstructions.td | 76 +- .../Disassembler/AMDGPUDisassembler.cpp | 15 +- llvm/lib/Target/AMDGPU/EXPInstructions.td | 1 + llvm/lib/Target/AMDGPU/FLATInstructions.td | 179 +- .../lib/Target/AMDGPU/GCNHazardRecognizer.cpp | 7 +- llvm/lib/Target/AMDGPU/GCNRegPressure.cpp | 63 + llvm/lib/Target/AMDGPU/GCNRegPressure.h | 97 +- llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp | 259 +- llvm/lib/Target/AMDGPU/GCNSchedStrategy.h | 2 - llvm/lib/Target/AMDGPU/GCNSubtarget.cpp | 7 - llvm/lib/Target/AMDGPU/GCNSubtarget.h | 24 +- .../AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp | 20 +- .../MCTargetDesc/AMDGPUELFObjectWriter.cpp | 2 - .../AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp | 10 +- .../AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp | 4 +- .../MCTargetDesc/AMDGPUMCCodeEmitter.cpp | 24 +- .../AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp | 2 +- llvm/lib/Target/AMDGPU/MIMGInstructions.td | 94 + llvm/lib/Target/AMDGPU/SIDefines.h | 6 +- llvm/lib/Target/AMDGPU/SIFoldOperands.cpp | 530 +- llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 159 +- llvm/lib/Target/AMDGPU/SIISelLowering.h | 4 +- llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp | 185 +- llvm/lib/Target/AMDGPU/SIInstrFormats.td | 12 +- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 45 +- llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp | 4 + llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | 4 + llvm/lib/Target/AMDGPU/SIRegisterInfo.h | 4 + llvm/lib/Target/AMDGPU/SIRegisterInfo.td | 4 + .../Target/AMDGPU/SIShrinkInstructions.cpp | 5 +- llvm/lib/Target/AMDGPU/SOPInstructions.td | 14 + .../Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 33 + llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h | 20 +- .../Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp | 2 +- llvm/lib/Target/AMDGPU/VOP1Instructions.td | 75 +- llvm/lib/Target/AMDGPU/VOP2Instructions.td | 19 +- llvm/lib/Target/AMDGPU/VOP3Instructions.td | 27 +- llvm/lib/Target/AMDGPU/VOPCInstructions.td | 2 +- llvm/lib/Target/AMDGPU/VOPInstructions.td | 48 +- llvm/lib/Target/ARC/ARCMCInstLower.cpp | 3 +- .../ARC/MCTargetDesc/ARCInstPrinter.cpp | 2 +- llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 2 +- llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 4 +- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | 4 +- llvm/lib/Target/ARM/ARMFrameLowering.cpp | 4 +- llvm/lib/Target/ARM/ARMISelLowering.cpp | 290 +- llvm/lib/Target/ARM/ARMISelLowering.h | 5 + llvm/lib/Target/ARM/ARMInstrNEON.td | 12 +- llvm/lib/Target/ARM/ARMInstrVFP.td | 7 +- llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp | 18 +- .../lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 17 +- .../Target/ARM/MCTargetDesc/ARMAsmBackend.cpp | 181 +- .../Target/ARM/MCTargetDesc/ARMAsmBackend.h | 5 +- .../ARM/MCTargetDesc/ARMELFStreamer.cpp | 6 +- .../Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp | 12 +- .../Target/ARM/MCTargetDesc/ARMMCAsmInfo.h | 2 + .../ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | 156 +- .../ARM/MCTargetDesc/ARMMachObjectWriter.cpp | 6 +- .../MCTargetDesc/ARMWinCOFFObjectWriter.cpp | 13 +- .../lib/Target/AVR/AsmParser/AVRAsmParser.cpp | 10 +- .../Target/AVR/MCTargetDesc/AVRAsmBackend.cpp | 26 +- .../Target/AVR/MCTargetDesc/AVRAsmBackend.h | 3 - .../AVR/MCTargetDesc/AVRInstPrinter.cpp | 4 +- .../Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp | 2 +- .../AVR/MCTargetDesc/AVRMCCodeEmitter.cpp | 26 +- .../AVR/MCTargetDesc/AVRMCELFStreamer.cpp | 6 +- .../lib/Target/BPF/AsmParser/BPFAsmParser.cpp | 8 +- .../Target/BPF/MCTargetDesc/BPFAsmBackend.cpp | 12 +- .../BPF/MCTargetDesc/BPFELFObjectWriter.cpp | 5 +- .../BPF/MCTargetDesc/BPFInstPrinter.cpp | 24 +- .../BPF/MCTargetDesc/BPFMCCodeEmitter.cpp | 13 +- llvm/lib/Target/CMakeLists.txt | 2 +- .../Target/CSKY/AsmParser/CSKYAsmParser.cpp | 52 +- llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp | 25 +- llvm/lib/Target/CSKY/CSKYISelLowering.cpp | 3 - llvm/lib/Target/CSKY/CSKYMCInstLower.cpp | 22 +- .../Target/CSKY/MCTargetDesc/CMakeLists.txt | 1 - .../CSKY/MCTargetDesc/CSKYAsmBackend.cpp | 47 +- .../Target/CSKY/MCTargetDesc/CSKYAsmBackend.h | 5 +- .../CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp | 59 +- .../CSKY/MCTargetDesc/CSKYInstPrinter.cpp | 8 +- .../CSKY/MCTargetDesc/CSKYMCAsmInfo.cpp | 53 +- .../Target/CSKY/MCTargetDesc/CSKYMCAsmInfo.h | 28 + .../CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp | 225 +- .../CSKY/MCTargetDesc/CSKYMCCodeEmitter.h | 188 - .../Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp | 76 - .../lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.h | 75 - .../CSKY/MCTargetDesc/CSKYMCTargetDesc.cpp | 1 - .../CSKY/MCTargetDesc/CSKYTargetStreamer.cpp | 9 +- .../CSKY/MCTargetDesc/CSKYTargetStreamer.h | 8 +- llvm/lib/Target/DirectX/DXILCBufferAccess.cpp | 270 +- .../Target/DirectX/DXILDataScalarization.cpp | 19 +- .../Target/DirectX/DXILIntrinsicExpansion.cpp | 132 +- llvm/lib/Target/DirectX/DXILPrepare.cpp | 11 + llvm/lib/Target/DirectX/DXILRootSignature.cpp | 231 +- llvm/lib/Target/DirectX/DXILRootSignature.h | 1 + .../DirectX/DirectXTargetTransformInfo.cpp | 2 + .../Hexagon/AsmParser/HexagonAsmParser.cpp | 4 +- llvm/lib/Target/Hexagon/HexagonBlockRanges.h | 2 +- .../Hexagon/HexagonConstPropagation.cpp | 3 +- .../Target/Hexagon/HexagonFrameLowering.cpp | 5 +- llvm/lib/Target/Hexagon/HexagonGenExtract.cpp | 3 - .../Target/Hexagon/HexagonISelLowering.cpp | 19 +- llvm/lib/Target/Hexagon/HexagonISelLowering.h | 5 + .../Target/Hexagon/HexagonISelLoweringHVX.cpp | 17 +- .../lib/Target/Hexagon/HexagonOptAddrMode.cpp | 7 +- .../Hexagon/HexagonSelectionDAGInfo.cpp | 10 +- .../MCTargetDesc/HexagonAsmBackend.cpp | 305 +- .../MCTargetDesc/HexagonELFObjectWriter.cpp | 2 - .../Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp | 4 +- .../MCTargetDesc/HexagonMCCodeEmitter.cpp | 36 +- .../Hexagon/MCTargetDesc/HexagonMCExpr.h | 5 - .../Target/Lanai/AsmParser/LanaiAsmParser.cpp | 17 +- llvm/lib/Target/Lanai/LanaiISelLowering.cpp | 10 +- .../Lanai/MCTargetDesc/LanaiAsmBackend.cpp | 10 +- .../Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp | 3 +- .../AsmParser/LoongArchAsmParser.cpp | 5 +- .../LoongArch/LoongArchFloat64InstrInfo.td | 16 + .../LoongArch/LoongArchISelLowering.cpp | 314 +- .../Target/LoongArch/LoongArchISelLowering.h | 4 + .../Target/LoongArch/LoongArchInstrInfo.td | 12 + .../Target/LoongArch/LoongArchMCInstLower.cpp | 2 +- .../LoongArch/MCTargetDesc/CMakeLists.txt | 1 - .../MCTargetDesc/LoongArchAsmBackend.cpp | 64 +- .../MCTargetDesc/LoongArchAsmBackend.h | 9 +- .../MCTargetDesc/LoongArchMCAsmInfo.cpp | 179 +- .../MCTargetDesc/LoongArchMCAsmInfo.h | 21 +- .../MCTargetDesc/LoongArchMCCodeEmitter.cpp | 24 +- .../MCTargetDesc/LoongArchMCExpr.cpp | 199 - .../LoongArch/MCTargetDesc/LoongArchMCExpr.h | 43 - .../Target/M68k/AsmParser/M68kAsmParser.cpp | 5 +- llvm/lib/Target/M68k/M68kInstrInfo.cpp | 4 +- .../M68k/MCTargetDesc/M68kAsmBackend.cpp | 85 +- .../M68k/MCTargetDesc/M68kELFObjectWriter.cpp | 3 - .../Target/M68k/MCTargetDesc/M68kFixupKinds.h | 21 - .../M68k/MCTargetDesc/M68kMCAsmInfo.cpp | 4 +- .../M68k/MCTargetDesc/M68kMCCodeEmitter.cpp | 14 +- .../MSP430/AsmParser/MSP430AsmParser.cpp | 10 +- .../MSP430/MCTargetDesc/MSP430AsmBackend.cpp | 16 +- .../MCTargetDesc/MSP430MCCodeEmitter.cpp | 23 +- llvm/lib/Target/MSP430/MSP430ISelLowering.cpp | 77 +- .../Target/Mips/AsmParser/MipsAsmParser.cpp | 12 +- .../Mips/MCTargetDesc/MipsAsmBackend.cpp | 218 +- .../Target/Mips/MCTargetDesc/MipsAsmBackend.h | 3 - .../Mips/MCTargetDesc/MipsMCCodeEmitter.cpp | 75 +- .../Mips/MCTargetDesc/MipsMCTargetDesc.cpp | 2 +- .../Mips/MCTargetDesc/MipsTargetStreamer.cpp | 24 +- llvm/lib/Target/Mips/Mips16ISelLowering.cpp | 89 +- llvm/lib/Target/Mips/MipsISelLowering.cpp | 3 - .../NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp | 22 + .../NVPTX/MCTargetDesc/NVPTXInstPrinter.h | 2 + llvm/lib/Target/NVPTX/NVPTX.h | 1 + llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 279 +- llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h | 3 +- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 808 ++- llvm/lib/Target/NVPTX/NVPTXISelLowering.h | 53 +- llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp | 20 +- llvm/lib/Target/NVPTX/NVPTXInstrInfo.h | 3 - llvm/lib/Target/NVPTX/NVPTXInstrInfo.td | 381 +- llvm/lib/Target/NVPTX/NVPTXIntrinsics.td | 2 + .../Target/NVPTX/NVPTXPrologEpilogPass.cpp | 84 +- llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp | 15 +- llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp | 1 + .../Target/PowerPC/AsmParser/PPCAsmParser.cpp | 13 +- .../PowerPC/MCTargetDesc/CMakeLists.txt | 1 - .../PowerPC/MCTargetDesc/PPCAsmBackend.cpp | 163 +- .../MCTargetDesc/PPCELFObjectWriter.cpp | 2 +- .../PowerPC/MCTargetDesc/PPCELFStreamer.cpp | 6 +- .../PowerPC/MCTargetDesc/PPCInstPrinter.cpp | 2 +- .../PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp | 86 +- .../PowerPC/MCTargetDesc/PPCMCAsmInfo.h | 11 + .../PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp | 80 +- .../Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp | 77 - .../Target/PowerPC/MCTargetDesc/PPCMCExpr.h | 35 - .../PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp | 8 +- .../PowerPC/MCTargetDesc/PPCTargetStreamer.h | 2 +- .../MCTargetDesc/PPCXCOFFObjectWriter.cpp | 2 +- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 29 +- llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp | 1 - llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 20 +- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 15 + llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 83 +- llvm/lib/Target/PowerPC/PPCInstrAltivec.td | 12 +- llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 5 +- .../Target/PowerPC/PPCReduceCRLogicals.cpp | 33 +- .../Target/RISCV/AsmParser/RISCVAsmParser.cpp | 33 +- .../RISCV/Disassembler/RISCVDisassembler.cpp | 14 +- .../RISCV/MCTargetDesc/RISCVAsmBackend.cpp | 79 +- .../RISCV/MCTargetDesc/RISCVAsmBackend.h | 8 +- .../Target/RISCV/MCTargetDesc/RISCVBaseInfo.h | 3 + .../RISCV/MCTargetDesc/RISCVFixupKinds.h | 20 +- .../RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp | 44 +- llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp | 27 +- .../Target/RISCV/RISCVExpandPseudoInsts.cpp | 20 +- llvm/lib/Target/RISCV/RISCVFeatures.td | 29 +- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 273 +- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h | 2 +- llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 238 +- llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | 5 +- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 488 +- llvm/lib/Target/RISCV/RISCVInstrInfo.h | 21 +- llvm/lib/Target/RISCV/RISCVInstrInfo.td | 15 +- llvm/lib/Target/RISCV/RISCVInstrInfoC.td | 10 +- llvm/lib/Target/RISCV/RISCVInstrInfoP.td | 163 + .../Target/RISCV/RISCVInstrInfoVPseudos.td | 67 +- .../Target/RISCV/RISCVInstrInfoVSDPatterns.td | 2 +- .../Target/RISCV/RISCVInstrInfoVVLPatterns.td | 6 +- llvm/lib/Target/RISCV/RISCVInstrInfoXAndes.td | 152 +- llvm/lib/Target/RISCV/RISCVInstrInfoXCV.td | 9 +- llvm/lib/Target/RISCV/RISCVInstrInfoXMips.td | 38 + llvm/lib/Target/RISCV/RISCVInstrInfoXSf.td | 112 +- llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td | 38 +- llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td | 78 +- llvm/lib/Target/RISCV/RISCVInstrInfoZicbo.td | 4 +- llvm/lib/Target/RISCV/RISCVInstrPredicates.td | 2 + llvm/lib/Target/RISCV/RISCVLateBranchOpt.cpp | 2 +- llvm/lib/Target/RISCV/RISCVProcessors.td | 3 +- .../RISCV/RISCVRedundantCopyElimination.cpp | 10 +- llvm/lib/Target/RISCV/RISCVSchedSiFive7.td | 12 +- llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp | 20 + llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp | 155 +- .../SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp | 18 +- llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp | 38 +- llvm/lib/Target/SPIRV/SPIRVBuiltins.td | 1 + llvm/lib/Target/SPIRV/SPIRVCommandLine.cpp | 11 +- llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp | 3 +- llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp | 34 + llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h | 15 +- .../Target/SPIRV/SPIRVInstructionSelector.cpp | 62 +- llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp | 28 +- .../lib/Target/SPIRV/SPIRVSymbolicOperands.td | 5 +- .../Target/Sparc/AsmParser/SparcAsmParser.cpp | 9 +- .../Sparc/MCTargetDesc/SparcAsmBackend.cpp | 28 +- .../Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp | 38 +- llvm/lib/Target/Sparc/SparcISelLowering.cpp | 116 +- .../SystemZ/AsmParser/SystemZAsmParser.cpp | 35 +- .../MCTargetDesc/SystemZHLASMAsmStreamer.cpp | 7 +- .../MCTargetDesc/SystemZHLASMAsmStreamer.h | 10 +- .../MCTargetDesc/SystemZInstPrinterCommon.cpp | 4 +- .../MCTargetDesc/SystemZMCAsmBackend.cpp | 14 +- .../SystemZ/MCTargetDesc/SystemZMCAsmInfo.cpp | 6 +- .../MCTargetDesc/SystemZMCCodeEmitter.cpp | 15 +- .../SystemZ/MCTargetDesc/SystemZMCFixups.h | 40 +- .../MCTargetDesc/SystemZMCTargetDesc.cpp | 2 +- .../MCTargetDesc/SystemZTargetStreamer.cpp | 7 + .../MCTargetDesc/SystemZTargetStreamer.h | 4 + llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp | 10 +- .../Target/SystemZ/SystemZISelLowering.cpp | 13 +- llvm/lib/Target/VE/AsmParser/VEAsmParser.cpp | 34 +- .../lib/Target/VE/MCTargetDesc/CMakeLists.txt | 1 - .../Target/VE/MCTargetDesc/VEAsmBackend.cpp | 106 +- .../VE/MCTargetDesc/VEELFObjectWriter.cpp | 6 +- .../Target/VE/MCTargetDesc/VEMCAsmInfo.cpp | 42 +- llvm/lib/Target/VE/MCTargetDesc/VEMCAsmInfo.h | 25 + .../VE/MCTargetDesc/VEMCCodeEmitter.cpp | 19 +- llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.cpp | 60 - llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.h | 50 - llvm/lib/Target/VE/VEAsmPrinter.cpp | 2 +- llvm/lib/Target/VE/VEISelLowering.cpp | 15 +- llvm/lib/Target/VE/VEMCInstLower.cpp | 2 +- .../AsmParser/WebAssemblyAsmParser.cpp | 4 +- .../AsmParser/WebAssemblyAsmTypeCheck.cpp | 2 +- .../Disassembler/WebAssemblyDisassembler.cpp | 2 +- .../MCTargetDesc/WebAssemblyAsmBackend.cpp | 10 +- .../MCTargetDesc/WebAssemblyInstPrinter.cpp | 2 +- .../MCTargetDesc/WebAssemblyMCAsmInfo.cpp | 12 +- .../MCTargetDesc/WebAssemblyMCAsmInfo.h | 12 + .../MCTargetDesc/WebAssemblyMCCodeEmitter.cpp | 14 +- .../MCTargetDesc/WebAssemblyMCExpr.h | 29 - .../MCTargetDesc/WebAssemblyMCTargetDesc.cpp | 29 - .../MCTargetDesc/WebAssemblyMCTargetDesc.h | 7 - .../WebAssemblyTargetStreamer.cpp | 5 +- .../WebAssemblyWasmObjectWriter.cpp | 2 +- llvm/lib/Target/WebAssembly/WebAssembly.h | 2 +- .../WebAssembly/WebAssemblyAsmPrinter.cpp | 15 +- .../WebAssembly/WebAssemblyAsmPrinter.h | 2 +- .../WebAssembly/WebAssemblyCFGStackify.cpp | 2 +- .../WebAssembly/WebAssemblyISelDAGToDAG.cpp | 14 +- .../WebAssembly/WebAssemblyISelLowering.cpp | 211 +- .../WebAssembly/WebAssemblyLateEHPrepare.cpp | 2 +- .../WebAssembly/WebAssemblyMCInstLower.cpp | 6 +- .../WebAssembly/WebAssemblyRegStackify.cpp | 138 +- .../WebAssembly/WebAssemblyRegisterInfo.td | 4 +- .../WebAssembly/WebAssemblyTargetMachine.cpp | 153 +- .../WebAssembly/WebAssemblyTargetMachine.h | 9 + .../lib/Target/X86/AsmParser/X86AsmParser.cpp | 5 +- llvm/lib/Target/X86/AsmParser/X86Operand.h | 3 +- .../lib/Target/X86/GISel/X86LegalizerInfo.cpp | 13 +- .../Target/X86/GISel/X86RegisterBankInfo.cpp | 7 +- .../Target/X86/MCTargetDesc/CMakeLists.txt | 1 + .../Target/X86/MCTargetDesc/X86AsmBackend.cpp | 74 +- .../X86/MCTargetDesc/X86ELFObjectWriter.cpp | 128 +- .../MCTargetDesc/X86EncodingOptimization.cpp | 6 +- .../Target/X86/MCTargetDesc/X86MCAsmInfo.cpp | 67 +- .../Target/X86/MCTargetDesc/X86MCAsmInfo.h | 38 + .../X86/MCTargetDesc/X86MCCodeEmitter.cpp | 148 +- llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h | 45 - .../X86/MCTargetDesc/X86MachObjectWriter.cpp | 25 +- .../MCTargetDesc/X86WinCOFFObjectWriter.cpp | 22 +- llvm/lib/Target/X86/X86.td | 7 +- llvm/lib/Target/X86/X86ISelLowering.cpp | 273 +- llvm/lib/Target/X86/X86ISelLoweringCall.cpp | 26 +- llvm/lib/Target/X86/X86MCInstLower.cpp | 77 +- llvm/lib/Target/X86/X86PfmCounters.td | 20 + llvm/lib/Target/X86/X86PreTileConfig.cpp | 4 +- llvm/lib/Target/X86/X86RegisterInfo.cpp | 2 +- llvm/lib/Target/X86/X86SchedLunarlakeP.td | 2409 ++++++ llvm/lib/Target/X86/X86TargetObjectFile.cpp | 12 +- .../lib/Target/X86/X86TargetTransformInfo.cpp | 9 +- .../XCore/MCTargetDesc/XCoreInstPrinter.cpp | 2 +- llvm/lib/Target/XCore/XCoreISelLowering.cpp | 10 +- llvm/lib/Target/XCore/XCoreMCInstLower.cpp | 4 +- .../Target/XCore/XCoreSelectionDAGInfo.cpp | 13 +- .../Xtensa/AsmParser/XtensaAsmParser.cpp | 6 +- .../Xtensa/MCTargetDesc/XtensaAsmBackend.cpp | 47 +- .../MCTargetDesc/XtensaELFObjectWriter.cpp | 5 +- .../Xtensa/MCTargetDesc/XtensaInstPrinter.cpp | 2 +- .../Xtensa/MCTargetDesc/XtensaMCAsmInfo.cpp | 1 - .../Xtensa/MCTargetDesc/XtensaMCAsmInfo.h | 9 + .../MCTargetDesc/XtensaMCCodeEmitter.cpp | 39 +- .../Target/Xtensa/MCTargetDesc/XtensaMCExpr.h | 33 - .../MCTargetDesc/XtensaMCTargetDesc.cpp | 23 +- llvm/lib/Target/Xtensa/XtensaAsmPrinter.cpp | 2 +- llvm/lib/Target/Xtensa/XtensaFeatures.td | 10 + llvm/lib/Target/Xtensa/XtensaISelLowering.cpp | 174 +- llvm/lib/Target/Xtensa/XtensaISelLowering.h | 9 + llvm/lib/Target/Xtensa/XtensaInstrInfo.cpp | 27 + llvm/lib/Target/Xtensa/XtensaInstrInfo.td | 31 +- llvm/lib/Target/Xtensa/XtensaOperators.td | 15 +- llvm/lib/Target/Xtensa/XtensaRegisterInfo.cpp | 5 +- llvm/lib/Target/Xtensa/XtensaRegisterInfo.td | 11 +- llvm/lib/Target/Xtensa/XtensaSubtarget.h | 2 +- llvm/lib/TargetParser/AArch64TargetParser.cpp | 9 +- llvm/lib/TargetParser/CSKYTargetParser.cpp | 1 + llvm/lib/TargetParser/Host.cpp | 36 +- .../TargetParser/LoongArchTargetParser.cpp | 1 + llvm/lib/TargetParser/TargetParser.cpp | 1 + llvm/lib/TargetParser/Triple.cpp | 66 +- llvm/lib/TargetParser/Unix/Host.inc | 2 +- .../lib/Transforms/Coroutines/CoroCleanup.cpp | 10 +- llvm/lib/Transforms/Coroutines/CoroEarly.cpp | 11 +- llvm/lib/Transforms/Coroutines/CoroElide.cpp | 2 +- llvm/lib/Transforms/Coroutines/CoroFrame.cpp | 5 +- llvm/lib/Transforms/Coroutines/CoroInternal.h | 3 +- llvm/lib/Transforms/Coroutines/CoroSplit.cpp | 33 +- llvm/lib/Transforms/Coroutines/Coroutines.cpp | 95 +- llvm/lib/Transforms/Coroutines/SpillUtils.cpp | 8 +- llvm/lib/Transforms/HipStdPar/HipStdPar.cpp | 118 + llvm/lib/Transforms/IPO/Attributor.cpp | 9 + .../Transforms/IPO/AttributorAttributes.cpp | 424 +- llvm/lib/Transforms/IPO/EmbedBitcodePass.cpp | 8 +- llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 20 +- llvm/lib/Transforms/IPO/GlobalOpt.cpp | 173 +- llvm/lib/Transforms/IPO/StripSymbols.cpp | 3 +- .../InstCombine/InstCombineAddSub.cpp | 21 +- .../InstCombine/InstCombineAndOrXor.cpp | 2 +- .../InstCombine/InstCombineCalls.cpp | 78 +- .../InstCombine/InstCombineCompares.cpp | 129 +- .../InstCombine/InstCombineInternal.h | 15 + .../InstCombine/InstCombineVectorOps.cpp | 66 +- .../InstCombine/InstructionCombining.cpp | 158 +- .../Instrumentation/LowerAllowCheckPass.cpp | 73 +- .../Instrumentation/MemorySanitizer.cpp | 138 +- .../Instrumentation/PGOInstrumentation.cpp | 51 +- .../Scalar/DeadStoreElimination.cpp | 6 +- llvm/lib/Transforms/Scalar/EarlyCSE.cpp | 18 +- llvm/lib/Transforms/Scalar/LICM.cpp | 8 +- llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 3 +- .../lib/Transforms/Scalar/LoopInterchange.cpp | 43 +- .../Transforms/Scalar/LoopStrengthReduce.cpp | 94 +- .../Scalar/LowerMatrixIntrinsics.cpp | 2 +- llvm/lib/Transforms/Scalar/MergeICmps.cpp | 4 + llvm/lib/Transforms/Scalar/NewGVN.cpp | 7 +- llvm/lib/Transforms/Scalar/Reassociate.cpp | 10 +- llvm/lib/Transforms/Scalar/SROA.cpp | 31 +- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 23 +- llvm/lib/Transforms/Utils/CodeExtractor.cpp | 91 +- llvm/lib/Transforms/Utils/Debugify.cpp | 88 +- llvm/lib/Transforms/Utils/InlineFunction.cpp | 20 +- llvm/lib/Transforms/Utils/Local.cpp | 18 +- llvm/lib/Transforms/Utils/LoopUtils.cpp | 10 +- llvm/lib/Transforms/Utils/PredicateInfo.cpp | 25 +- .../Utils/RelLookupTableConverter.cpp | 37 +- llvm/lib/Transforms/Utils/SCCPSolver.cpp | 172 +- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 54 +- .../Transforms/Vectorize/LoopVectorize.cpp | 368 +- .../Transforms/Vectorize/SLPVectorizer.cpp | 21 +- .../Passes/SeedCollection.cpp | 11 +- .../SandboxVectorizer/SeedCollector.cpp | 12 +- .../Transforms/Vectorize/VPRecipeBuilder.h | 15 +- llvm/lib/Transforms/Vectorize/VPlan.cpp | 46 +- llvm/lib/Transforms/Vectorize/VPlan.h | 409 +- .../Transforms/Vectorize/VPlanAnalysis.cpp | 14 +- llvm/lib/Transforms/Vectorize/VPlanHelpers.h | 6 + .../Transforms/Vectorize/VPlanPatternMatch.h | 20 + .../lib/Transforms/Vectorize/VPlanRecipes.cpp | 627 +- .../Transforms/Vectorize/VPlanTransforms.cpp | 329 +- .../Transforms/Vectorize/VPlanTransforms.h | 10 +- llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp | 104 +- llvm/lib/Transforms/Vectorize/VPlanUtils.h | 3 +- llvm/lib/Transforms/Vectorize/VPlanValue.h | 4 +- .../Transforms/Vectorize/VPlanVerifier.cpp | 32 +- .../Transforms/Vectorize/VectorCombine.cpp | 234 +- llvm/lib/XRay/FDRTraceWriter.cpp | 6 +- llvm/runtimes/CMakeLists.txt | 7 + llvm/test/Analysis/BasicAA/cs-cs-arm.ll | 2 +- llvm/test/Analysis/BasicAA/intrinsics-arm.ll | 2 +- llvm/test/Analysis/CostModel/AArch64/ldexp.ll | 98 + llvm/test/Analysis/CostModel/AArch64/lrint.ll | 254 + .../segmented-shufflevector-patterns.ll | 101 + .../CostModel/AArch64/shuffle-other.ll | 10 +- .../Analysis/CostModel/AArch64/sve-ldexp.ll | 58 + .../Analysis/CostModel/AArch64/sve-lrint.ll | 218 + llvm/test/Analysis/CostModel/AMDGPU/ldexp.ll | 100 +- llvm/test/Analysis/CostModel/AMDGPU/load.ll | 66 +- .../CostModel/AMDGPU/shufflevector.ll | 448 +- llvm/test/Analysis/CostModel/AMDGPU/store.ll | 66 +- llvm/test/Analysis/CostModel/ARM/shuffle.ll | 4 +- llvm/test/Analysis/CostModel/RISCV/exp.ll | 109 + llvm/test/Analysis/CostModel/RISCV/fround.ll | 194 + .../CostModel/RISCV/shuffle-exact-vlen.ll | 24 +- .../RISCV/shuffle-insert_subvector.ll | 120 +- .../CostModel/RISCV/shuffle-select.ll | 8 +- .../CostModel/X86/alternate-shuffle-cost.ll | 65 +- .../CostModel/X86/shuffle-insert_subvector.ll | 164 +- .../Analysis/CostModel/X86/shuffle-select.ll | 113 +- .../HashRecognize/cyclic-redundancy-check.ll | 240 +- .../IR2Vec/Inputs/dummy_2D_vocab.json | 11 + .../IR2Vec/Inputs/dummy_3D_vocab.json | 18 +- .../IR2Vec/Inputs/dummy_5D_vocab.json | 24 +- .../IR2Vec/Inputs/incorrect_vocab1.json | 11 + .../IR2Vec/Inputs/incorrect_vocab2.json | 12 + .../IR2Vec/Inputs/incorrect_vocab3.json | 12 + .../IR2Vec/Inputs/incorrect_vocab4.json | 16 + llvm/test/Analysis/IR2Vec/basic.ll | 14 +- llvm/test/Analysis/IR2Vec/dbg-inst.ll | 13 + llvm/test/Analysis/IR2Vec/unreachable.ll | 42 + llvm/test/Analysis/IR2Vec/vocab-test.ll | 20 + .../dependences-i128-inductions.ll | 151 + .../early-exit-runtime-checks.ll | 120 + ...untime-checks-after-dependence-analysis.ll | 34 +- .../UniformityAnalysis/AMDGPU/intrinsics.ll | 72 + .../aarch64-intrinsics-attributes.ll | 10 + llvm/test/Bitcode/attributes.ll | 5 + llvm/test/Bitcode/debug-loc-again.ll | 4 +- .../Bitcode/function-encoding-rel-operands.ll | 2 +- .../AArch64/GlobalISel/inline-memcpy.mir | 2 +- .../AArch64/GlobalISel/inline-memmove.mir | 2 +- .../AArch64/GlobalISel/inline-memset.mir | 2 +- ...legalizer-combiner-use-vector-truncate.mir | 52 + .../AArch64/PHIElimination-reuse-copy.mir | 197 + .../AArch64/aarch64-bitwisenot-fold.ll | 48 + llvm/test/CodeGen/AArch64/abd-combine.ll | 53 +- .../CodeGen/AArch64/arm64-bitfield-extract.ll | 40 +- .../CodeGen/AArch64/arm64-fp-contract-zero.ll | 10 +- .../AArch64/arm64-indexed-vector-ldst.ll | 115 + .../AArch64/arm64-zero-cycle-regmov-fpr.ll | 103 + .../AArch64/arm64-zero-cycle-regmov-gpr.ll | 54 + .../AArch64/arm64-zero-cycle-regmov-gpr32.ll | 45 - llvm/test/CodeGen/AArch64/arm64-zip.ll | 2 +- llvm/test/CodeGen/AArch64/arm64ec-builtins.ll | 9 +- llvm/test/CodeGen/AArch64/bf16_fast_math.ll | 36 +- llvm/test/CodeGen/AArch64/cmp-select-sign.ll | 6 +- llvm/test/CodeGen/AArch64/concatbinop.ll | 2 +- llvm/test/CodeGen/AArch64/cpa-selectiondag.ll | 107 +- llvm/test/CodeGen/AArch64/double_reduct.ll | 149 +- .../CodeGen/AArch64/exp10-libcall-names.ll | 16 +- .../test/CodeGen/AArch64/fp8-sve-cvt-cvtlt.ll | 1 + llvm/test/CodeGen/AArch64/fp8-sve-cvtn.ll | 1 + llvm/test/CodeGen/AArch64/itofp.ll | 1506 ++-- llvm/test/CodeGen/AArch64/llvm.frexp.ll | 1345 ++++ .../AArch64/lr-reserved-for-ra-live-in.ll | 2 +- llvm/test/CodeGen/AArch64/machine-combiner.ll | 8 +- .../CodeGen/AArch64/machine-outliner-loh.ll | 74 + .../CodeGen/AArch64/machine-outliner-loh.mir | 50 + llvm/test/CodeGen/AArch64/memcpy-scoped-aa.ll | 2 + llvm/test/CodeGen/AArch64/memsize-remarks.ll | 4 +- .../CodeGen/AArch64/merge-scoped-aa-store.ll | 29 +- .../neon-partial-reduce-dot-product.ll | 1 - .../no-promote-scalabale-const-to-global.ll | 20 + llvm/test/CodeGen/AArch64/popcount.ll | 302 +- llvm/test/CodeGen/AArch64/pr58431.ll | 8 +- llvm/test/CodeGen/AArch64/ptradd.ll | 82 +- .../AArch64/ptrauth-arm64-tls-dynamics.ll | 2 +- llvm/test/CodeGen/AArch64/rem-by-const.ll | 3616 +++++++++ llvm/test/CodeGen/AArch64/sat-add.ll | 8 +- llvm/test/CodeGen/AArch64/select_cc.ll | 2 +- .../CodeGen/AArch64/selectcc-to-shiftand.ll | 3 - .../AArch64/sme-must-save-lr-for-vg.ll | 49 + .../CodeGen/AArch64/sme2-intrinsics-fclamp.ll | 85 + .../CodeGen/AArch64/sme2-intrinsics-qcvtn.ll | 40 +- .../CodeGen/AArch64/sme2-intrinsics-sclamp.ll | 110 + .../CodeGen/AArch64/sme2-intrinsics-uclamp.ll | 110 + .../CodeGen/AArch64/stp-opt-with-renaming.mir | 29 + .../CodeGen/AArch64/streaming-func-no-sme.ll | 7 + llvm/test/CodeGen/AArch64/sve-abd.ll | 3 +- .../AArch64/sve-fixed-length-bit-counting.ll | 48 +- .../CodeGen/AArch64/sve-indexed-arithmetic.ll | 366 + .../CodeGen/AArch64/sve-intrinsics-fexpa.ll | 4 +- .../test/CodeGen/AArch64/sve-merging-unary.ll | 1748 +++++ llvm/test/CodeGen/AArch64/sve-vscale.ll | 37 +- ...ve2-intrinsics-binary-narrowing-add-sub.ll | 1 + .../sve2-intrinsics-binary-narrowing-shr.ll | 1 + .../sve2-intrinsics-bit-permutation.ll | 5 +- .../AArch64/sve2-intrinsics-complex-dot.ll | 1 + ...ntrinsics-contiguous-conflict-detection.ll | 1 + .../CodeGen/AArch64/sve2-intrinsics-crypto.ll | 52 +- .../AArch64/sve2-intrinsics-faminmax.ll | 1 + .../AArch64/sve2-intrinsics-fp-converts.ll | 1 + ...sve2-intrinsics-fp-int-binary-logarithm.ll | 1 + .../sve2-intrinsics-fp-widening-mul-acc.ll | 1 + .../AArch64/sve2-intrinsics-int-mul-lane.ll | 1 + .../CodeGen/AArch64/sve2-intrinsics-luti.ll | 4 +- ...-intrinsics-non-widening-pairwise-arith.ll | 1 + .../sve2-intrinsics-polynomial-arithmetic.ll | 1 + .../CodeGen/AArch64/sve2-intrinsics-psel.ll | 2 + .../CodeGen/AArch64/sve2-intrinsics-rax1.ll | 20 + .../CodeGen/AArch64/sve2-intrinsics-revd.ll | 2 + .../CodeGen/AArch64/sve2-intrinsics-sm4.ll | 33 + .../sve2-intrinsics-unary-narrowing.ll | 1 + .../sve2-intrinsics-uniform-complex-arith.ll | 1 + .../AArch64/sve2-intrinsics-while-reversed.ll | 1 + .../CodeGen/AArch64/sve2-intrinsics-while.ll | 1 + ...2-intrinsics-widening-complex-int-arith.ll | 1 + .../AArch64/sve2-intrinsics-widening-dsp.ll | 1 + ...sve2-intrinsics-widening-pairwise-arith.ll | 1 + .../AArch64/sve2p1-intrinsics-bfmlsl.ll | 5 +- .../CodeGen/AArch64/sve2p1-intrinsics-cntp.ll | 1 + .../CodeGen/AArch64/sve2p1-intrinsics-dots.ll | 2 + .../CodeGen/AArch64/sve2p1-intrinsics-dupq.ll | 5 +- .../CodeGen/AArch64/sve2p1-intrinsics-extq.ll | 5 +- .../AArch64/sve2p1-intrinsics-fclamp.ll | 96 +- .../AArch64/sve2p1-intrinsics-fp-reduce.ll | 2 + .../AArch64/sve2p1-intrinsics-int-reduce.ll | 2 + .../AArch64/sve2p1-intrinsics-loads.ll | 5 +- .../sve2p1-intrinsics-multivec-loads.ll | 5 +- .../sve2p1-intrinsics-multivec-stores.ll | 5 +- .../AArch64/sve2p1-intrinsics-pmov-to-pred.ll | 3 + .../sve2p1-intrinsics-pmov-to-vector.ll | 3 + .../sve2p1-intrinsics-predicate-as-counter.ll | 1 + .../AArch64/sve2p1-intrinsics-qcvtn.ll | 57 + .../AArch64/sve2p1-intrinsics-qrshr.ll | 3 + .../AArch64/sve2p1-intrinsics-sclamp.ll | 122 +- .../AArch64/sve2p1-intrinsics-stores.ll | 5 +- .../AArch64/sve2p1-intrinsics-uclamp.ll | 122 +- .../AArch64/sve2p1-intrinsics-while-pn.ll | 2 +- .../AArch64/sve2p1-intrinsics-while-pp.ll | 3 + .../CodeGen/AArch64/sve2p1-vector-shuffles.ll | 63 +- .../test/CodeGen/AArch64/sve2p2-intrinsics.ll | 45 + .../AArch64/switch-cases-to-branch-and.ll | 3 +- llvm/test/CodeGen/AArch64/tbl-loops.ll | 12 +- .../AArch64/vecreduce-propagate-sd-flags.ll | 2 +- .../test/CodeGen/AArch64/vselect-constants.ll | 4 +- llvm/test/CodeGen/AArch64/vselect-ext.ll | 140 +- .../CodeGen/AArch64/zeroing-forms-abs-neg.ll | 2 + .../AArch64/zeroing-forms-counts-not.ll | 2 + .../test/CodeGen/AArch64/zeroing-forms-ext.ll | 2 + .../AArch64/zeroing-forms-fcvt-bfcvt.ll | 2 + .../AArch64/zeroing-forms-fcvtlt-fcvtx.ll | 2 + .../CodeGen/AArch64/zeroing-forms-fcvtzsu.ll | 2 + .../CodeGen/AArch64/zeroing-forms-flogb.ll | 2 + .../zeroing-forms-frint-frecpx-fsqrt.ll | 2 + .../test/CodeGen/AArch64/zeroing-forms-rev.ll | 2 + ...eroing-forms-urecpe-ursqrte-sqabs-sqneg.ll | 6 +- .../CodeGen/AArch64/zeroing-forms-uscvtf.ll | 2 + .../AMDGPU/GlobalISel/atomicrmw_uinc_wrap.ll | 2 + .../AMDGPU/GlobalISel/global-value.illegal.ll | 2 +- .../GlobalISel/inst-select-ashr.s16.mir | 10 +- .../GlobalISel/inst-select-lshr.s16.mir | 10 +- .../inst-select-pattern-smed3.s16.mir | 42 +- .../inst-select-pattern-umed3.s16.mir | 42 +- .../AMDGPU/GlobalISel/inst-select-shl.s16.mir | 50 +- ...-select-stacksave-stackrestore.invalid.mir | 2 +- .../GlobalISel/legalize-atomicrmw-nand.mir | 2 +- .../legalize-atomicrmw-xchg-flat.mir | 2 +- .../AMDGPU/GlobalISel/legalize-jump-table.mir | 2 +- .../llvm.amdgcn.image.gather4.o.dim.ll | 2 +- .../GlobalISel/llvm.amdgcn.intersect_ray.ll | 2 +- ....amdgcn.raw.buffer.atomic.fadd-with-ret.ll | 2 +- ...gcn.raw.ptr.buffer.atomic.fadd-with-ret.ll | 2 +- ...dgcn.struct.buffer.atomic.fadd-with-ret.ll | 2 +- ....struct.ptr.buffer.atomic.fadd-with-ret.ll | 2 +- llvm/test/CodeGen/AMDGPU/GlobalISel/mul.ll | 18 +- .../GlobalISel/regbankselect-illegal-copy.mir | 4 +- .../AMDGPU/GlobalISel/unsupported-load.ll | 2 +- .../AMDGPU/GlobalISel/unsupported-ptr-add.ll | 2 +- .../CodeGen/AMDGPU/GlobalISel/urem.i32.ll | 104 +- .../CodeGen/AMDGPU/GlobalISel/urem.i64.ll | 595 +- llvm/test/CodeGen/AMDGPU/add_i1.ll | 225 +- llvm/test/CodeGen/AMDGPU/add_i128.ll | 99 +- .../AMDGPU/alloc-aligned-tuples-gfx1250.mir | 148 + .../amdgpu-expand-feature-predicates.ll | 169 +- .../CodeGen/AMDGPU/amdgpu-snop-padding.mir | 132 + llvm/test/CodeGen/AMDGPU/ashr64_reduce.ll | 180 +- .../AMDGPU/atomic_optimizations_buffer.ll | 13 + .../atomic_optimizations_global_pointer.ll | 18 +- .../atomic_optimizations_local_pointer.ll | 3 + .../AMDGPU/atomic_optimizations_raw_buffer.ll | 11 + .../atomic_optimizations_struct_buffer.ll | 11 + llvm/test/CodeGen/AMDGPU/bf16-conversions.ll | 4 +- .../buffer-fat-pointer-atomicrmw-fadd.ll | 13 + .../buffer-fat-pointer-atomicrmw-fmax.ll | 18 + .../buffer-fat-pointer-atomicrmw-fmin.ll | 18 + llvm/test/CodeGen/AMDGPU/cmp_shrink.mir | 13 + .../CodeGen/AMDGPU/combine-add-zext-xor.ll | 20 +- .../CodeGen/AMDGPU/combine-and-sext-bool.ll | 132 +- .../CodeGen/AMDGPU/convergence-laneops.ll | 2 +- llvm/test/CodeGen/AMDGPU/div_i128.ll | 64 +- .../CodeGen/AMDGPU/divergence-driven-ctpop.ll | 2 +- .../test/CodeGen/AMDGPU/dynamic_stackalloc.ll | 2 - .../CodeGen/AMDGPU/extract-subvector-16bit.ll | 5 - llvm/test/CodeGen/AMDGPU/extract-subvector.ll | 10 - llvm/test/CodeGen/AMDGPU/fdot2.ll | 237 +- .../AMDGPU/fix-sgpr-copies-f16-true16.mir | 26 + .../CodeGen/AMDGPU/flat-atomicrmw-fadd.ll | 36 +- .../CodeGen/AMDGPU/flat-atomicrmw-fmax.ll | 58 +- .../CodeGen/AMDGPU/flat-atomicrmw-fmin.ll | 58 +- .../CodeGen/AMDGPU/flat-atomicrmw-fsub.ll | 40 +- llvm/test/CodeGen/AMDGPU/fma-combine.ll | 342 +- llvm/test/CodeGen/AMDGPU/fmax3-maximumnum.ll | 18 +- llvm/test/CodeGen/AMDGPU/fmin3-minimumnum.ll | 18 +- .../AMDGPU/fmul-2-combine-multi-use.ll | 10 +- llvm/test/CodeGen/AMDGPU/fneg-combines.f16.ll | 6 +- llvm/test/CodeGen/AMDGPU/fneg-combines.new.ll | 95 +- .../fneg-fabs-divergence-driven-isel.ll | 6 +- llvm/test/CodeGen/AMDGPU/fneg.ll | 4 +- llvm/test/CodeGen/AMDGPU/fold-gep-offset.ll | 1 + .../AMDGPU/fp-min-max-image-atomics.ll | 2 +- llvm/test/CodeGen/AMDGPU/fract-match.ll | 13 +- .../CodeGen/AMDGPU/global-atomicrmw-fadd.ll | 128 +- .../CodeGen/AMDGPU/global-atomicrmw-fmax.ll | 58 +- .../CodeGen/AMDGPU/global-atomicrmw-fmin.ll | 58 +- .../CodeGen/AMDGPU/global-atomicrmw-fsub.ll | 40 +- llvm/test/CodeGen/AMDGPU/global-load-xcnt.ll | 605 ++ .../AMDGPU/global_atomics_scan_fadd.ll | 5090 +++++-------- .../AMDGPU/global_atomics_scan_fmax.ll | 4988 ++++--------- .../AMDGPU/global_atomics_scan_fmin.ll | 4988 ++++--------- .../AMDGPU/global_atomics_scan_fsub.ll | 5104 +++++-------- llvm/test/CodeGen/AMDGPU/icmp.i16.ll | 1640 ++++- .../CodeGen/AMDGPU/indirect-addressing-si.ll | 7 +- ...class-vgpr-mfma-to-agpr-negative-tests.mir | 313 + ...class-vgpr-mfma-to-av-with-load-source.mir | 358 + .../inflate-reg-class-vgpr-mfma-to-av.mir | 190 + .../insert_waitcnt_for_precise_memory.ll | 1 + .../CodeGen/AMDGPU/integer-mad-patterns.ll | 33 +- llvm/test/CodeGen/AMDGPU/llc-pipeline.ll | 4 + .../AMDGPU/llvm.amdgcn.buffer.load.lds.err.ll | 8 +- .../CodeGen/AMDGPU/llvm.amdgcn.cvt.f16.fp8.ll | 278 + .../AMDGPU/llvm.amdgcn.cvt.f32.fp8.err.ll | 18 +- ...dgcn.ds.atomic.async.barrier.arrive.b64.ll | 21 + ...amdgcn.ds.atomic.barrier.arrive.rtn.b64.ll | 27 + .../llvm.amdgcn.ds.gws.sema.release.all.ll | 2 +- .../llvm.amdgcn.ds.ordered.add-unsupported.ll | 22 + .../AMDGPU/llvm.amdgcn.dual_intersect_ray.ll | 2 +- .../AMDGPU/llvm.amdgcn.global.load.lds.err.ll | 4 +- .../llvm.amdgcn.global.load.lds.gfx950.ll | 2 +- ...llvm.amdgcn.iglp.AFLCustomIRMutator.opt.ll | 10 +- .../AMDGPU/llvm.amdgcn.image.dim.gfx90a.ll | 228 +- .../AMDGPU/llvm.amdgcn.init.whole.wave-w32.ll | 12 +- .../AMDGPU/llvm.amdgcn.init.whole.wave-w64.ll | 3 +- .../AMDGPU/llvm.amdgcn.inverse.ballot.i32.ll | 2 +- .../AMDGPU/llvm.amdgcn.load.to.lds.gfx950.ll | 2 +- .../AMDGPU/llvm.amdgcn.load.tr.gfx1250.w32.ll | 322 + .../CodeGen/AMDGPU/llvm.amdgcn.mfma.gfx90a.ll | 41 +- .../CodeGen/AMDGPU/llvm.amdgcn.permlane.ll | 80 +- .../AMDGPU/llvm.amdgcn.permlane.ptr.ll | 16 + .../AMDGPU/llvm.amdgcn.permlane16.swap.ll | 2 +- .../AMDGPU/llvm.amdgcn.permlane32.swap.ll | 2 +- ...mdgcn.ptr.buffer.atomic.fadd_rtn_errors.ll | 8 +- ...mdgcn.raw.ptr.buffer.atomic.fadd.v2bf16.ll | 1 + ...m.amdgcn.raw.ptr.buffer.load.lds.gfx950.ll | 2 +- .../AMDGPU/llvm.amdgcn.s.monitor.sleep.ll | 20 + ....amdgcn.struct.buffer.load.format.v3f16.ll | 2 + ...cn.struct.ptr.buffer.atomic.fadd.v2bf16.ll | 2 + ...gcn.struct.ptr.buffer.atomic.fadd_nortn.ll | 2 + ...mdgcn.struct.ptr.buffer.atomic.fadd_rtn.ll | 2 + ...mdgcn.struct.ptr.buffer.atomic.fmax.f32.ll | 2 + ...mdgcn.struct.ptr.buffer.atomic.fmin.f32.ll | 2 + ...mdgcn.struct.ptr.buffer.load.lds.gfx950.ll | 2 +- .../AMDGPU/llvm.amdgcn.tensor.load.store.ll | 245 + .../CodeGen/AMDGPU/llvm.amdgcn.wave.id.ll | 2 +- .../CodeGen/AMDGPU/llvm.amdgcn.writelane.ll | 14 + .../AMDGPU/llvm.amdgcn.writelane.ptr.ll | 11 + .../CodeGen/AMDGPU/llvm.fptrunc.round.err.ll | 6 +- llvm/test/CodeGen/AMDGPU/llvm.mulo.ll | 13 +- .../CodeGen/AMDGPU/local-atomicrmw-fadd.ll | 4 +- .../CodeGen/AMDGPU/local-atomicrmw-fmax.ll | 2 + .../CodeGen/AMDGPU/local-atomicrmw-fmin.ll | 2 + .../CodeGen/AMDGPU/local-atomicrmw-fsub.ll | 2 + .../local-stack-alloc-block-sp-reference.ll | 2 - ...ine-scheduler-sink-trivial-remats-attr.mir | 554 +- .../machine-scheduler-sink-trivial-remats.mir | 366 +- llvm/test/CodeGen/AMDGPU/mad-combine.ll | 191 +- llvm/test/CodeGen/AMDGPU/mad_64_32.ll | 8 +- llvm/test/CodeGen/AMDGPU/maximumnum.bf16.ll | 18 +- .../AMDGPU/memory-legalizer-global-agent.ll | 26 - .../AMDGPU/memory-legalizer-global-system.ll | 26 - llvm/test/CodeGen/AMDGPU/minimumnum.bf16.ll | 18 +- llvm/test/CodeGen/AMDGPU/noclobber-barrier.ll | 425 +- llvm/test/CodeGen/AMDGPU/packed-op-sel.ll | 1 - .../CodeGen/AMDGPU/prevent-fmul-hoist-ir.ll | 108 +- .../AMDGPU/promote-constOffset-to-imm.ll | 33 +- .../AMDGPU/ptradd-sdag-optimizations.ll | 374 +- .../AMDGPU/ptradd-sdag-undef-poison.ll | 49 + llvm/test/CodeGen/AMDGPU/ptradd-sdag.ll | 6 +- llvm/test/CodeGen/AMDGPU/rem_i128.ll | 64 +- .../AMDGPU/rewrite-vgpr-mfma-to-agpr.ll | 195 + llvm/test/CodeGen/AMDGPU/rsq.f32-safe.ll | 1956 +++++ llvm/test/CodeGen/AMDGPU/rsq.f32.ll | 2194 +----- .../AMDGPU/select-flags-to-fmin-fmax.ll | 6 + .../CodeGen/AMDGPU/sgpr-regalloc-flags.ll | 4 + .../AMDGPU/shufflevector.v3bf16.v2bf16.ll | 16 +- .../AMDGPU/shufflevector.v3bf16.v3bf16.ll | 15 +- .../AMDGPU/shufflevector.v3f16.v2f16.ll | 16 +- .../AMDGPU/shufflevector.v3f16.v3f16.ll | 15 +- .../AMDGPU/si-fold-operands-subreg-imm.mir | 4 +- .../test/CodeGen/AMDGPU/srl64_reduce_flags.ll | 41 + .../AMDGPU/stacksave_stackrestore.invalid.ll | 4 +- .../CodeGen/AMDGPU/store-to-constant-error.ll | 4 +- llvm/test/CodeGen/AMDGPU/sub_i1.ll | 226 +- .../AMDGPU/undef-handling-crash-in-ra.ll | 193 + .../CodeGen/AMDGPU/unsupported-cs-chain.ll | 2 +- .../CodeGen/AMDGPU/unsupported-image-a16.ll | 2 +- .../CodeGen/AMDGPU/unsupported-image-g16.ll | 4 +- .../AMDGPU/unsupported-image-sample.ll | 19 +- llvm/test/CodeGen/AMDGPU/valu-i1.ll | 355 +- .../CodeGen/AMDGPU/vcmp-saveexec-to-vcmpx.ll | 215 +- llvm/test/CodeGen/AMDGPU/vector-reduce-add.ll | 7 + .../test/CodeGen/AMDGPU/vector-reduce-smax.ll | 23 +- .../test/CodeGen/AMDGPU/vector-reduce-smin.ll | 23 +- .../test/CodeGen/AMDGPU/vector-reduce-umax.ll | 23 +- .../test/CodeGen/AMDGPU/vector-reduce-umin.ll | 23 +- .../test/CodeGen/AMDGPU/vni8-across-blocks.ll | 2499 ++----- llvm/test/CodeGen/AMDGPU/vni8-live-reg-opt.ll | 279 - llvm/test/CodeGen/AMDGPU/wait-xcnt.mir | 968 +++ llvm/test/CodeGen/AMDGPU/waitcnt-trailing.mir | 20 + .../CodeGen/AMDGPU/widen-vselect-and-mask.ll | 64 +- llvm/test/CodeGen/ARM/Windows/frexp.ll | 28 + llvm/test/CodeGen/ARM/cmp-select-sign.ll | 171 + llvm/test/CodeGen/ARM/fp16_fast_math.ll | 20 +- llvm/test/CodeGen/ARM/fpclamptosat.ll | 357 +- llvm/test/CodeGen/ARM/fpclamptosat_vec.ll | 14 +- .../CodeGen/ARM/frexp-soften-libcall-error.ll | 8 + llvm/test/CodeGen/ARM/iabs.ll | 25 + .../ARM/ifcvt_unanalyzable_fallthrough.mir | 114 + llvm/test/CodeGen/ARM/ldexp.ll | 12 +- llvm/test/CodeGen/ARM/llvm.frexp.ll | 37 + .../CodeGen/ARM/minnum-maxnum-intrinsics.ll | 2 +- .../CodeGen/ARM/powi-soften-libcall-error.ll | 8 + llvm/test/CodeGen/ARM/special-reg.ll | 12 +- llvm/test/CodeGen/ARM/usat-with-shift.ll | 64 +- llvm/test/CodeGen/ARM/usat.ll | 122 +- llvm/test/CodeGen/ARM/vrint.ll | 336 +- llvm/test/CodeGen/ARM/vrintn.ll | 29 +- llvm/test/CodeGen/DirectX/BufferLoadDouble.ll | 2 +- llvm/test/CodeGen/DirectX/BufferLoadInt64.ll | 48 + llvm/test/CodeGen/DirectX/BufferStoreInt64.ll | 38 + .../CodeGen/DirectX/CBufferAccess/memcpy.ll | 216 + ...gnature-StaticSamplers-Invalid-AddressU.ll | 19 + ...gnature-StaticSamplers-Invalid-AddressV.ll | 19 + ...gnature-StaticSamplers-Invalid-AddressW.ll | 19 + ...ture-StaticSamplers-Invalid-BorderColor.ll | 19 + ...e-StaticSamplers-Invalid-ComparisonFunc.ll | 19 + ...Signature-StaticSamplers-Invalid-Filter.ll | 19 + ...re-StaticSamplers-Invalid-MaxAnisotropy.ll | 19 + ...Signature-StaticSamplers-Invalid-MaxLod.ll | 19 + ...Signature-StaticSamplers-Invalid-MinLod.ll | 19 + ...ature-StaticSamplers-Invalid-MinLopBias.ll | 19 + ...re-StaticSamplers-Invalid-RegisterSpace.ll | 19 + ...e-StaticSamplers-Invalid-ShaderRegister.ll | 19 + ...StaticSamplers-Invalid-ShaderVisibility.ll | 19 + .../RootSignature-StaticSamplers.ll | 42 + llvm/test/CodeGen/DirectX/firstbithigh.ll | 92 +- llvm/test/CodeGen/DirectX/firstbitlow.ll | 18 +- .../DirectX/issue-145408-gep-struct-fix.ll | 17 + llvm/test/CodeGen/DirectX/llc-pipeline.ll | 2 +- llvm/test/CodeGen/DirectX/scalarize-alloca.ll | 19 +- .../CodeGen/DirectX/strip-rootsignatures.ll | 18 + .../MIRDebugify/locations-and-values.mir | 2 +- .../autohvx/build-vector-float-type.ll | 619 +- llvm/test/CodeGen/Hexagon/hexagon-strcpy.ll | 57 + .../test/CodeGen/Hexagon/vect/vect-vshifts.ll | 197 +- .../CodeGen/LoongArch/calling-conv-ilp32d.ll | 193 + .../LoongArch/inline-asm-constraint-f.ll | 14 +- .../ir-instruction/double-convert.ll | 14 +- .../ir-instruction/load-store-atomic.ll | 40 +- .../ir-instruction/bitcast-extract-element.ll | 28 + .../lasx/ir-instruction/fix-xvshuf.ll | 30 + .../ir-instruction/insert-bitcast-element.ll | 28 + .../ir-instruction/insert-extract-element.ll | 98 + .../insert-extract-pair-elements.ll | 132 + llvm/test/CodeGen/LoongArch/lasx/xvmskcond.ll | 3 +- .../ir-instruction/bitcast-extract-element.ll | 26 + .../ir-instruction/insert-bitcast-element.ll | 28 + .../ir-instruction/insert-extract-element.ll | 76 + llvm/test/CodeGen/LoongArch/lsx/vselect.ll | 4 +- .../floating-point-immediate-operands.mir | 4 +- .../MSP430/powi-soften-libcall-error.ll | 16 + llvm/test/CodeGen/Mips/llvm-ir/load.ll | 432 +- llvm/test/CodeGen/Mips/llvm-ir/store.ll | 252 +- llvm/test/CodeGen/Mips/msa/compare_float.ll | 595 +- llvm/test/CodeGen/Mips/setcc-se.ll | 463 +- llvm/test/CodeGen/NVPTX/access-non-generic.ll | 3 +- llvm/test/CodeGen/NVPTX/alias.ll | 3 +- llvm/test/CodeGen/NVPTX/and-or-setcc.ll | 4 +- llvm/test/CodeGen/NVPTX/atomics.ll | 5 +- llvm/test/CodeGen/NVPTX/bf16-instructions.ll | 671 +- .../NVPTX/bf16x2-instructions-approx.ll | 34 +- .../test/CodeGen/NVPTX/bf16x2-instructions.ll | 417 +- llvm/test/CodeGen/NVPTX/byval-const-global.ll | 6 +- .../CodeGen/NVPTX/call-with-alloca-buffer.ll | 3 +- llvm/test/CodeGen/NVPTX/chain-different-as.ll | 9 +- llvm/test/CodeGen/NVPTX/cmpxchg-sm60.ll | 1080 +-- llvm/test/CodeGen/NVPTX/cmpxchg-sm70.ll | 1080 +-- llvm/test/CodeGen/NVPTX/cmpxchg-sm90.ll | 1080 +-- llvm/test/CodeGen/NVPTX/cmpxchg.ll | 240 +- llvm/test/CodeGen/NVPTX/combine-mad.ll | 7 +- .../CodeGen/NVPTX/compute-ptx-value-vts.ll | 35 +- .../test/CodeGen/NVPTX/convergent-mir-call.ll | 10 +- .../CodeGen/NVPTX/convert-call-to-indirect.ll | 43 +- llvm/test/CodeGen/NVPTX/convert-fp-i8.ll | 10 +- llvm/test/CodeGen/NVPTX/convert-int-sm20.ll | 73 +- llvm/test/CodeGen/NVPTX/demote-vars.ll | 3 +- llvm/test/CodeGen/NVPTX/dynamic_stackalloc.ll | 12 +- llvm/test/CodeGen/NVPTX/elect.ll | 2 +- llvm/test/CodeGen/NVPTX/extractelement.ll | 23 +- llvm/test/CodeGen/NVPTX/f16-instructions.ll | 55 +- llvm/test/CodeGen/NVPTX/f16x2-instructions.ll | 150 +- llvm/test/CodeGen/NVPTX/fexp2.ll | 125 +- llvm/test/CodeGen/NVPTX/flog2.ll | 80 +- llvm/test/CodeGen/NVPTX/fma-relu-contract.ll | 568 +- .../CodeGen/NVPTX/fma-relu-fma-intrinsic.ll | 417 +- .../NVPTX/fma-relu-instruction-flag.ll | 851 ++- llvm/test/CodeGen/NVPTX/fma.ll | 19 +- llvm/test/CodeGen/NVPTX/forward-ld-param.ll | 12 +- llvm/test/CodeGen/NVPTX/fp128-storage-type.ll | 6 +- .../test/CodeGen/NVPTX/frameindex-lifetime.ll | 51 + llvm/test/CodeGen/NVPTX/frem.ll | 37 +- llvm/test/CodeGen/NVPTX/i1-icmp.ll | 80 +- llvm/test/CodeGen/NVPTX/i1-load-lower.ll | 5 +- llvm/test/CodeGen/NVPTX/i1-select.ll | 30 +- llvm/test/CodeGen/NVPTX/i128-ld-st.ll | 7 +- llvm/test/CodeGen/NVPTX/i128.ll | 587 +- llvm/test/CodeGen/NVPTX/i16x2-instructions.ll | 224 +- llvm/test/CodeGen/NVPTX/i8x2-instructions.ll | 18 +- llvm/test/CodeGen/NVPTX/i8x4-instructions.ll | 74 +- llvm/test/CodeGen/NVPTX/idioms.ll | 127 +- llvm/test/CodeGen/NVPTX/indirect_byval.ll | 16 +- llvm/test/CodeGen/NVPTX/jump-table.ll | 37 +- llvm/test/CodeGen/NVPTX/ldg-invariant-256.ll | 10 +- llvm/test/CodeGen/NVPTX/ldg-invariant.ll | 23 +- llvm/test/CodeGen/NVPTX/ldparam-v4.ll | 5 +- llvm/test/CodeGen/NVPTX/ldu-i8.ll | 17 +- llvm/test/CodeGen/NVPTX/ldu-ldg.ll | 5 +- llvm/test/CodeGen/NVPTX/load-store-vectors.ll | 56 +- .../NVPTX/load-with-non-coherent-cache.ll | 654 +- llvm/test/CodeGen/NVPTX/local-stack-frame.ll | 49 +- llvm/test/CodeGen/NVPTX/lower-alloca.ll | 4 +- .../CodeGen/NVPTX/lower-args-gridconstant.ll | 44 +- llvm/test/CodeGen/NVPTX/lower-args.ll | 18 +- llvm/test/CodeGen/NVPTX/lower-byval-args.ll | 34 +- llvm/test/CodeGen/NVPTX/math-intrins.ll | 356 +- llvm/test/CodeGen/NVPTX/misched_func_call.ll | 18 +- llvm/test/CodeGen/NVPTX/mulwide.ll | 294 +- .../NVPTX/naked-fn-with-frame-pointer.ll | 20 +- .../CodeGen/NVPTX/nvvm-reflect-arch-O0.ll | 98 +- llvm/test/CodeGen/NVPTX/param-add.ll | 37 +- llvm/test/CodeGen/NVPTX/param-align.ll | 22 +- llvm/test/CodeGen/NVPTX/param-load-store.ll | 200 +- llvm/test/CodeGen/NVPTX/param-overalign.ll | 89 +- .../CodeGen/NVPTX/param-vectorize-device.ll | 110 +- llvm/test/CodeGen/NVPTX/pow2_mask_cmp.ll | 15 +- llvm/test/CodeGen/NVPTX/pr13291-i1-store.ll | 6 +- .../CodeGen/NVPTX/proxy-reg-erasure-ptx.ll | 16 +- llvm/test/CodeGen/NVPTX/proxy-reg-erasure.mir | 8 +- .../CodeGen/NVPTX/reduction-intrinsics.ll | 288 +- llvm/test/CodeGen/NVPTX/reg-types.ll | 89 +- llvm/test/CodeGen/NVPTX/sext-setcc.ll | 7 +- llvm/test/CodeGen/NVPTX/shift-opt.ll | 34 +- llvm/test/CodeGen/NVPTX/sqrt-approx.ll | 16 +- llvm/test/CodeGen/NVPTX/st-param-imm.ll | 564 +- llvm/test/CodeGen/NVPTX/store-undef.ll | 12 +- llvm/test/CodeGen/NVPTX/tex-read-cuda.ll | 6 +- llvm/test/CodeGen/NVPTX/tid-range.ll | 17 +- .../NVPTX/unaligned-param-load-store.ll | 797 +- ...unfold-masked-merge-vector-variablemask.ll | 74 +- llvm/test/CodeGen/NVPTX/unreachable.ll | 20 +- llvm/test/CodeGen/NVPTX/variadics-backend.ll | 114 +- llvm/test/CodeGen/NVPTX/vector-loads.ll | 315 +- llvm/test/CodeGen/NVPTX/vector-returns.ll | 320 +- .../GlobalISel/fconstant-unsupported.ll | 2 +- .../CodeGen/PowerPC/PR35812-neg-cmpxchg.ll | 2 - .../aix32-vector-vararg-caller-split.ll | 8 +- llvm/test/CodeGen/PowerPC/all-atomics.ll | 32 +- llvm/test/CodeGen/PowerPC/anyext_srl.ll | 11 +- .../CodeGen/PowerPC/atomics-regression.ll | 68 - .../CodeGen/PowerPC/builtins-bcd-transform.ll | 91 + llvm/test/CodeGen/PowerPC/crreduce-reg.mir | 66 + llvm/test/CodeGen/PowerPC/fma-combine.ll | 41 +- llvm/test/CodeGen/PowerPC/fmf-propagation.ll | 4 +- llvm/test/CodeGen/PowerPC/fp-branch.ll | 15 +- llvm/test/CodeGen/PowerPC/licm-xxsplti.ll | 262 +- llvm/test/CodeGen/PowerPC/loop-comment.ll | 1 - llvm/test/CodeGen/PowerPC/memintr32.ll | 39 + llvm/test/CodeGen/PowerPC/memintr64.ll | 55 + llvm/test/CodeGen/PowerPC/mtvsrbmi.ll | 23 +- llvm/test/CodeGen/PowerPC/nofpexcept.ll | 36 +- llvm/test/CodeGen/PowerPC/ppc64-P9-vabsd.ll | 417 +- llvm/test/CodeGen/PowerPC/recipest.ll | 9 +- llvm/test/CodeGen/PowerPC/sat-add.ll | 21 +- .../PowerPC/vsx-fma-mutate-trivial-copy.ll | 4 +- .../CodeGen/PowerPC/xxeval-vselect-x-and.ll | 186 +- .../CodeGen/PowerPC/xxeval-vselect-x-b.ll | 145 +- .../CodeGen/PowerPC/xxeval-vselect-x-c.ll | 136 +- .../CodeGen/PowerPC/xxeval-vselect-x-or.ll | 246 + .../CodeGen/PowerPC/xxeval-vselect-x-xor.ll | 176 +- .../RISCV/GlobalISel/float-intrinsics.ll | 34 +- llvm/test/CodeGen/RISCV/attributes.ll | 11 +- llvm/test/CodeGen/RISCV/branch-opt.mir | 308 + llvm/test/CodeGen/RISCV/double-select-fcmp.ll | 45 + llvm/test/CodeGen/RISCV/features-info.ll | 5 +- llvm/test/CodeGen/RISCV/float-convert.ll | 8 +- llvm/test/CodeGen/RISCV/float-intrinsics.ll | 46 +- llvm/test/CodeGen/RISCV/float-select-fcmp.ll | 39 + llvm/test/CodeGen/RISCV/fpclamptosat.ll | 88 +- llvm/test/CodeGen/RISCV/half-select-fcmp.ll | 84 + llvm/test/CodeGen/RISCV/i32-icmp.ll | 54 + llvm/test/CodeGen/RISCV/i64-icmp.ll | 52 + .../RISCV/intrinsic-cttz-elts-vscale.ll | 36 +- .../test/CodeGen/RISCV/overflow-intrinsics.ll | 7 +- llvm/test/CodeGen/RISCV/pr145363.ll | 40 + llvm/test/CodeGen/RISCV/rv32xandesperf.ll | 164 + llvm/test/CodeGen/RISCV/rv64-float-convert.ll | 24 +- llvm/test/CodeGen/RISCV/rvv/abd.ll | 10 +- .../RISCV/rvv/combine-reduce-add-to-vcpop.ll | 67 +- llvm/test/CodeGen/RISCV/rvv/copyprop.mir | 2 +- .../rvv/fixed-vectors-deinterleave-load.ll | 67 - .../RISCV/rvv/fixed-vectors-fp-buildvec.ll | 36 +- .../RISCV/rvv/fixed-vectors-int-buildvec.ll | 396 +- .../rvv/fixed-vectors-interleave-store.ll | 34 - .../rvv/fixed-vectors-interleaved-access.ll | 14 +- .../CodeGen/RISCV/rvv/fixed-vectors-llrint.ll | 931 +-- .../RISCV/rvv/fixed-vectors-llround.ll | 1674 +++++ .../CodeGen/RISCV/rvv/fixed-vectors-lrint.ll | 781 +- .../CodeGen/RISCV/rvv/fixed-vectors-lround.ll | 1594 ++++ .../RISCV/rvv/fixed-vectors-mask-buildvec.ll | 80 +- .../RISCV/rvv/fixed-vectors-masked-gather.ll | 266 +- .../fixed-vectors-shuffle-deinterleave2.ll | 192 +- .../fixed-vectors-shuffle-int-interleave.ll | 55 +- .../RISCV/rvv/fixed-vectors-shuffle-int.ll | 23 +- ...t.ll => fixed-vectors-vp-reverse-float.ll} | 33 +- ...int.ll => fixed-vectors-vp-reverse-int.ll} | 0 .../RISCV/rvv/fixed-vectors-vp-splice.ll | 197 +- .../RISCV/rvv/fixed-vectors-vselect.ll | 24 +- llvm/test/CodeGen/RISCV/rvv/mgather-sdnode.ll | 216 + .../RISCV/rvv/rvv-peephole-vmerge-vops-mir.ll | 45 - llvm/test/CodeGen/RISCV/rvv/select-fp.ll | 4 +- llvm/test/CodeGen/RISCV/rvv/setcc-fp-vp.ll | 96 +- .../RISCV/rvv/vector-deinterleave-fixed.ll | 22 +- .../RISCV/rvv/vector-deinterleave-load.ll | 67 - .../RISCV/rvv/vector-interleave-store.ll | 34 - .../CodeGen/RISCV/rvv/vector-tuple-align.ll | 8 +- .../test/CodeGen/RISCV/rvv/vfma-vp-combine.ll | 6 +- llvm/test/CodeGen/RISCV/rvv/vl-opt-instrs.ll | 288 +- .../CodeGen/RISCV/rvv/vmerge-peephole.mir | 57 + llvm/test/CodeGen/RISCV/rvv/vmv-copy.mir | 8 +- .../CodeGen/RISCV/rvv/vp-reverse-float.ll | 177 +- .../RISCV/rvv/vp-splice-mask-fixed-vectors.ll | 40 +- llvm/test/CodeGen/RISCV/rvv/vp-splice.ll | 204 +- .../RISCV/rvv/vp-vector-interleaved-access.ll | 368 +- llvm/test/CodeGen/RISCV/rvv/vrgatherei16.ll | 209 +- llvm/test/CodeGen/RISCV/rvv/vsetvli-insert.ll | 35 +- .../test/CodeGen/RISCV/rvv/vsetvli-insert.mir | 42 + llvm/test/CodeGen/RISCV/rvv/vslidedown.ll | 344 +- llvm/test/CodeGen/RISCV/rvv/vslideup.ll | 344 +- llvm/test/CodeGen/RISCV/rvv/vwadd-sdnode.ll | 14 +- llvm/test/CodeGen/RISCV/select-cond.ll | 204 + .../CodeGen/RISCV/select-optimize-multiple.ll | 42 - .../CodeGen/RISCV/short-forward-branch-opt.ll | 1361 +++- .../RISCV/wide-scalar-shift-legalization.ll | 1901 +++-- llvm/test/CodeGen/RISCV/xmips-cbop.ll | 51 + llvm/test/CodeGen/RISCV/xqcicm.ll | 679 ++ llvm/test/CodeGen/RISCV/xqcisls.ll | 311 + llvm/test/CodeGen/RISCV/zicond-opts.ll | 82 +- .../CodeGen/SPIRV/capability-FloatControl2.ll | 22 + .../enable-all-extensions-but-one.ll | 2 + .../hlsl-resources/MixedBufferLoadStore.ll | 36 + .../hlsl-resources/SignedBufferLoadStore.ll | 137 + .../hlsl-resources/UnsignedBufferLoadStore.ll | 137 + llvm/test/CodeGen/SystemZ/pr60413.ll | 112 +- .../CodeGen/SystemZ/vec-max-min-zerosplat.ll | 70 +- .../CodeGen/SystemZ/zos-ada-relocations.ll | 4 +- llvm/test/CodeGen/SystemZ/zos-hlasm-out.ll | 1 + llvm/test/CodeGen/SystemZ/zos-intrinsics.ll | 4 +- llvm/test/CodeGen/SystemZ/zos-landingpad.ll | 4 +- .../ppa1.ll => CodeGen/SystemZ/zos-ppa1.ll} | 3 +- llvm/test/CodeGen/SystemZ/zos-ppa2.ll | 4 +- llvm/test/CodeGen/SystemZ/zos-section-1.ll | 129 + llvm/test/CodeGen/SystemZ/zos-section-2.ll | 175 + llvm/test/CodeGen/SystemZ/zos-simple-test.ll | 8 +- llvm/test/CodeGen/Thumb2/mve-doublereduct.ll | 162 +- .../CodeGen/Thumb2/mve-vselect-constants.ll | 8 +- llvm/test/CodeGen/WebAssembly/PR40172.ll | 6 +- llvm/test/CodeGen/WebAssembly/PR41841.ll | 16 +- .../WebAssembly/cfg-stackify-eh-legacy.mir | 2 +- .../WebAssembly/debug-code-stackification.ll | 89 + llvm/test/CodeGen/WebAssembly/eh-lsda.ll | 4 +- .../CodeGen/WebAssembly/exception-legacy.ll | 2 +- .../CodeGen/WebAssembly/exception-legacy.mir | 2 +- .../CodeGen/WebAssembly/function-info.mir | 2 +- llvm/test/CodeGen/WebAssembly/inline-asm.ll | 11 + llvm/test/CodeGen/WebAssembly/offset.ll | 10 + llvm/test/CodeGen/WebAssembly/pr51651.ll | 14 +- .../WebAssembly/signext-zeroext-callsite.ll | 60 +- llvm/test/CodeGen/WebAssembly/simd-bitmask.ll | 226 +- .../WebAssembly/simd-illegal-bitmask.ll | 596 ++ .../WebAssembly/simd-setcc-reductions.ll | 135 + .../WebAssembly/simd-vecreduce-bool.ll | 6 +- .../CodeGen/WebAssembly/suboptimal-compare.ll | 25 +- .../X86/GlobalISel/avoid-matchtable-crash.mir | 2 +- .../CodeGen/X86/GlobalISel/llvm.sincos.mir | 189 + llvm/test/CodeGen/X86/abds-neg.ll | 36 +- llvm/test/CodeGen/X86/abds-vector-128.ll | 2 +- .../CodeGen/X86/apx/kmov-domain-assignment.ll | 8 +- llvm/test/CodeGen/X86/avg.ll | 177 +- llvm/test/CodeGen/X86/avx512-vbroadcast.ll | 2 +- llvm/test/CodeGen/X86/avx512fp16-cvt.ll | 18 + .../test/CodeGen/X86/change-unsafe-fp-math.ll | 34 +- .../CodeGen/X86/dag-combiner-fma-folding.ll | 34 + .../X86/div-rem-pair-recomposition-signed.ll | 39 +- .../div-rem-pair-recomposition-unsigned.ll | 12 +- llvm/test/CodeGen/X86/fdiv.ll | 4 +- .../CodeGen/X86/fminimumnum-fmaximumnum.ll | 252 +- llvm/test/CodeGen/X86/fp-intrinsics-flags.ll | 2 +- llvm/test/CodeGen/X86/fp128-select.ll | 24 +- .../CodeGen/X86/frame-pointer-reserved.ll | 25 + llvm/test/CodeGen/X86/freeze-binary.ll | 120 + llvm/test/CodeGen/X86/freeze-unary.ll | 134 + llvm/test/CodeGen/X86/freeze-vector.ll | 138 +- llvm/test/CodeGen/X86/isel-fabs-x87.ll | 79 +- llvm/test/CodeGen/X86/isel-fabs.ll | 66 +- llvm/test/CodeGen/X86/legalize-sub-zero.ll | 22 +- llvm/test/CodeGen/X86/llvm.sincos.ll | 92 +- .../CodeGen/X86/ms-secure-hotpatch-attr.ll | 38 + .../X86/ms-secure-hotpatch-bad-file.ll | 16 + ...ms-secure-hotpatch-direct-global-access.ll | 39 + .../X86/ms-secure-hotpatch-functions-file.ll | 39 + .../X86/ms-secure-hotpatch-functions-list.ll | 38 + llvm/test/CodeGen/X86/pr134607.ll | 19 +- llvm/test/CodeGen/X86/pr43157.ll | 3 +- .../test/CodeGen/X86/setcc-non-simple-type.ll | 4 +- llvm/test/CodeGen/X86/shift-i512.ll | 194 +- llvm/test/CodeGen/X86/sqrt-fastmath-mir.ll | 20 +- llvm/test/CodeGen/X86/sqrt-fastmath.ll | 13 +- .../statepoint-cmp-sunk-past-statepoint.ll | 223 +- llvm/test/CodeGen/X86/unpredictable-brcond.ll | 2 +- .../X86/urem-seteq-vec-tautological.ll | 17 +- llvm/test/CodeGen/X86/var-permute-256.ll | 216 +- .../X86/vec-strict-fptoint-128-fp16.ll | 158 +- llvm/test/CodeGen/X86/vec_int_to_fp.ll | 24 +- llvm/test/CodeGen/X86/vector-compress.ll | 42 +- .../vector-constrained-fp-intrinsics-flags.ll | 6 +- .../vector-interleaved-load-i16-stride-4.ll | 1462 ++-- .../vector-interleaved-load-i8-stride-8.ll | 6448 ++++++++--------- .../CodeGen/X86/x86-64-double-shifts-var.ll | 64 +- llvm/test/CodeGen/X86/x86-access-to-global.ll | 27 + llvm/test/CodeGen/Xtensa/float-arith.ll | 21 +- llvm/test/CodeGen/Xtensa/invalid-tls.ll | 17 + llvm/test/CodeGen/Xtensa/select-cc-fp.ll | 457 ++ llvm/test/CodeGen/Xtensa/threadptr.ll | 18 + ...-dwarf-diop-diexpression-address-spaces.ll | 12 + .../DebugInfo/AMDGPU/reg-sequence-salvage.ll | 8 +- .../codegenprepare/sunk-addr.ll | 2 +- .../dse/dse-after-memcpyopt-merge.ll | 2 +- .../assignment-tracking/dse/shorten-offset.ll | 2 +- .../inline/shared-alloca.ll | 2 +- .../do-not-remove-redundant-dbg.ll | 2 +- .../instcombine/remove-redundant-dbg.ll | 2 +- .../loop-vectorize/remove-redundant-dbg.ll | 2 +- .../assignment-tracking/mem2reg/phi.ll | 2 +- .../mem2reg/single-block-alloca.ll | 2 +- .../mem2reg/single-store-alloca.ll | 2 +- .../mem2reg/store-to-part-of-alloca.ll | 2 +- .../Generic/assignment-tracking/optnone.ll | 2 +- .../remove-redundant-fwd-scan-linked.ll | 2 +- .../assignment-tracking/remove-redundant.ll | 2 +- .../assignment-tracking/salvage-value.ll | 2 +- .../sroa/alloca-single-slice.ll | 2 +- .../assignment-tracking/sroa/complex.ll | 2 +- .../assignment-tracking/sroa/fail-fragment.ll | 2 +- .../assignment-tracking/sroa/memcpy.ll | 2 +- .../sroa/remove-redundant-dbg.ll | 2 +- .../assignment-tracking/sroa/rewrite.ll | 2 +- .../sroa/split-pre-fragmented-store-2.ll | 2 +- .../sroa/split-pre-fragmented-store.ll | 2 +- .../Generic/assignment-tracking/sroa/store.ll | 2 +- .../assignment-tracking/sroa/user-memcpy.ll | 2 +- .../assignment-tracking/track-assignments.ll | 2 +- llvm/test/DebugInfo/Generic/debug-label.ll | 4 +- .../Generic/inline-alloca-ordering.ll | 2 +- .../DebugInfo/Generic/inline-dbg-values.ll | 2 +- .../KeyInstructions/Generic/inline-nodbg.ll | 4 +- .../KeyInstructions/Generic/inline.ll | 6 +- .../Generic/jump-threading-2-bbs.ll | 3 +- .../Generic/jump-threading-basic.ll | 3 +- ...-threading-dup-cond-br-on-phi-into-pred.ll | 3 +- .../KeyInstructions/Generic/link-two-modes.ll | 67 + .../KeyInstructions/Generic/loop-rotate.ll | 3 +- .../Generic/loop-unroll-runtime.ll | 3 +- .../KeyInstructions/Generic/loop-unroll.ll | 2 +- .../KeyInstructions/Generic/loop-unswitch.ll | 3 +- .../KeyInstructions/Generic/parse.ll | 3 +- .../KeyInstructions/Generic/roundtrip.ll | 48 + .../Generic/simplifycfg-branch-fold.ll | 4 +- .../Generic/simplifycfg-thread-phi.ll | 4 +- .../KeyInstructions/Generic/verify.ll | 22 + .../X86/cgp-break-critical-edge.ll | 2 +- .../KeyInstructions/X86/dwarf-basic-ranks.ll | 2 +- .../KeyInstructions/X86/dwarf-basic.ll | 4 +- .../X86/dwarf-buoy-multi-key.mir | 2 +- .../KeyInstructions/X86/dwarf-buoy.mir | 2 +- .../KeyInstructions/X86/dwarf-calls.ll | 2 +- .../X86/dwarf-inline-modes.mir | 93 + .../KeyInstructions/X86/dwarf-ranks-blocks.ll | 2 +- .../DebugInfo/KeyInstructions/debugify.ll | 3 + .../entry_value_gets_propagated_aarch64.mir | 84 + .../X86/entry_value_clobbered_stack_copy.mir | 52 + .../X86/entry_value_gets_propagated_X86.mir | 98 + .../X86/debug-line-in-one-fragment.ll | 12 +- .../assignment-tracking/X86/large-type.ll | 2 + llvm/test/DebugInfo/debug_frame_symbol.ll | 2 +- llvm/test/Feature/intrinsics.ll | 5 +- llvm/test/FileCheck/var-escape.txt | 29 + .../AddressSanitizer/calls-only-smallfn.ll | 2 +- .../AddressSanitizer/calls-only.ll | 2 +- .../BoundsChecking/runtimes.ll | 2 +- .../MemorySanitizer/count-zeroes.ll | 88 +- .../Instrumentation/MemorySanitizer/or.ll | 57 + .../MemorySanitizer/with-call-type-size.ll | 21 +- llvm/test/LTO/AArch64/module-asm.ll | 21 + .../directive-arch_extension-negative.s | 2 +- llvm/test/MC/AArch64/SVE2/aesd.s | 2 +- llvm/test/MC/AArch64/SVE2/aese.s | 2 +- llvm/test/MC/AArch64/SVE2/aesimc.s | 4 +- llvm/test/MC/AArch64/SVE2/aesmc.s | 4 +- llvm/test/MC/AArch64/SVE2/bdep.s | 8 +- llvm/test/MC/AArch64/SVE2/bext.s | 8 +- llvm/test/MC/AArch64/SVE2/bgrp.s | 8 +- .../MC/AArch64/SVE2/directive-arch-negative.s | 2 +- .../SVE2/directive-arch_extension-negative.s | 12 +- .../MC/AArch64/SVE2/directive-cpu-negative.s | 6 +- llvm/test/MC/AArch64/SVE2/pmullb-128.s | 2 +- llvm/test/MC/AArch64/SVE2/pmullt-128.s | 2 +- llvm/test/MC/AArch64/SVE2/rax1.s | 6 +- llvm/test/MC/AArch64/SVE2p1/aesd.s | 12 +- llvm/test/MC/AArch64/SVE2p1/aesdimc.s | 12 +- llvm/test/MC/AArch64/SVE2p1/aese.s | 12 +- llvm/test/MC/AArch64/SVE2p1/aesemc.s | 12 +- llvm/test/MC/AArch64/SVE2p1/pmlal.s | 6 +- llvm/test/MC/AArch64/SVE2p1/pmull.s | 6 +- .../MC/AArch64/coff-relocations-branch26.s | 2 +- llvm/test/MC/AArch64/coff-relocations-diags.s | 6 +- llvm/test/MC/AArch64/ilp32-diagnostics.s | 56 +- llvm/test/MC/AMDGPU/gfx10_asm_vop2.s | 12 + llvm/test/MC/AMDGPU/gfx10_asm_vop3.s | 24 + llvm/test/MC/AMDGPU/gfx10_unsupported_sdwa.s | 3 + llvm/test/MC/AMDGPU/gfx1250_asm_ds.s | 26 + llvm/test/MC/AMDGPU/gfx1250_asm_load_tr.s | 219 + llvm/test/MC/AMDGPU/gfx1250_asm_sopp.s | 12 + llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s | 569 ++ llvm/test/MC/AMDGPU/gfx1250_asm_vds_alias.s | 7 + llvm/test/MC/AMDGPU/gfx1250_asm_vflat.s | 22 + llvm/test/MC/AMDGPU/gfx1250_asm_vflat_alias.s | 37 + llvm/test/MC/AMDGPU/gfx1250_asm_vimage.s | 34 + llvm/test/MC/AMDGPU/gfx1250_asm_vimage_err.s | 25 + llvm/test/MC/AMDGPU/gfx1250_asm_vop1-fake16.s | 89 + llvm/test/MC/AMDGPU/gfx1250_asm_vop1.s | 98 + .../MC/AMDGPU/gfx1250_asm_vop1_dpp16-fake16.s | 83 + llvm/test/MC/AMDGPU/gfx1250_asm_vop1_dpp16.s | 103 + .../MC/AMDGPU/gfx1250_asm_vop1_dpp8-fake16.s | 39 + llvm/test/MC/AMDGPU/gfx1250_asm_vop1_dpp8.s | 59 + llvm/test/MC/AMDGPU/gfx1250_asm_vop1_err.s | 36 + llvm/test/MC/AMDGPU/gfx1250_asm_vop3-fake16.s | 17 + llvm/test/MC/AMDGPU/gfx1250_asm_vop3.s | 17 + llvm/test/MC/AMDGPU/gfx1250_asm_vop3_err.s | 11 + .../gfx1250_asm_vop3_from_vop1-fake16.s | 155 + .../MC/AMDGPU/gfx1250_asm_vop3_from_vop1.s | 158 + .../gfx1250_asm_vop3_from_vop1_dpp16-fake16.s | 103 + .../AMDGPU/gfx1250_asm_vop3_from_vop1_dpp16.s | 115 + .../gfx1250_asm_vop3_from_vop1_dpp8-fake16.s | 75 + .../AMDGPU/gfx1250_asm_vop3_from_vop1_dpp8.s | 83 + llvm/test/MC/AMDGPU/gfx950_asm_features.s | 24 + llvm/test/MC/AMDGPU/gfx9_asm_vop2_features.s | 91 + llvm/test/MC/AMDGPU/max-branch-distance.s | 2 +- .../Relocations/thumb-branch-out-of-range.s | 71 + llvm/test/MC/ARM/Relocations/thumb-branch.s | 21 + .../test/MC/ARM/Windows/branch-reloc-offset.s | 8 +- llvm/test/MC/ARM/Windows/invalid-relocation.s | 2 +- .../ARM/arm-memory-instructions-immediate.s | 2 +- llvm/test/MC/ARM/elf-thumbfunc-reloc.s | 9 +- llvm/test/MC/ARM/lower-upper-errors-2.s | 6 +- llvm/test/MC/ARM/pcrel-ldrd-diff-section.s | 4 +- llvm/test/MC/ARM/pcrel-vldr-diff-section.s | 6 +- llvm/test/MC/ARM/quad-relocation.s | 2 +- .../ARM/t2-modified-immediate-fixup-error1.s | 2 +- llvm/test/MC/ARM/thumb-branches.s | 71 - llvm/test/MC/ARM/thumb1-relax-adr.s | 2 +- llvm/test/MC/ARM/thumb1-relax-bcc.s | 2 +- llvm/test/MC/ARM/thumb1-relax-br.s | 2 +- llvm/test/MC/ARM/thumb1-relax-ldrlit.s | 2 +- llvm/test/MC/ARM/thumb2-branch-ranges.s | 10 +- llvm/test/MC/BPF/bad-tied.s | 12 + .../Disassembler/AMDGPU/gfx10_vop2_dpp16.txt | 7 + .../Disassembler/AMDGPU/gfx10_vop2_dpp8.txt | 3 + .../MC/Disassembler/AMDGPU/gfx10_vop3.txt | 24 + .../Disassembler/AMDGPU/gfx1250_dasm_ds.txt | 19 + .../AMDGPU/gfx1250_dasm_load_tr.txt | 103 + .../Disassembler/AMDGPU/gfx1250_dasm_sopp.txt | 9 + .../AMDGPU/gfx1250_dasm_vflat.txt | 16 + .../AMDGPU/gfx1250_dasm_vimage.txt | 25 + .../Disassembler/AMDGPU/gfx1250_dasm_vop1.txt | 109 + .../AMDGPU/gfx1250_dasm_vop1_dpp16.txt | 86 + .../AMDGPU/gfx1250_dasm_vop1_dpp8.txt | 53 + .../Disassembler/AMDGPU/gfx1250_dasm_vop3.txt | 21 + .../AMDGPU/gfx1250_dasm_vop3_from_vop1.txt | 105 + .../gfx1250_dasm_vop3_from_vop1_dpp16.txt | 115 + .../gfx1250_dasm_vop3_from_vop1_dpp8.txt | 87 + .../AMDGPU/gfx12_dasm_vop3_dpp8.txt | 108 +- llvm/test/MC/Disassembler/AMDGPU/gfx950.txt | 36 + .../AMDGPU/gfx9_vop2_features.txt | 92 + .../MC/Disassembler/RISCV/c_lui_disasm.txt | 68 - llvm/test/MC/Disassembler/Xtensa/dfpaccel.txt | 19 + llvm/test/MC/Disassembler/Xtensa/fp.txt | 208 +- .../test/MC/Disassembler/Xtensa/threadptr.txt | 11 + llvm/test/MC/ELF/bad-expr.s | 2 +- llvm/test/MC/ELF/comdat.s | 100 - llvm/test/MC/ELF/group.s | 59 + llvm/test/MC/ELF/mc-dump.s | 53 + llvm/test/MC/ELF/relocation-alias.s | 6 +- llvm/test/MC/ELF/weakref.s | 2 +- llvm/test/MC/GOFF/empty-goff.s | 10 +- .../Relocations/fixups-diagnostics.s | 12 +- llvm/test/MC/M68k/Control/branch-pc-rel.s | 2 - llvm/test/MC/M68k/Control/bsr.s | 2 - llvm/test/MC/M68k/Control/bsr32.s | 3 - llvm/test/MC/M68k/Control/call-pc-rel.s | 4 - llvm/test/MC/M68k/Relaxations/PIC/branch.s | 5 +- llvm/test/MC/M68k/Relaxations/PIC/branch32.s | 6 +- llvm/test/MC/M68k/Relaxations/branch32.s | 6 +- llvm/test/MC/M68k/Relocations/PIC/data-abs.s | 6 +- .../MC/M68k/Relocations/PIC/data-gotoff.s | 5 +- .../MC/M68k/Relocations/PIC/data-gotpcrel.s | 4 +- .../MC/M68k/Relocations/PIC/data-pc-rel.s | 5 +- llvm/test/MC/M68k/Relocations/PIC/text-plt.s | 4 +- llvm/test/MC/M68k/Relocations/data-abs.s | 6 +- llvm/test/MC/M68k/Relocations/data-gotoff.s | 5 +- llvm/test/MC/M68k/Relocations/data-gotpcrel.s | 4 +- llvm/test/MC/M68k/Relocations/data-pc-rel.s | 5 +- llvm/test/MC/M68k/Relocations/text-plt.s | 4 +- llvm/test/MC/M68k/Relocations/tls.s | 7 +- llvm/test/MC/M68k/pc-rel.s | 2 - llvm/test/MC/Mips/reloc-directive-bad-obj.s | 18 +- llvm/test/MC/Mips/unsupported-relocation.s | 2 +- llvm/test/MC/PowerPC/ppc64-abs-reloc.s | 3 - .../Relocations/data-directive-specifier.s | 12 +- llvm/test/MC/RISCV/Relocations/expr-err.s | 40 +- llvm/test/MC/RISCV/Relocations/mc-dump.s | 20 + llvm/test/MC/RISCV/fixups-diagnostics.s | 6 +- .../MC/RISCV/option-exact-long-jump-disable.s | 6 +- llvm/test/MC/RISCV/pcrel-lo12-invalid.s | 6 +- llvm/test/MC/RISCV/rv32-relaxation-xqci.s | 4 +- llvm/test/MC/RISCV/rv32c-invalid.s | 11 +- llvm/test/MC/RISCV/rv32p-invalid.s | 19 + llvm/test/MC/RISCV/rv32p-valid.s | 71 +- llvm/test/MC/RISCV/rv64p-invalid.s | 21 + llvm/test/MC/RISCV/rv64p-valid.s | 107 +- llvm/test/MC/RISCV/rvv/xsfvfwmacc.s | 4 +- .../MC/RISCV/xandesperf-fixups-diagnostics.s | 4 +- llvm/test/MC/RISCV/xandesvsintload-valid.s | 39 + llvm/test/MC/RISCV/xmips-invalid.s | 11 +- llvm/test/MC/RISCV/xmips-valid.s | 18 +- llvm/test/MC/RISCV/xqcicm-valid.s | 6 + llvm/test/MC/VE/data-reloc-error.s | 6 +- llvm/test/MC/X86/Relocations/x86-16.s | 13 + llvm/test/MC/X86/Relocations/x86-32.s | 17 + llvm/test/MC/X86/Relocations/x86-64.s | 102 + llvm/test/MC/X86/avx-64-att.s | 13 - llvm/test/MC/X86/fma4-att.s | 60 - llvm/test/MC/X86/gotpcrel-non-globals.ll | 36 + llvm/test/MC/X86/macho-reloc-errors-x86.s | 6 +- llvm/test/MC/X86/macho-reloc-errors-x86_64.s | 16 +- llvm/test/MC/X86/pltoff.s | 2 +- llvm/test/MC/X86/register-assignment.s | 4 +- llvm/test/MC/X86/unused_reg_var_assign.s | 3 - llvm/test/MC/X86/x86-16.s | 11 - llvm/test/MC/X86/x86-32-coverage.s | 6 - llvm/test/MC/X86/x86-32.s | 20 +- llvm/test/MC/X86/x86-64.s | 72 +- llvm/test/MC/X86/x86_64-encoding.s | 6 - .../Xtensa/Relocations/fixups-diagnostics.s | 8 +- llvm/test/MC/Xtensa/dfpaccel.s | 53 + llvm/test/MC/Xtensa/threadptr.s | 21 + llvm/test/Other/fatlto.ll | 7 + llvm/test/Other/pipeline-alias-errors.ll | 20 + .../TableGen/CompressWriteLatencyEntry.td | 8 +- llvm/test/TableGen/DecoderEmitterFnTable.td | 84 + .../FixedLenDecoderEmitter/conflict.td | 2 +- llvm/test/TableGen/InvalidMCSchedClassDesc.td | 22 +- llvm/test/TableGen/RuntimeLibcallEmitter.td | 77 + .../Attributor/AMDGPU/tag-invariant-loads.ll | 431 ++ .../Attributor/IPConstantProp/PR16052.ll | 8 +- .../Attributor/dereferenceable-1.ll | 1 - llvm/test/Transforms/Attributor/range.ll | 45 +- .../Attributor/value-simplify-local-remote.ll | 8 - .../Transforms/Attributor/value-simplify.ll | 4 +- .../callsite-split-preserve-debug.ll | 2 +- .../X86/gather-scatter-opt-inseltpoison.ll | 66 + .../CodeGenPrepare/X86/sink-addr-recreate.ll | 106 + .../CodeGenPrepare/X86/sink-addrmode-base.ll | 630 +- .../X86/sink-addrmode-two-phi.ll | 13 +- .../Coroutines/coro-debug-dbg.values.ll | 2 +- llvm/test/Transforms/Coroutines/coro-debug.ll | 32 +- .../Coroutines/coro-split-dbg-labels.ll | 147 + ...-lieftime.ll => coro-split-no-lifetime.ll} | 0 llvm/test/Transforms/DCE/dbg-value-removal.ll | 60 +- .../Transforms/DeadStoreElimination/simple.ll | 35 +- llvm/test/Transforms/EarlyCSE/writeonly.ll | 148 +- .../test/Transforms/EmbedBitcode/embed-wpd.ll | 7 +- .../Transforms/FunctionAttrs/initializes.ll | 20 +- llvm/test/Transforms/FunctionAttrs/nosync.ll | 2 +- .../GlobalOpt/ARM/arm-widen-dest-non-array.ll | 39 - .../GlobalOpt/ARM/arm-widen-global-dest.ll | 28 - .../GlobalOpt/ARM/arm-widen-non-byte-array.ll | 22 - .../ARM/arm-widen-non-const-global.ll | 21 - .../ARM/arm-widen-string-multi-use.ll | 33 - .../GlobalOpt/ARM/arm-widen-strings-1.ll | 21 - .../GlobalOpt/ARM/arm-widen-strings-2.ll | 21 - .../arm-widen-strings-lengths-dont-match.ll | 26 - .../arm-widen-strings-more-than-64-bytes.ll | 28 - .../ARM/arm-widen-strings-ptrtoint.ll | 54 - .../ARM/arm-widen-strings-struct-test.ll | 45 - .../ARM/arm-widen-strings-volatile.ll | 29 - .../Transforms/GlobalOpt/ARM/lit.local.cfg | 2 - .../assumption-cache-invalidation.ll | 2 +- .../InferAlignment/gep-recurrence.ll | 574 ++ .../Inline/simplify-crosscallsite.ll | 67 + .../Transforms/InstCombine/AMDGPU/fmed3.ll | 90 + .../InstCombine/SystemZ/lit.local.cfg | 2 + .../SystemZ/printf-opt-alignment.ll | 17 + .../InstCombine/binop-recurrence.ll | 1408 ++++ .../Transforms/InstCombine/compare-3way.ll | 114 +- .../test/Transforms/InstCombine/ctpop-cttz.ll | 21 + .../InstCombine/debuginfo-variables.ll | 9 +- .../fold-phi-arg-gep-to-phi-negative.ll | 6 +- .../InstCombine/fold-shuffle-ext.ll | 121 + llvm/test/Transforms/InstCombine/freeze.ll | 98 + .../Transforms/InstCombine/getelementptr.ll | 14 +- llvm/test/Transforms/InstCombine/icmp-gep.ll | 92 + llvm/test/Transforms/InstCombine/icmp.ll | 102 + .../matrix-multiplication-negation.ll | 7 +- llvm/test/Transforms/InstCombine/pr39908.ll | 12 +- .../sub-after-sle-is-non-negative.ll | 153 + llvm/test/Transforms/InstCombine/sub-gep.ll | 133 + .../vec_demanded_elts-inseltpoison.ll | 24 +- .../InstCombine/vec_demanded_elts.ll | 24 +- .../vec_extract_through_broadcast.ll | 52 + .../InstCombine/vec_shuffle-inseltpoison.ll | 9 +- .../Transforms/InstCombine/vec_shuffle.ll | 45 +- .../Transforms/InstCombine/vector-reverse.ll | 153 +- .../InstCombine/vector_gep1-inseltpoison.ll | 2 +- .../Transforms/InstCombine/vector_gep1.ll | 2 +- .../vscale_extractelement-inseltpoison.ll | 13 +- .../InstCombine/vscale_extractelement.ll | 13 +- .../InstSimplify/ConstProp/atan-intrinsic.ll | 1 - .../InstSimplify/ConstProp/calls.ll | 12 + llvm/test/Transforms/InstSimplify/call.ll | 24 +- .../InstSimplify/fold-intrinsics.ll | 45 +- .../InstSimplify/saturating-add-sub.ll | 32 +- .../AArch64/sve-deinterleave4.ll | 90 +- .../AArch64/sve-interleave4.ll | 17 +- .../RISCV/interleaved-accesses.ll | 196 - .../Transforms/LICM/salvage-hoisted-minmax.ll | 59 + llvm/test/Transforms/LoopDeletion/diundef.ll | 2 +- llvm/test/Transforms/LoopFusion/four_loops.ll | 85 +- .../Transforms/LoopFusion/guarded_peel.ll | 93 +- .../LoopFusion/guarded_unsafeblock_peel.ll | 55 +- .../Transforms/LoopFusion/hoist_preheader.ll | 25 +- .../test/Transforms/LoopFusion/inner_loops.ll | 72 +- llvm/test/Transforms/LoopFusion/loop_nest.ll | 68 +- .../Transforms/LoopFusion/nonadjacent_peel.ll | 67 +- llvm/test/Transforms/LoopFusion/peel.ll | 132 +- .../Transforms/LoopFusion/sink_preheader.ll | 20 +- .../LoopInterchange/position-in-pipeline.ll | 48 + llvm/test/Transforms/LoopRotate/dbgvalue.ll | 2 +- .../LoopRotate/delete-dbg-values.ll | 2 +- .../LoopVectorize/AArch64/check-prof-info.ll | 2 +- .../LoopVectorize/AArch64/early_exit_costs.ll | 2 +- .../LoopVectorize/AArch64/licm-calls.ll | 72 + .../AArch64/partial-reduce-chained.ll | 466 ++ .../partial-reduce-dot-product-mixed.ll | 24 +- .../AArch64/partial-reduce-dot-product.ll | 586 +- .../LoopVectorize/AArch64/partial-reduce.ll | 918 +++ .../AArch64/simple_early_exit.ll | 2 +- .../AArch64/single-early-exit-interleave.ll | 55 +- .../AArch64/sve-interleaved-accesses.ll | 24 +- ...-narrow-interleave-to-widen-memory-cost.ll | 307 + ...-interleave-to-widen-memory-derived-ivs.ll | 303 + ...sform-narrow-interleave-to-widen-memory.ll | 385 + .../LoopVectorize/AArch64/vplan-printing.ll | 3 +- .../AMDGPU/assert-vplan-cost-model.ll | 2 +- .../LoopVectorize/ARM/mve-reductions.ll | 4 +- .../RISCV/evl-compatible-loops.ll | 56 +- .../LoopVectorize/RISCV/inloop-reduction.ll | 2 +- .../RISCV/interleaved-masked-access.ll | 326 +- .../RISCV/only-compute-cost-for-vplan-vfs.ll | 10 +- .../LoopVectorize/RISCV/preserve-dbg-loc.ll | 2 +- .../RISCV/riscv-vector-reverse-output.ll | 48 +- .../RISCV/riscv-vector-reverse.ll | 148 +- .../RISCV/type-info-cache-evl-crash.ll | 2 +- ...ize-force-tail-with-evl-cast-intrinsics.ll | 45 +- ...rize-force-tail-with-evl-cond-reduction.ll | 271 +- ...ce-tail-with-evl-fixed-order-recurrence.ll | 149 + ...rize-force-tail-with-evl-gather-scatter.ll | 54 +- ...vectorize-force-tail-with-evl-reduction.ll | 12 +- ...-force-tail-with-evl-reverse-load-store.ll | 21 +- ...orize-force-tail-with-evl-uniform-store.ll | 3 +- .../RISCV/vplan-vp-call-intrinsics.ll | 27 +- .../RISCV/vplan-vp-cast-intrinsics.ll | 61 +- .../RISCV/vplan-vp-intrinsics-reduction.ll | 18 +- .../RISCV/vplan-vp-intrinsics.ll | 5 +- .../RISCV/vplan-vp-select-intrinsics.ll | 77 - .../LoopVectorize/X86/cost-model.ll | 3 +- .../X86/fixed-order-recurrence.ll | 6 - ...terleave-ptradd-with-replicated-operand.ll | 51 +- ...6-sunk-instruction-used-outside-of-loop.ll | 2 + ...able-info-from-assumption-variable-size.ll | 407 -- .../LoopVectorize/early_exit_legality.ll | 2 +- .../early_exit_store_legality.ll | 31 +- .../epilog-vectorization-reductions.ll | 6 +- ...-order-recurrence-sink-replicate-region.ll | 3 +- .../LoopVectorize/first-order-recurrence.ll | 16 +- .../invariant-store-vectorization-2.ll | 6 +- .../LoopVectorize/iv-select-cmp-decreasing.ll | 930 ++- .../LoopVectorize/iv_outside_user.ll | 5 - .../LoopVectorize/load-deref-pred-align.ll | 2 + .../LoopVectorize/multi_early_exit.ll | 2 +- .../multi_early_exit_live_outs.ll | 2 +- .../LoopVectorize/narrow-to-single-scalar.ll | 69 + .../LoopVectorize/reduction-small-size.ll | 9 +- .../reuse-lcssa-phi-scev-expansion.ll | 198 + .../scalable-reduction-inloop.ll | 4 +- .../single-early-exit-deref-assumptions.ll | 96 + .../single-early-exit-interleave-hint.ll | 89 + .../single-early-exit-interleave.ll | 385 +- .../LoopVectorize/single_early_exit.ll | 2 +- .../single_early_exit_live_outs.ll | 2 +- .../single_early_exit_with_outer_loop.ll | 2 +- .../LoopVectorize/struct-return-replicate.ll | 96 +- .../uncountable-early-exit-vplan.ll | 2 +- .../Transforms/LoopVectorize/uniform-blend.ll | 4 + .../LoopVectorize/unsupported_early_exit.ll | 2 +- ...or-loop-backedge-elimination-early-exit.ll | 29 +- .../vplan-printing-reductions.ll | 23 +- .../MergeICmps/X86/blockaddresses.ll | 87 + .../PGOProfile/indirect_call_promotion.ll | 14 + .../PhaseOrdering/X86/blendv-select.ll | 160 +- .../test/Transforms/PhaseOrdering/X86/hadd.ll | 16 +- .../test/Transforms/PhaseOrdering/X86/hsub.ll | 16 +- .../always-inline-alloca-promotion.ll | 91 + .../PhaseOrdering/loop-access-checks.ll | 3 +- .../Transforms/PhaseOrdering/memset-dse.ll | 30 + .../RelLookupTableConverter/unnamed_addr.ll | 45 + .../SLPVectorizer/AArch64/gather-cost.ll | 40 +- .../SLPVectorizer/AArch64/gather-reduce.ll | 136 +- .../SLPVectorizer/AArch64/getelementptr.ll | 60 +- .../SLPVectorizer/AArch64/getelementptr2.ll | 26 +- .../SLPVectorizer/AArch64/loadorder.ll | 357 +- .../AArch64/transpose-inseltpoison.ll | 6 +- .../SLPVectorizer/AArch64/transpose.ll | 6 +- .../AMDGPU/add_sub_sat-inseltpoison.ll | 132 +- .../SLPVectorizer/AMDGPU/add_sub_sat.ll | 152 +- .../Transforms/SLPVectorizer/AMDGPU/i8.ll | 199 +- .../SLPVectorizer/AMDGPU/min_max.ll | 58 +- .../AMDGPU/phi-result-use-order.ll | 34 +- .../SLPVectorizer/AMDGPU/reduction.ll | 127 +- .../SLPVectorizer/AMDGPU/vectorize-i8.ll | 504 +- .../WebAssembly/no-vectorize-rotate.ll | 12 +- .../X86/alternate-calls-inseltpoison.ll | 104 +- .../SLPVectorizer/X86/alternate-calls.ll | 116 +- .../X86/alternate-cast-inseltpoison.ll | 80 +- .../SLPVectorizer/X86/alternate-cast.ll | 80 +- .../X86/alternate-fp-inseltpoison.ll | 123 +- .../SLPVectorizer/X86/alternate-fp.ll | 123 +- .../X86/alternate-int-inseltpoison.ll | 239 +- .../SLPVectorizer/X86/alternate-int.ll | 239 +- .../X86/blending-shuffle-inseltpoison.ll | 34 +- .../SLPVectorizer/X86/blending-shuffle.ll | 44 +- .../X86/cmp_commute-inseltpoison.ll | 4 +- .../SLPVectorizer/X86/cmp_commute.ll | 4 +- .../X86/extracts-non-extendable.ll | 26 +- .../SLPVectorizer/X86/hadd-inseltpoison.ll | 78 +- .../test/Transforms/SLPVectorizer/X86/hadd.ll | 90 +- .../SLPVectorizer/X86/hsub-inseltpoison.ll | 72 +- .../test/Transforms/SLPVectorizer/X86/hsub.ll | 72 +- .../SLPVectorizer/X86/minimum-sizes.ll | 74 +- .../SLPVectorizer/X86/operandorder.ll | 86 +- .../Transforms/SLPVectorizer/X86/pr40522.ll | 34 +- .../Transforms/SLPVectorizer/X86/pr46983.ll | 30 +- .../Transforms/SLPVectorizer/X86/pr47623.ll | 26 +- .../SLPVectorizer/X86/pr47629-inseltpoison.ll | 479 +- .../Transforms/SLPVectorizer/X86/pr47629.ll | 479 +- .../Transforms/SLPVectorizer/X86/pr47642.ll | 10 +- .../Transforms/SLPVectorizer/X86/pr49081.ll | 7 +- ...masked-loads-consecutive-loads-same-ptr.ll | 10 +- .../X86/reverse_extract_elements.ll | 2 +- .../extractelement-insertpoint.ll | 2 +- .../SLPVectorizer/revec-shufflevector.ll | 93 +- llvm/test/Transforms/SROA/select-gep.ll | 41 + .../RISCV/switch-of-powers-of-two.ll | 3 +- .../RISCV/switch_to_lookup_table-rv64.ll | 12 +- .../SimplifyCFG/X86/disable-lookup-table.ll | 3 +- .../SimplifyCFG/X86/switch-covered-bug.ll | 4 +- .../X86/switch-of-powers-of-two.ll | 3 +- .../SimplifyCFG/X86/switch-table-bug.ll | 4 +- .../X86/switch-to-lookup-bitcast.ll | 3 +- .../SimplifyCFG/X86/switch-to-lookup-gep.ll | 3 +- .../X86/switch-to-lookup-globals.ll | 3 +- .../X86/switch-to-lookup-large-types.ll | 5 +- .../SimplifyCFG/X86/switch_to_lookup_table.ll | 60 +- .../SimplifyCFG/preserve-branchweights.ll | 44 +- .../Transforms/SimplifyCFG/rangereduce.ll | 15 +- .../switch-dead-default-lookup-table.ll | 2 +- .../SimplifyCFG/switch-to-select-two-case.ll | 441 ++ .../Transforms/SimplifyCFG/switch_mask.ll | 3 +- .../test/Transforms/Util/Debugify/loc-only.ll | 2 +- .../trivial-auto-var-init-crash-20210521.ll | 2 +- .../VectorCombine/AArch64/ext-extract.ll | 128 +- ...load-extract-insert-store-scalarization.ll | 7 +- .../load-extractelement-scalarization.ll | 3 +- .../VectorCombine/AArch64/shrink-types.ll | 29 +- .../AArch64/shuffletoidentity.ll | 6 +- .../AArch64/vecreduce-shuffle.ll | 18 +- .../RISCV/vpintrin-scalarization.ll | 23 +- .../VectorCombine/X86/extract-binop.ll | 19 + .../VectorCombine/X86/extract-fneg-insert.ll | 8 +- .../X86/load-extractelement-scalarization.ll | 3 +- .../VectorCombine/X86/load-inseltpoison.ll | 5 +- .../test/Transforms/VectorCombine/X86/load.ll | 11 +- .../Transforms/VectorCombine/X86/pr114901.ll | 6 +- .../VectorCombine/X86/shuffle-of-selects.ll | 10 +- .../VectorCombine/intrinsic-scalarize.ll | 6 +- .../lower-builtin-allow-check-pipeline.ll | 3 + .../lower-builtin-allow-check-remarks.ll | 12 + llvm/test/Verifier/assume-bundles.ll | 4 + llvm/test/Verifier/branch-weight.ll | 151 + llvm/test/Verifier/dead-on-return.ll | 7 + llvm/test/Verifier/value-profile.ll | 38 + .../Inputs/nvptx-basic.ll.expected | 8 +- .../X86/global_downgraded_to_static.c | 2 +- llvm/test/tools/dxil-dis/shuffle.ll | 2 +- llvm/test/tools/llc/new-pm/pipeline.mir | 8 + .../llc/new-pm/x86_64-regalloc-pipeline.mir | 2 +- .../Inputs/binary-formats.canonical.json | 2 +- .../test/tools/llvm-cov/mcdc-export-json.test | 8 +- .../WebAssembly/wasm-32bit-tombstone.s | 107 + .../AArch64/template_ref_ptr.ll | 2 +- .../macho-gsym-callsite-info-obj.test | 6 +- .../AArch64/Neoverse/N2-sve-instructions.s | 18 +- .../llvm-mca/AArch64/Neoverse/N2-writeback.s | 4014 +++++----- .../X86/LunarlakeP/independent-load-stores.s | 148 + .../LunarlakeP/partially-overlapping-groups.s | 21 + .../llvm-mca/X86/LunarlakeP/resources-aes.s | 68 + .../llvm-mca/X86/LunarlakeP/resources-avx1.s | 2428 +++++++ .../llvm-mca/X86/LunarlakeP/resources-avx2.s | 1092 +++ .../X86/LunarlakeP/resources-avxgfni.s | 82 + .../X86/LunarlakeP/resources-avxvnni.s | 96 + .../llvm-mca/X86/LunarlakeP/resources-bmi2.s | 152 + .../X86/LunarlakeP/resources-clflushopt.s | 44 + .../llvm-mca/X86/LunarlakeP/resources-clwb.s | 44 + .../llvm-mca/X86/LunarlakeP/resources-cmov.s | 334 + .../X86/LunarlakeP/resources-cmpxchg.s | 53 + .../llvm-mca/X86/LunarlakeP/resources-f16c.s | 68 + .../llvm-mca/X86/LunarlakeP/resources-fma.s | 712 ++ .../X86/LunarlakeP/resources-fsgsbase.s | 68 + .../llvm-mca/X86/LunarlakeP/resources-gfni.s | 61 + .../llvm-mca/X86/LunarlakeP/resources-lea.s | 448 ++ .../llvm-mca/X86/LunarlakeP/resources-lzcnt.s | 61 + .../llvm-mca/X86/LunarlakeP/resources-mmx.s | 404 ++ .../llvm-mca/X86/LunarlakeP/resources-movbe.s | 61 + .../X86/LunarlakeP/resources-pclmul.s | 47 + .../X86/LunarlakeP/resources-popcnt.s | 61 + .../X86/LunarlakeP/resources-prefetchw.s | 47 + .../X86/LunarlakeP/resources-rdrand.s | 50 + .../X86/LunarlakeP/resources-rdseed.s | 50 + .../llvm-mca/X86/LunarlakeP/resources-sse1.s | 472 ++ .../llvm-mca/X86/LunarlakeP/resources-sse2.s | 971 +++ .../llvm-mca/X86/LunarlakeP/resources-sse3.s | 115 + .../llvm-mca/X86/LunarlakeP/resources-sse41.s | 377 + .../llvm-mca/X86/LunarlakeP/resources-sse42.s | 110 + .../llvm-mca/X86/LunarlakeP/resources-ssse3.s | 264 + .../llvm-mca/X86/LunarlakeP/resources-vaes.s | 68 + .../X86/LunarlakeP/resources-vpclmulqdq.s | 47 + .../X86/LunarlakeP/resources-x86_32.s | 89 + .../X86/LunarlakeP/resources-x86_64.s | 2886 ++++++++ .../llvm-mca/X86/LunarlakeP/resources-x87.s | 532 ++ .../llvm-mca/X86/LunarlakeP/resources-xsave.s | 60 + .../llvm-mca/X86/LunarlakeP/zero-idioms.s | 502 ++ llvm/test/tools/llvm-mca/X86/show-encoding.s | 2 +- .../tools/llvm-objcopy/COFF/string-table.test | 34 + .../symbolize-operands-executable.yaml | 67 + .../AArch64/symbolize-operands-relocatable.s | 79 + ...ddrmap-disassemble-symbolize-operands.yaml | 34 +- .../Inputs/expected-origin.html | 124 + .../Inputs/expected-skipped.html | 9 + .../Inputs/origin.json | 1 + .../llvm-original-di-preservation/basic.test | 4 + llvm/tools/lli/lli.cpp | 4 +- llvm/tools/llvm-c-test/debuginfo.c | 8 +- llvm/tools/llvm-cov/CoverageExporterJson.cpp | 6 +- llvm/tools/llvm-exegesis/lib/Analysis.cpp | 9 +- .../llvm-exegesis/lib/MCInstrDescView.cpp | 12 +- llvm/tools/llvm-jitlink/llvm-jitlink.cpp | 1 + llvm/tools/llvm-lto/llvm-lto.cpp | 2 + llvm/tools/llvm-mc/Disassembler.cpp | 2 +- .../llvm-mca/Views/BottleneckAnalysis.cpp | 3 +- .../llvm-mca/Views/RegisterFileStatistics.cpp | 4 +- llvm/tools/llvm-mca/Views/TimelineView.cpp | 6 +- llvm/tools/llvm-ml/Disassembler.cpp | 2 +- llvm/tools/llvm-objdump/llvm-objdump.cpp | 3 +- .../llvm-pdbutil/MinimalSymbolDumper.cpp | 8 + llvm/tools/llvm-profdata/llvm-profdata.cpp | 5 +- llvm/tools/llvm-profgen/ProfileGenerator.cpp | 2 - llvm/tools/llvm-remarkutil/RemarkCounter.cpp | 17 +- llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp | 5 +- llvm/tools/lto/lto.cpp | 9 + llvm/tools/lto/lto.exports | 2 + llvm/unittests/ADT/ArrayRefTest.cpp | 71 +- llvm/unittests/ADT/DynamicAPIntTest.cpp | 10 + llvm/unittests/ADT/STLExtrasTest.cpp | 11 + llvm/unittests/ADT/STLForwardCompatTest.cpp | 19 + llvm/unittests/Analysis/AliasAnalysisTest.cpp | 3 +- .../Analysis/BasicAliasAnalysisTest.cpp | 3 +- llvm/unittests/Analysis/DDGTest.cpp | 2 +- .../FunctionPropertiesAnalysisTest.cpp | 118 +- llvm/unittests/Analysis/IR2VecTest.cpp | 120 +- llvm/unittests/Analysis/IVDescriptorsTest.cpp | 2 +- llvm/unittests/Analysis/LoadsTest.cpp | 2 +- llvm/unittests/Analysis/LoopInfoTest.cpp | 2 +- llvm/unittests/Analysis/LoopNestTest.cpp | 2 +- .../Analysis/MemoryProfileInfoTest.cpp | 3 +- llvm/unittests/Analysis/MemorySSATest.cpp | 3 +- .../Analysis/ScalarEvolutionTest.cpp | 3 +- .../Analysis/TargetLibraryInfoTest.cpp | 2 +- .../unittests/Analysis/UnrollAnalyzerTest.cpp | 2 +- llvm/unittests/Analysis/ValueTrackingTest.cpp | 59 +- .../CodeGen/SelectionDAGPatternMatchTest.cpp | 121 + .../EPCGenericJITLinkMemoryManagerTest.cpp | 1 + .../Orc/EPCGenericMemoryAccessTest.cpp | 365 +- ...ecutionSessionWrapperFunctionCallsTest.cpp | 3 +- .../Orc/ObjectLinkingLayerTest.cpp | 2 + .../ExecutionEngine/Orc/OrcTestCommon.h | 42 + .../Orc/RTDyldObjectLinkingLayerTest.cpp | 42 +- .../Orc/ReOptimizeLayerTest.cpp | 5 +- .../Orc/SharedMemoryMapperTest.cpp | 1 + .../Orc/ThreadSafeModuleTest.cpp | 123 +- llvm/unittests/FileCheck/FileCheckTest.cpp | 8 +- llvm/unittests/Frontend/CMakeLists.txt | 2 + .../Frontend/HLSLRootSignatureDumpTest.cpp | 136 +- .../Frontend/HLSLRootSignatureRangesTest.cpp | 2 +- .../OpenMPDirectiveNameParserTest.cpp | 171 + .../Frontend/OpenMPDirectiveNameTest.cpp | 96 + llvm/unittests/FuzzMutate/StrategiesTest.cpp | 68 +- llvm/unittests/IR/BasicBlockDbgInfoTest.cpp | 2 +- llvm/unittests/IR/DebugInfoTest.cpp | 29 + .../unittests/IR/DebugTypeODRUniquingTest.cpp | 6 +- llvm/unittests/IR/IRBuilderTest.cpp | 8 +- llvm/unittests/IR/LegacyPassManagerTest.cpp | 3 +- llvm/unittests/IR/MetadataTest.cpp | 76 +- llvm/unittests/Object/DXContainerTest.cpp | 8 +- llvm/unittests/Object/ELFObjectFileTest.cpp | 7 +- .../ObjectYAML/DXContainerYAMLTest.cpp | 4 +- llvm/unittests/ProfileData/InstrProfTest.cpp | 20 +- llvm/unittests/SandboxIR/UtilsTest.cpp | 2 +- llvm/unittests/Support/Base64Test.cpp | 2 +- llvm/unittests/Support/ParallelTest.cpp | 6 +- .../Support/RISCVAttributeParserTest.cpp | 2 +- .../unittests/Support/TrailingObjectsTest.cpp | 7 +- .../Target/RISCV/RISCVInstrInfoTest.cpp | 6 +- llvm/unittests/TargetParser/Host.cpp | 8 + .../TargetParser/RISCVISAInfoTest.cpp | 2 + .../TargetParser/TargetParserTest.cpp | 13 +- llvm/unittests/TargetParser/TripleTest.cpp | 190 + .../Instrumentation/MemProfUseTest.cpp | 8 +- .../Transforms/Utils/BasicBlockUtilsTest.cpp | 4 +- .../Transforms/Utils/CloningTest.cpp | 4 +- .../Transforms/Utils/CodeMoverUtilsTest.cpp | 8 +- .../Utils/LoopRotationUtilsTest.cpp | 4 +- .../Transforms/Utils/LoopUtilsTest.cpp | 2 +- .../Utils/ScalarEvolutionExpanderTest.cpp | 3 +- .../Transforms/Utils/UnrollLoopTest.cpp | 2 +- .../SandboxVectorizer/DependencyGraphTest.cpp | 15 +- .../SandboxVectorizer/LegalityTest.cpp | 9 +- .../SandboxVectorizer/SchedulerTest.cpp | 15 +- .../SandboxVectorizer/SeedCollectorTest.cpp | 29 +- .../SandboxVectorizer/VecUtilsTest.cpp | 10 +- .../Transforms/Vectorize/VPlanSlpTest.cpp | 13 +- .../Transforms/Vectorize/VPlanTest.cpp | 39 +- .../Transforms/Vectorize/VPlanTestBase.h | 11 +- llvm/utils/TableGen/AsmMatcherEmitter.cpp | 28 +- llvm/utils/TableGen/AsmWriterEmitter.cpp | 2 +- llvm/utils/TableGen/Basic/CMakeLists.txt | 1 + .../TableGen/Basic/RuntimeLibcallsEmitter.cpp | 345 + llvm/utils/TableGen/CodeEmitterGen.cpp | 11 +- llvm/utils/TableGen/CodeGenMapTable.cpp | 2 +- .../TableGen/Common/CodeGenDAGPatterns.cpp | 7 +- .../TableGen/Common/CodeGenInstruction.cpp | 47 +- .../TableGen/Common/CodeGenInstruction.h | 15 +- .../TableGen/Common/CodeGenRegisters.cpp | 2 +- .../utils/TableGen/Common/CodeGenSchedule.cpp | 34 +- llvm/utils/TableGen/Common/CodeGenTarget.cpp | 28 +- llvm/utils/TableGen/Common/CodeGenTarget.h | 47 +- .../GlobalISel/GlobalISelMatchTable.cpp | 2 +- .../TableGen/Common/VarLenCodeEmitterGen.cpp | 2 +- llvm/utils/TableGen/CompressInstEmitter.cpp | 198 +- llvm/utils/TableGen/DAGISelMatcherEmitter.cpp | 2 +- llvm/utils/TableGen/DAGISelMatcherOpt.cpp | 4 +- llvm/utils/TableGen/DecoderEmitter.cpp | 334 +- llvm/utils/TableGen/DisassemblerEmitter.cpp | 5 +- llvm/utils/TableGen/InstrDocsEmitter.cpp | 2 +- llvm/utils/TableGen/InstrInfoEmitter.cpp | 37 +- llvm/utils/TableGen/SubtargetEmitter.cpp | 22 +- llvm/utils/TableGen/X86FoldTablesEmitter.cpp | 2 +- .../utils/TableGen/X86InstrMappingEmitter.cpp | 3 +- llvm/utils/TableGen/X86MnemonicTables.cpp | 2 +- .../utils/gn/secondary/bolt/lib/Core/BUILD.gn | 1 + .../gn/secondary/bolt/lib/Rewrite/BUILD.gn | 1 + .../clang-tidy/modernize/BUILD.gn | 1 + .../gn/secondary/clang/lib/Driver/BUILD.gn | 1 - .../secondary/clang/lib/Interpreter/BUILD.gn | 1 + llvm/utils/gn/secondary/clang/test/BUILD.gn | 11 +- .../gn/secondary/clang/unittests/BUILD.gn | 7 + .../gn/secondary/libcxx/include/BUILD.gn | 13 +- .../source/Plugins/Process/Utility/BUILD.gn | 2 - .../source/Plugins/Process/mach-core/BUILD.gn | 1 + .../llvm/include/llvm/Config/BUILD.gn | 1 + .../secondary/llvm/include/llvm/IR/BUILD.gn | 9 + .../llvm/lib/CodeGen/AsmPrinter/BUILD.gn | 1 + .../gn/secondary/llvm/lib/CodeGen/BUILD.gn | 1 + .../llvm/lib/DWARFLinker/Classic/BUILD.gn | 1 + .../llvm/lib/DWARFLinker/Parallel/BUILD.gn | 1 + .../llvm/lib/DebugInfo/DWARF/BUILD.gn | 4 +- .../lib/DebugInfo/DWARF/LowLevel/BUILD.gn | 12 + .../llvm/lib/DebugInfo/LogicalView/BUILD.gn | 1 + .../llvm/lib/ExecutionEngine/Orc/BUILD.gn | 2 + .../secondary/llvm/lib/Frontend/HLSL/BUILD.gn | 4 +- .../llvm/lib/Frontend/OpenMP/BUILD.gn | 1 + llvm/utils/gn/secondary/llvm/lib/MC/BUILD.gn | 1 + .../secondary/llvm/lib/ProfileData/BUILD.gn | 1 + .../secondary/llvm/lib/Target/AMDGPU/BUILD.gn | 1 + .../Target/LoongArch/MCTargetDesc/BUILD.gn | 1 - .../lib/Target/PowerPC/MCTargetDesc/BUILD.gn | 1 - .../gn/secondary/llvm/tools/dsymutil/BUILD.gn | 1 + .../llvm/tools/llvm-dwarfdump/BUILD.gn | 1 + .../llvm/tools/llvm-dwarfutil/BUILD.gn | 1 + .../llvm/tools/llvm-objdump/BUILD.gn | 1 + .../llvm/unittests/DebugInfo/DWARF/BUILD.gn | 1 + .../llvm/unittests/Frontend/BUILD.gn | 2 + .../llvm/utils/TableGen/Basic/BUILD.gn | 1 + llvm/utils/lit/lit/llvm/config.py | 3 +- llvm/utils/llvm-original-di-preservation.py | 36 +- llvm/utils/release/github-upload-release.py | 43 +- mlir/cmake/modules/IRDLToCpp.cmake | 2 +- mlir/docs/Bindings/Python.md | 7 +- mlir/docs/Tutorials/transform/Ch1.md | 44 +- mlir/docs/Tutorials/transform/Ch2.md | 4 +- mlir/docs/Tutorials/transform/Ch4.md | 18 +- mlir/docs/Tutorials/transform/ChH.md | 2 +- mlir/examples/toy/Ch2/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch2/mlir/MLIRGen.cpp | 2 +- mlir/examples/toy/Ch3/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch3/mlir/MLIRGen.cpp | 2 +- mlir/examples/toy/Ch4/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch4/mlir/MLIRGen.cpp | 2 +- mlir/examples/toy/Ch5/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch5/mlir/MLIRGen.cpp | 2 +- mlir/examples/toy/Ch6/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp | 2 +- mlir/examples/toy/Ch6/mlir/MLIRGen.cpp | 2 +- mlir/examples/toy/Ch7/include/toy/Ops.td | 2 +- mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp | 2 +- mlir/examples/toy/Ch7/mlir/MLIRGen.cpp | 6 +- .../mlir/Conversion/LLVMCommon/Pattern.h | 4 + mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td | 34 + .../mlir/Dialect/AMDGPU/Transforms/Passes.h | 6 +- .../mlir/Dialect/AMDGPU/Transforms/Passes.td | 4 +- .../mlir/Dialect/Affine/IR/AffineOps.td | 25 +- mlir/include/mlir/Dialect/Affine/Passes.td | 17 + mlir/include/mlir/Dialect/Affine/Utils.h | 14 +- mlir/include/mlir/Dialect/Arith/IR/Arith.h | 9 + mlir/include/mlir/Dialect/ArmNeon/ArmNeon.td | 28 + .../include/mlir/Dialect/ArmNeon/Transforms.h | 2 +- mlir/include/mlir/Dialect/ArmSVE/IR/ArmSVE.td | 29 + .../include/mlir/Dialect/Async/IR/AsyncOps.td | 2 +- .../IR/BufferizableOpInterface.h | 2 +- .../IR/BufferizableOpInterface.td | 2 +- .../Bufferization/IR/BufferizationOps.td | 6 +- .../IR/BufferizationTypeInterfaces.h | 1 - .../IR/UnstructuredControlFlow.h | 4 +- mlir/include/mlir/Dialect/EmitC/IR/EmitC.td | 97 + .../mlir/Dialect/EmitC/Transforms/Passes.h | 1 + .../mlir/Dialect/EmitC/Transforms/Passes.td | 38 + .../Dialect/EmitC/Transforms/Transforms.h | 4 + mlir/include/mlir/Dialect/Func/IR/FuncOps.td | 2 +- .../Dialect/GPU/IR/GPUDeviceMappingAttr.td | 24 + mlir/include/mlir/Dialect/GPU/IR/GPUOps.td | 52 +- .../mlir/Dialect/GPU/TransformOps/Utils.h | 40 +- .../mlir/Dialect/LLVMIR/CMakeLists.txt | 10 + .../include/mlir/Dialect/LLVMIR/LLVMOpBase.td | 3 +- mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td | 2 +- mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td | 14 +- .../include/mlir/Dialect/LLVMIR/XeVMDialect.h | 28 + mlir/include/mlir/Dialect/LLVMIR/XeVMOps.td | 561 ++ mlir/include/mlir/Dialect/Linalg/IR/Linalg.h | 18 + .../mlir/Dialect/Linalg/IR/LinalgBase.td | 3 +- .../mlir/Dialect/Linalg/IR/LinalgEnums.td | 15 + .../Dialect/Linalg/IR/LinalgInterfaces.td | 2 +- .../Linalg/IR/LinalgNamedStructuredOps.yaml | 114 - .../mlir/Dialect/Linalg/IR/LinalgOps.td | 18 +- .../Dialect/Linalg/IR/LinalgRelayoutOps.td | 76 +- .../Dialect/Linalg/IR/LinalgStructuredOps.td | 50 +- .../Linalg/TransformOps/LinalgTransformOps.td | 5 +- .../Dialect/Linalg/Transforms/Transforms.h | 61 +- .../mlir/Dialect/MLProgram/IR/MLProgramOps.td | 4 +- .../mlir/Dialect/MemRef/IR/MemRefOps.td | 1 + .../mlir/Dialect/MemRef/Transforms/Passes.td | 62 + .../Dialect/MemRef/Transforms/Transforms.h | 2 +- mlir/include/mlir/Dialect/Mesh/IR/MeshOps.h | 2 +- .../mlir/Dialect/OpenACC/OpenACCOps.td | 179 +- .../Dialect/OpenMP/OpenMPClauseOperands.h | 6 +- .../mlir/Dialect/OpenMP/OpenMPDialect.h | 3 +- .../mlir/Dialect/OpenMP/OpenMPInterfaces.h | 3 +- .../mlir/Dialect/OpenMP/OpenMPOpsAttributes.h | 18 + .../mlir/Dialect/OpenMP/OpenMPOpsEnums.h | 19 + mlir/include/mlir/Dialect/SCF/IR/SCFOps.td | 8 +- .../SCF/Transforms/TileUsingInterface.h | 22 +- mlir/include/mlir/Dialect/SMT/IR/SMTOps.td | 2 +- .../mlir/Dialect/SPIRV/IR/SPIRVBase.td | 34 +- .../SPIRV/IR/SPIRVCooperativeMatrixOps.td | 16 +- .../mlir/Dialect/SPIRV/IR/SPIRVTypes.h | 44 +- .../include/mlir/Dialect/Shape/IR/ShapeOps.td | 4 +- .../mlir/Dialect/Tensor/IR/TensorOps.td | 7 +- .../Dialect/Tensor/Transforms/Transforms.h | 14 +- mlir/include/mlir/Dialect/Tosa/IR/TargetEnv.h | 18 +- mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td | 13 +- .../mlir/Dialect/Tosa/Transforms/Passes.td | 14 + .../DebugExtension/DebugExtensionOps.td | 4 +- .../mlir/Dialect/Utils/ReshapeOpsUtils.h | 38 +- mlir/include/mlir/Dialect/Vector/IR/Vector.td | 5 +- .../mlir/Dialect/Vector/IR/VectorOps.td | 44 +- .../include/mlir/Dialect/XeGPU/IR/XeGPUOps.td | 132 +- .../mlir/Dialect/XeGPU/IR/XeGPUTargetInfo.h | 30 + .../mlir/Dialect/XeGPU/Utils/XeGPUUtils.h | 14 - .../mlir/ExecutionEngine/MemRefUtils.h | 8 +- mlir/include/mlir/IR/EnumAttr.td | 7 +- mlir/include/mlir/IR/Matchers.h | 2 +- mlir/include/mlir/IR/ODSSupport.h | 3 + mlir/include/mlir/IR/OpDefinition.h | 2 +- mlir/include/mlir/IR/OpImplementation.h | 3 + mlir/include/mlir/IR/PatternMatch.h | 5 +- mlir/include/mlir/IR/Unit.h | 2 +- mlir/include/mlir/IR/Visitors.h | 36 +- mlir/include/mlir/InitAllDialects.h | 4 +- .../mlir/Interfaces/InferTypeOpInterface.td | 5 +- .../mlir/Interfaces/TilingInterface.td | 55 +- mlir/include/mlir/Support/StateStack.h | 128 + mlir/include/mlir/Support/WalkResult.h | 59 + .../mlir/Target/LLVMIR/ModuleTranslation.h | 72 +- mlir/include/mlir/Tools/PDLL/AST/Nodes.h | 4 +- .../mlir/Transforms/DialectConversion.h | 13 +- mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp | 1 - mlir/lib/Analysis/DataFlow/SparseAnalysis.cpp | 1 - .../Analysis/FlatLinearValueConstraints.cpp | 2 - .../Analysis/Presburger/IntegerRelation.cpp | 12 +- mlir/lib/Analysis/Presburger/PWMAFunction.cpp | 2 +- mlir/lib/Analysis/Presburger/Simplex.cpp | 1 - mlir/lib/Analysis/Presburger/Utils.cpp | 1 - mlir/lib/Analysis/SliceAnalysis.cpp | 1 - mlir/lib/AsmParser/AttributeParser.cpp | 2 +- mlir/lib/Bindings/Python/IRAttributes.cpp | 2 +- mlir/lib/CAPI/Dialect/Linalg.cpp | 2 +- .../AMDGPUToROCDL/AMDGPUToROCDL.cpp | 79 +- .../AffineToStandard/AffineToStandard.cpp | 1 - .../Conversion/ArithToLLVM/ArithToLLVM.cpp | 1 - .../Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp | 1 - .../Conversion/AsyncToLLVM/AsyncToLLVM.cpp | 1 - .../BufferizationToMemRef.cpp | 3 +- .../ComplexToLLVM/ComplexToLLVM.cpp | 1 - .../ComplexToLibm/ComplexToLibm.cpp | 1 - .../ComplexToSPIRV/ComplexToSPIRV.cpp | 2 - .../ComplexToStandard/ComplexToStandard.cpp | 2 - .../ControlFlowToLLVM/ControlFlowToLLVM.cpp | 3 - .../ControlFlowToSCF/ControlFlowToSCF.cpp | 1 - .../ControlFlowToSPIRV/ControlFlowToSPIRV.cpp | 3 - .../ConvertToLLVM/ConvertToLLVMPass.cpp | 2 - mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp | 11 - .../Conversion/FuncToSPIRV/FuncToSPIRV.cpp | 3 - .../GPUCommon/GPUToLLVMConversion.cpp | 4 - .../GPUToNVVM/LowerGpuOpsToNVVMOps.cpp | 1 - .../GPUToROCDL/LowerGpuOpsToROCDLOps.cpp | 3 - mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp | 52 +- .../Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp | 1 - .../Conversion/GPUToSPIRV/WmmaOpsToSPIRV.cpp | 3 - .../Conversion/IndexToSPIRV/IndexToSPIRV.cpp | 1 - mlir/lib/Conversion/LLVMCommon/Pattern.cpp | 9 +- .../Conversion/LLVMCommon/TypeConverter.cpp | 1 - .../LinalgToStandard/LinalgToStandard.cpp | 1 - mlir/lib/Conversion/MathToLibm/MathToLibm.cpp | 1 - .../Conversion/MathToROCDL/MathToROCDL.cpp | 2 - .../Conversion/MathToSPIRV/MathToSPIRV.cpp | 2 - .../Conversion/MemRefToLLVM/MemRefToLLVM.cpp | 12 +- .../MemRefToSPIRV/MemRefToSPIRV.cpp | 1 - .../Conversion/OpenACCToSCF/OpenACCToSCF.cpp | 2 - .../Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp | 1 - .../PDLToPDLInterp/PDLToPDLInterp.cpp | 10 +- .../PDLToPDLInterp/PredicateTree.cpp | 3 - .../SCFToControlFlow/SCFToControlFlow.cpp | 2 - mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp | 3 - mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp | 1 - mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp | 6 - .../Conversion/SCFToOpenMP/SCFToOpenMP.cpp | 1 - mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp | 2 - .../Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp | 1 - .../ConvertLaunchFuncToLLVMCalls.cpp | 7 +- .../Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp | 3 - .../ConvertShapeConstraints.cpp | 2 - .../TensorToLinalg/TensorToLinalg.cpp | 3 - .../TensorToSPIRV/TensorToSPIRV.cpp | 3 - .../Conversion/TosaToArith/TosaToArith.cpp | 1 - .../TosaToArith/TosaToArithPass.cpp | 3 - .../Conversion/TosaToLinalg/TosaToLinalg.cpp | 18 +- .../TosaToLinalg/TosaToLinalgNamed.cpp | 8 - .../TosaToLinalg/TosaToLinalgNamedPass.cpp | 2 - .../TosaToLinalg/TosaToLinalgPass.cpp | 2 - .../TosaToMLProgram/TosaToMLProgramPass.cpp | 1 - mlir/lib/Conversion/TosaToSCF/TosaToSCF.cpp | 2 - .../Conversion/TosaToSCF/TosaToSCFPass.cpp | 2 - .../Conversion/TosaToTensor/TosaToTensor.cpp | 1 - .../TosaToTensor/TosaToTensorPass.cpp | 2 - .../Conversion/VectorToGPU/VectorToGPU.cpp | 4 - .../VectorToLLVM/ConvertVectorToLLVM.cpp | 35 +- .../VectorToLLVM/ConvertVectorToLLVMPass.cpp | 3 +- .../Conversion/VectorToSCF/VectorToSCF.cpp | 16 +- .../VectorToSPIRV/VectorToSPIRV.cpp | 49 +- .../VectorToSPIRV/VectorToSPIRVPass.cpp | 1 - .../VectorToXeGPU/VectorToXeGPU.cpp | 1 - mlir/lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp | 34 + .../Dialect/AMDGPU/Transforms/CMakeLists.txt | 2 +- .../AMDGPU/Transforms/MaskedloadToLoad.cpp | 167 + .../AMDGPU/Transforms/TransferReadToLoad.cpp | 239 - .../Affine/Analysis/AffineAnalysis.cpp | 4 +- .../Affine/Analysis/AffineStructures.cpp | 2 +- mlir/lib/Dialect/Affine/Analysis/Utils.cpp | 2 +- mlir/lib/Dialect/Affine/IR/AffineOps.cpp | 119 +- .../Dialect/Affine/Transforms/LoopFusion.cpp | 9 +- .../Dialect/Affine/Transforms/LoopTiling.cpp | 7 +- .../Transforms/PipelineDataTransfer.cpp | 17 +- .../Transforms/SimplifyAffineMinMax.cpp | 95 +- .../Affine/Transforms/SuperVectorize.cpp | 3 +- mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp | 22 +- mlir/lib/Dialect/Affine/Utils/Utils.cpp | 55 +- mlir/lib/Dialect/Arith/IR/ArithOps.cpp | 16 + .../BufferizableOpInterfaceImpl.cpp | 8 +- .../ArmNeonVectorTransformOps.cpp | 2 +- .../Dialect/ArmNeon/Transforms/CMakeLists.txt | 2 +- ... => LowerContractionToNeonI8MMPattern.cpp} | 178 +- .../ArmSME/Transforms/VectorLegalization.cpp | 171 +- .../Transforms/LegalizeForLLVMExport.cpp | 3 +- .../Transforms/LegalizeVectorStorage.cpp | 153 +- .../LowerContractionToSVEI8MMPattern.cpp | 7 +- mlir/lib/Dialect/Async/IR/Async.cpp | 2 +- .../Async/Transforms/AsyncToAsyncRuntime.cpp | 2 +- .../IR/BufferizableOpInterface.cpp | 27 +- .../Bufferization/IR/BufferizationOps.cpp | 5 +- .../FuncBufferizableOpInterfaceImpl.cpp | 15 +- mlir/lib/Dialect/EmitC/IR/EmitC.cpp | 45 +- .../Dialect/EmitC/Transforms/CMakeLists.txt | 1 + .../EmitC/Transforms/WrapFuncInClass.cpp | 112 + mlir/lib/Dialect/Func/IR/FuncOps.cpp | 2 +- mlir/lib/Dialect/GPU/IR/GPUDialect.cpp | 65 +- .../GPU/TransformOps/GPUTransformOps.cpp | 48 +- mlir/lib/Dialect/GPU/TransformOps/Utils.cpp | 175 +- .../GPU/Transforms/DecomposeMemRefs.cpp | 3 +- mlir/lib/Dialect/LLVMIR/CMakeLists.txt | 23 + mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp | 47 +- mlir/lib/Dialect/LLVMIR/IR/XeVMDialect.cpp | 366 + mlir/lib/Dialect/Linalg/IR/LinalgDialect.cpp | 8 - .../Dialect/Linalg/IR/LinalgInterfaces.cpp | 2 - mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp | 241 +- .../Linalg/IR/ValueBoundsOpInterfaceImpl.cpp | 1 - .../Linalg/TransformOps/DialectExtension.cpp | 2 - .../Linalg/TransformOps/LinalgMatchOps.cpp | 1 - .../TransformOps/LinalgTransformOps.cpp | 29 +- .../Linalg/Transforms/BlockPackMatmul.cpp | 1 - .../Transforms/BubbleUpExtractSlice.cpp | 3 - .../BufferizableOpInterfaceImpl.cpp | 2 - .../Linalg/Transforms/ConstantFold.cpp | 2 - .../Transforms/ConvertConv2DToImg2Col.cpp | 1 - .../Transforms/ConvertToDestinationStyle.cpp | 2 - .../Transforms/DataLayoutPropagation.cpp | 37 +- ...DecomposeGenericByUnfoldingPermutation.cpp | 2 - .../Dialect/Linalg/Transforms/Detensorize.cpp | 3 - .../Linalg/Transforms/DropUnitDims.cpp | 3 - .../Linalg/Transforms/ElementwiseToLinalg.cpp | 1 - .../Transforms/EliminateEmptyTensors.cpp | 1 - .../Linalg/Transforms/FoldIntoElementwise.cpp | 1 - .../FusePadOpWithLinalgProducer.cpp | 1 - mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp | 11 - .../Linalg/Transforms/Generalization.cpp | 5 - .../Linalg/Transforms/HoistPadding.cpp | 1 - .../Dialect/Linalg/Transforms/Hoisting.cpp | 52 +- .../Dialect/Linalg/Transforms/Interchange.cpp | 5 - mlir/lib/Dialect/Linalg/Transforms/Loops.cpp | 1 - .../Transforms/MeshShardingInterfaceImpl.cpp | 3 - .../Transforms/PackAndUnpackPatterns.cpp | 84 +- .../Linalg/Transforms/PadTilingInterface.cpp | 5 +- .../Dialect/Linalg/Transforms/Promotion.cpp | 17 +- .../Dialect/Linalg/Transforms/Specialize.cpp | 2 - mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp | 6 - .../Linalg/Transforms/TilingInterfaceImpl.cpp | 191 +- .../Dialect/Linalg/Transforms/Transforms.cpp | 36 +- .../Linalg/Transforms/TransposeConv2D.cpp | 6 - .../Linalg/Transforms/TransposeMatmul.cpp | 5 +- .../Linalg/Transforms/Vectorization.cpp | 169 +- .../Linalg/Transforms/WinogradConv2D.cpp | 153 +- mlir/lib/Dialect/Linalg/Utils/Utils.cpp | 3 - mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp | 49 +- .../Dialect/MemRef/Transforms/CMakeLists.txt | 1 + .../MemRef/Transforms/NormalizeMemRefs.cpp | 9 +- .../MemRef/Transforms/ReifyResultShapes.cpp | 159 + .../Mesh/Transforms/ShardingPropagation.cpp | 4 +- mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp | 220 +- mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp | 20 + mlir/lib/Dialect/SCF/IR/SCF.cpp | 2 +- .../BufferizableOpInterfaceImpl.cpp | 61 +- .../Dialect/SCF/Transforms/LoopPipelining.cpp | 29 +- .../SCF/Transforms/TileUsingInterface.cpp | 216 +- mlir/lib/Dialect/SCF/Utils/Utils.cpp | 15 +- .../Dialect/SPIRV/IR/CooperativeMatrixOps.cpp | 28 +- mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp | 75 +- mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp | 6 + mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp | 113 +- .../Transforms/LowerABIAttributesPass.cpp | 4 +- mlir/lib/Dialect/Shape/IR/Shape.cpp | 2 +- .../Transforms/SparseTensorConversion.cpp | 2 +- .../Transforms/Utils/IterationGraphSorter.cpp | 4 +- .../Transforms/Utils/LoopEmitter.cpp | 2 +- mlir/lib/Dialect/Tensor/IR/TensorOps.cpp | 29 +- .../BufferizableOpInterfaceImpl.cpp | 52 +- .../SwapExtractSliceWithProducerPatterns.cpp | 57 +- .../Dialect/Tosa/IR/TosaCanonicalizations.cpp | 10 +- mlir/lib/Dialect/Tosa/IR/TosaOps.cpp | 6 +- .../Dialect/Tosa/Transforms/CMakeLists.txt | 1 + .../TosaConvertIntegerTypeToSignless.cpp | 139 + .../Tosa/Transforms/TosaMakeBroadcastable.cpp | 6 +- .../Tosa/Transforms/TosaProfileCompliance.cpp | 4 +- .../Tosa/Transforms/TosaReduceTransposes.cpp | 3 +- .../Tosa/Transforms/TosaValidation.cpp | 9 +- .../DebugExtension/DebugExtensionOps.cpp | 13 +- .../lib/Dialect/Transform/IR/TransformOps.cpp | 9 +- mlir/lib/Dialect/Utils/CMakeLists.txt | 1 + mlir/lib/Dialect/Vector/IR/VectorOps.cpp | 138 +- .../Vector/Transforms/VectorDistribute.cpp | 227 +- .../Transforms/VectorTransferOpTransforms.cpp | 3 +- mlir/lib/Dialect/Vector/Utils/VectorUtils.cpp | 3 +- mlir/lib/Dialect/XeGPU/IR/XeGPUDialect.cpp | 35 +- mlir/lib/Dialect/XeGPU/IR/XeGPUOps.cpp | 33 +- .../XeGPU/Transforms/XeGPUPropagateLayout.cpp | 71 +- .../Transforms/XeGPUSubgroupDistribute.cpp | 35 +- .../Dialect/XeGPU/Transforms/XeGPUUnroll.cpp | 65 +- .../Transforms/XeGPUWgToSgDistribute.cpp | 14 +- mlir/lib/IR/AffineExpr.cpp | 50 +- mlir/lib/IR/AffineMap.cpp | 4 - mlir/lib/IR/AsmPrinter.cpp | 17 +- mlir/lib/IR/Block.cpp | 2 - mlir/lib/IR/Builders.cpp | 3 - mlir/lib/IR/BuiltinAttributes.cpp | 2 - mlir/lib/IR/BuiltinDialect.cpp | 2 - mlir/lib/IR/BuiltinTypeInterfaces.cpp | 2 - mlir/lib/IR/BuiltinTypes.cpp | 2 - mlir/lib/IR/Diagnostics.cpp | 2 +- mlir/lib/IR/Dialect.cpp | 3 - mlir/lib/IR/Dominance.cpp | 1 - mlir/lib/IR/MLIRContext.cpp | 4 - mlir/lib/IR/ODSSupport.cpp | 5 + mlir/lib/IR/Operation.cpp | 18 +- mlir/lib/IR/OperationSupport.cpp | 1 - mlir/lib/IR/TypeRange.cpp | 1 - mlir/lib/IR/Unit.cpp | 1 - mlir/lib/Pass/Pass.cpp | 2 +- mlir/lib/Query/Matcher/VariantValue.cpp | 4 +- mlir/lib/Reducer/Tester.cpp | 2 +- mlir/lib/Support/CMakeLists.txt | 1 + .../lib/Support/StateStack.cpp | 12 +- mlir/lib/TableGen/Argument.cpp | 1 - mlir/lib/TableGen/Attribute.cpp | 1 - mlir/lib/TableGen/Class.cpp | 2 - mlir/lib/TableGen/Interfaces.cpp | 2 - mlir/lib/TableGen/Operator.cpp | 2 - mlir/lib/TableGen/Predicate.cpp | 1 - mlir/lib/TableGen/Property.cpp | 1 - mlir/lib/TableGen/Trait.cpp | 2 - mlir/lib/Target/Cpp/TranslateToCpp.cpp | 61 +- mlir/lib/Target/LLVM/ModuleToObject.cpp | 3 - mlir/lib/Target/LLVM/NVVM/Target.cpp | 3 - mlir/lib/Target/LLVM/ROCDL/Utils.cpp | 1 - mlir/lib/Target/LLVMIR/DataLayoutImporter.cpp | 1 - mlir/lib/Target/LLVMIR/DebugImporter.cpp | 4 - mlir/lib/Target/LLVMIR/DebugTranslation.cpp | 4 +- .../LLVMIR/LLVMIRToLLVMTranslation.cpp | 4 - .../LLVMIR/LLVMToLLVMIRTranslation.cpp | 1 - .../Dialect/NVVM/LLVMIRToNVVMTranslation.cpp | 1 - .../Dialect/NVVM/NVVMToLLVMIRTranslation.cpp | 1 - .../OpenACC/OpenACCToLLVMIRTranslation.cpp | 2 - .../OpenMP/OpenMPToLLVMIRTranslation.cpp | 58 +- .../SPIRV/SPIRVToLLVMIRTranslation.cpp | 2 - .../Dialect/VCIX/VCIXToLLVMIRTranslation.cpp | 1 - .../lib/Target/LLVMIR/LLVMImportInterface.cpp | 1 - .../LLVMIR/LoopAnnotationTranslation.cpp | 2 +- mlir/lib/Target/LLVMIR/ModuleImport.cpp | 1 - mlir/lib/Target/LLVMIR/ModuleTranslation.cpp | 22 +- mlir/lib/Target/LLVMIR/TypeToLLVM.cpp | 1 - mlir/lib/Target/SMTLIB/ExportSMTLIB.cpp | 1 - .../SPIRV/Deserialization/DeserializeOps.cpp | 1 + .../SPIRV/Deserialization/Deserializer.cpp | 51 + .../SPIRV/Deserialization/Deserializer.h | 2 + mlir/lib/Target/SPIRV/SPIRVBinaryUtils.cpp | 1 - .../SPIRV/Serialization/Serialization.cpp | 1 - .../Target/SPIRV/Serialization/Serializer.cpp | 48 + .../Target/SPIRV/TranslateRegistration.cpp | 4 - mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp | 5 +- mlir/lib/Tools/PDLL/Parser/Parser.cpp | 9 +- .../Transforms/LoopInvariantCodeMotion.cpp | 1 - mlir/lib/Transforms/RemoveDeadValues.cpp | 2 - mlir/lib/Transforms/StripDebugInfo.cpp | 1 - mlir/lib/Transforms/SymbolDCE.cpp | 49 +- mlir/lib/Transforms/Utils/CFGToSCF.cpp | 2 - .../Transforms/Utils/DialectConversion.cpp | 190 +- .../Utils/GreedyPatternRewriteDriver.cpp | 2 - mlir/lib/Transforms/Utils/Inliner.cpp | 4 +- mlir/lib/Transforms/Utils/InliningUtils.cpp | 1 - mlir/lib/Transforms/Utils/RegionUtils.cpp | 3 - mlir/lib/Transforms/ViewOpGraph.cpp | 1 - mlir/python/CMakeLists.txt | 9 + .../dialects/TransformDebugExtensionOps.td | 19 + .../linalg/opdsl/ops/core_named_ops.py | 31 - mlir/python/mlir/dialects/transform/debug.py | 81 + .../AMDGPUToROCDL/transpose_load.mlir | 56 + .../AMDGPUToROCDL/transpose_load_reject.mlir | 17 + mlir/test/Conversion/GPUToSPIRV/rotate.mlir | 102 + .../vector-to-llvm-interface.mlir | 40 +- .../VectorToSPIRV/vector-to-spirv.mlir | 35 + mlir/test/Dialect/AMDGPU/invalid.mlir | 56 + ...d-to-load.mlir => maskedload-to-load.mlir} | 78 +- mlir/test/Dialect/AMDGPU/ops.mlir | 7 + .../Affine/SuperVectorize/vectorize_1d.mlir | 12 +- .../vectorize_affine_apply.mlir | 6 +- .../test/Dialect/Affine/affine-data-copy.mlir | 48 + .../Dialect/Affine/decompose-affine-ops.mlir | 18 +- mlir/test/Dialect/Affine/loop-fusion-4.mlir | 77 + .../Dialect/Affine/simplify-min-max-ops.mlir | 60 + .../Dialect/Affine/simplify-structures.mlir | 4 +- .../transform-op-simplify-min-max-ops.mlir | 2 +- mlir/test/Dialect/ArmNeon/invalid.mlir | 60 + .../Dialect/ArmNeon/lower-to-arm-neon.mlir | 80 +- mlir/test/Dialect/ArmNeon/roundtrip.mlir | 12 + .../Dialect/ArmSME/vector-legalization.mlir | 101 +- mlir/test/Dialect/ArmSVE/invalid.mlir | 60 + .../ArmSVE/legalize-transfer-read.mlir | 257 + mlir/test/Dialect/ArmSVE/roundtrip.mlir | 10 + .../Transforms/one-shot-bufferize.mlir | 23 +- .../EmitC/wrap_emitc_func_in_class.mlir | 40 + .../wrap_emitc_func_in_class_noAttr.mlir | 17 + mlir/test/Dialect/GPU/invalid.mlir | 78 + mlir/test/Dialect/GPU/ops.mlir | 4 + mlir/test/Dialect/GPU/transform-gpu.mlir | 64 + mlir/test/Dialect/LLVMIR/invalid.mlir | 45 +- mlir/test/Dialect/LLVMIR/xevm.mlir | 95 + .../Linalg/data-layout-propagation.mlir | 52 +- mlir/test/Dialect/Linalg/decompose-pack.mlir | 45 + .../test/Dialect/Linalg/decompose-unpack.mlir | 34 + .../generalize-named-polymorphic-ops.mlir | 111 - mlir/test/Dialect/Linalg/hoisting.mlir | 495 +- mlir/test/Dialect/Linalg/invalid.mlir | 74 +- mlir/test/Dialect/Linalg/library-calls.mlir | 40 - .../Dialect/Linalg/match-ops-interpreter.mlir | 6 +- mlir/test/Dialect/Linalg/named-ops.mlir | 95 + .../Linalg/one-shot-bufferize-analysis.mlir | 38 - mlir/test/Dialect/Linalg/pad_fusion.mlir | 6 +- .../Dialect/Linalg/promotion_options.mlir | 56 + .../resolve-shaped-type-result-dims.mlir | 4 +- mlir/test/Dialect/Linalg/roundtrip.mlir | 24 +- .../transform-op-bufferize-to-allocation.mlir | 2 +- .../transform-op-fuse-into-containing.mlir | 43 +- .../Dialect/Linalg/transform-op-fuse.mlir | 72 +- .../Linalg/transform-op-generalize.mlir | 4 +- ...-rewrite-in-destination-passing-style.mlir | 6 +- .../transform-tile-and-winograd-rewrite.mlir | 24 +- .../Linalg/transform-tile-winograd.mlir | 36 +- .../Linalg/transform-winograd-conv2d.mlir | 24 +- .../vectorization/extract-with-patterns.mlir | 39 +- .../Dialect/Linalg/vectorization/extract.mlir | 6 +- .../linalg-ops-with-patterns.mlir | 14 +- .../Linalg/vectorization/linalg-ops.mlir | 74 +- .../Linalg/winograd-conv2d-rewrite.mlir | 6 +- mlir/test/Dialect/Linalg/winograd-conv2d.mlir | 42 +- mlir/test/Dialect/MemRef/canonicalize.mlir | 39 + mlir/test/Dialect/MemRef/invalid.mlir | 16 +- mlir/test/Dialect/MemRef/ops.mlir | 3 + mlir/test/Dialect/OpenACC/invalid.mlir | 12 + mlir/test/Dialect/OpenACC/ops.mlir | 25 + mlir/test/Dialect/OpenMP/invalid.mlir | 33 + mlir/test/Dialect/SCF/canonicalize.mlir | 8 +- mlir/test/Dialect/SCF/loop-pipelining.mlir | 36 + .../SPIRV/IR/khr-cooperative-matrix-ops.mlir | 34 +- mlir/test/Dialect/SPIRV/IR/types.mlir | 51 + .../SparseTensor/sparse_vector_peeled.mlir | 2 +- mlir/test/Dialect/Tensor/bufferize.mlir | 17 +- mlir/test/Dialect/Tensor/canonicalize.mlir | 29 + .../Tensor/fold-into-pack-and-unpack.mlir | 61 + mlir/test/Dialect/Tensor/invalid.mlir | 7 +- mlir/test/Dialect/Tensor/ops.mlir | 12 +- mlir/test/Dialect/Tensor/reify-shapes.mlir | 31 + .../value-bounds-op-interface-impl.mlir | 17 + mlir/test/Dialect/Tosa/invalid.mlir | 2 + ...tosa-convert-integer-type-to-signless.mlir | 73 + .../Dialect/Tosa/tosa-validation-valid.mlir | 31 + mlir/test/Dialect/Vector/canonicalize.mlir | 67 +- .../Vector/canonicalize/vector-transpose.mlir | 64 +- mlir/test/Dialect/Vector/invalid.mlir | 47 +- mlir/test/Dialect/Vector/ops.mlir | 23 +- .../Dialect/Vector/vector-mem-transforms.mlir | 4 +- .../Vector/vector-transfer-flatten.mlir | 24 +- .../Vector/vector-warp-distribute.mlir | 84 +- mlir/test/Dialect/XeGPU/invalid.mlir | 2 +- mlir/test/Dialect/XeGPU/ops.mlir | 32 +- mlir/test/Dialect/XeGPU/propagate-layout.mlir | 27 +- .../Dialect/XeGPU/subgroup-distribute.mlir | 19 + mlir/test/Dialect/XeGPU/xegpu-blocking.mlir | 46 +- .../Dialect/XeGPU/xegpu-unroll-patterns.mlir | 56 +- .../XeGPU/xegpu-wg-to-sg-elemwise.mlir | 19 + .../transform/Ch1/invalidation-1.mlir | 22 +- .../transform/Ch1/invalidation-2.mlir | 14 +- .../test/Examples/transform/Ch1/sequence.mlir | 20 +- .../test/Examples/transform/Ch2/sequence.mlir | 18 +- .../test/Examples/transform/Ch3/sequence.mlir | 18 +- .../test/Examples/transform/Ch4/multiple.mlir | 20 +- .../test/Examples/transform/Ch4/sequence.mlir | 14 +- mlir/test/IR/affine-map.mlir | 2 +- mlir/test/IR/attribute.mlir | 4 + mlir/test/IR/properties.mlir | 6 +- mlir/test/IR/region.mlir | 7 + .../Dialect/Transform/match_matmul.mlir | 2 +- .../CPU/ArmNeon/vector-contract-i8mm.mlir | 336 + .../transfer-read-scalable-non-trailing.mlir | 79 + .../tile-and-fuse-consumer.mlir | 301 +- .../Target/LLVMIR/Import/import-failure.ll | 16 - mlir/test/Target/LLVMIR/arm-neon.mlir | 13 + mlir/test/Target/LLVMIR/arm-sve.mlir | 12 + mlir/test/Target/LLVMIR/nvvm/elect.mlir | 20 + mlir/test/Target/LLVMIR/nvvmir.mlir | 9 - .../Target/LLVMIR/omptarget-debug-empty.mlir | 27 + .../LLVMIR/omptarget-debug-loop-loc.mlir | 4 +- .../LLVMIR/omptarget-debug-map-link-loc.mlir | 43 + .../Target/LLVMIR/omptarget-debug-nowait.mlir | 5 +- .../Target/LLVMIR/omptarget-debug-var-1.mlir | 13 +- .../Target/LLVMIR/omptarget-debug-var-2.mlir | 13 +- mlir/test/Target/LLVMIR/omptarget-debug.mlir | 8 +- mlir/test/Target/LLVMIR/omptarget-debug2.mlir | 8 +- mlir/test/Target/LLVMIR/omptarget-llvm.mlir | 348 +- .../LLVMIR/omptarget-parallel-llvm-debug.mlir | 8 +- .../LLVMIR/omptarget-parallel-llvm.mlir | 2 +- mlir/test/Target/LLVMIR/omptarget-wsloop.mlir | 2 +- .../LLVMIR/omptargetdata-nowait-llvm.mlir | 42 +- .../LLVMIR/openmp-data-target-device.mlir | 2 +- .../openmp-nested-task-target-parallel.mlir | 62 + mlir/test/Target/LLVMIR/openmp-todo.mlir | 4 +- mlir/test/Target/SPIRV/image-ops.mlir | 2 +- .../SPIRV/khr-cooperative-matrix-ops.mlir | 14 + mlir/test/Target/SPIRV/tensorARM.mlir | 66 + .../make-composed-folded-affine-apply.mlir | 77 + mlir/test/Transforms/test-legalizer.mlir | 16 +- mlir/test/Transforms/test-symbol-dce.mlir | 35 + .../FuncToLLVM/TestConvertCallOp.cpp | 2 +- .../Dialect/Linalg/TestLinalgTransforms.cpp | 28 +- mlir/test/lib/Dialect/Test/TestEnumDefs.td | 8 +- .../test/lib/Dialect/Test/TestFormatUtils.cpp | 23 + mlir/test/lib/Dialect/Test/TestFormatUtils.h | 18 + mlir/test/lib/Dialect/Test/TestOpDefs.cpp | 34 + mlir/test/lib/Dialect/Test/TestOps.td | 90 +- mlir/test/lib/Dialect/Test/TestPatterns.cpp | 4 +- .../TestTilingInterfaceTransformOps.cpp | 50 +- .../TestTilingInterfaceTransformOps.td | 7 +- .../test/lib/Transforms/TestTransformsOps.cpp | 31 +- mlir/test/lib/Transforms/TestTransformsOps.td | 27 + .../test-linalg-ods-yaml-gen.yaml | 25 +- mlir/test/mlir-tblgen/op-decl-and-defs.td | 1 + mlir/test/mlir-tblgen/op-format-spec.td | 19 +- mlir/test/mlir-tblgen/op-format.mlir | 10 +- mlir/test/mlir-tblgen/op-format.td | 20 + mlir/test/mlir-tblgen/op-operand.td | 11 + mlir/test/mlir-translate/emitc_classops.mlir | 51 + mlir/test/python/dialects/linalg/ops.py | 36 - .../python/dialects/transform_debug_ext.py | 45 + .../integration/dialects/linalg/opsrun.py | 121 - .../mlir-linalg-ods-yaml-gen.cpp | 17 +- mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp | 8 +- mlir/tools/mlir-tblgen/EnumsGen.cpp | 6 +- mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp | 11 + mlir/tools/mlir-tblgen/OpFormatGen.cpp | 41 +- .../FileLineColLocBreakpointManagerTest.cpp | 6 +- .../Dialect/SPIRV/DeserializationTest.cpp | 6 +- mlir/unittests/IR/AffineExprTest.cpp | 23 + mlir/unittests/IR/OperationSupportTest.cpp | 29 +- mlir/unittests/IR/ValueTest.cpp | 12 +- mlir/unittests/Pass/AnalysisManagerTest.cpp | 10 +- mlir/unittests/Pass/PassManagerTest.cpp | 10 +- .../Transforms/DialectConversion.cpp | 6 +- offload/DeviceRTL/CMakeLists.txt | 2 +- offload/cmake/caches/AMDGPULibcBot.cmake | 1 + offload/liboffload/API/Common.td | 15 +- offload/liboffload/API/Device.td | 3 +- offload/liboffload/API/Program.td | 4 +- offload/liboffload/API/README.md | 105 +- offload/liboffload/README.md | 38 +- offload/liboffload/src/Helpers.hpp | 54 +- offload/liboffload/src/OffloadImpl.cpp | 229 +- offload/libomptarget/OpenMP/Mapping.cpp | 24 + offload/plugins-nextgen/amdgpu/src/rtl.cpp | 26 +- offload/plugins-nextgen/common/CMakeLists.txt | 2 +- .../common/include/PluginInterface.h | 16 +- .../common/src/PluginInterface.cpp | 87 +- offload/plugins-nextgen/cuda/src/rtl.cpp | 31 +- offload/plugins-nextgen/host/src/rtl.cpp | 6 + offload/test/mapping/duplicate_mappings_1.cpp | 27 + offload/test/mapping/duplicate_mappings_2.cpp | 29 + .../test/offloading/disable_default_device.c | 22 + offload/test/ompTest/CMakeLists.txt | 2 +- offload/test/ompTest/include/AssertMacros.h | 13 + offload/test/ompTest/include/Logging.h | 24 +- .../test/ompTest/include/OmptAssertEvent.h | 2 +- offload/test/ompTest/include/OmptAsserter.h | 126 +- .../ompTest/include/OmptTesterGoogleTest.h | 15 +- .../ompTest/include/OmptTesterStandalone.h | 15 +- .../ompTest/src/InternalEventOperators.cpp | 6 +- offload/test/ompTest/src/Logging.cpp | 37 +- offload/test/ompTest/src/OmptAsserter.cpp | 157 +- offload/test/ompTest/src/OmptTester.cpp | 8 - .../test/ompTest/src/OmptTesterStandalone.cpp | 4 +- .../test/ompTest/test/asserter-seq-test.cpp | 358 + offload/tools/offload-tblgen/APIGen.cpp | 3 +- offload/tools/offload-tblgen/MiscGen.cpp | 2 +- offload/tools/offload-tblgen/PrintGen.cpp | 5 + offload/tools/offload-tblgen/RecordTypes.hpp | 12 +- offload/unittests/CMakeLists.txt | 31 +- offload/unittests/Conformance/CMakeLists.txt | 8 + .../Conformance/device_code/CMakeLists.txt | 4 + .../unittests/Conformance/device_code/sin.c | 4 + offload/unittests/Conformance/sin.cpp | 8 + .../OffloadAPI/device/olGetDeviceInfo.cpp | 9 + .../OffloadAPI/device/olGetDeviceInfoSize.cpp | 8 + .../OffloadAPI/device_code/CMakeLists.txt | 12 +- .../OffloadAPI/device_code/localmem.c | 11 + .../device_code/localmem_reduction.c | 16 + .../OffloadAPI/device_code/localmem_static.c | 17 + offload/unittests/OffloadAPI/init/olInit.cpp | 12 + .../OffloadAPI/kernel/olLaunchKernel.cpp | 101 +- openmp/CMakeLists.txt | 4 + openmp/runtime/openmp-config.cmake.in | 11 +- openmp/runtime/src/CMakeLists.txt | 10 +- openmp/runtime/src/kmp_alloc.cpp | 8 +- openmp/runtime/src/kmp_csupport.cpp | 2 +- openmp/runtime/src/kmp_lock.cpp | 2 + openmp/runtime/src/kmp_tasking.cpp | 2 +- .../test/ompt/misc/lock_double_destroy.cpp | 43 + openmp/runtime/tools/message-converter.py | 4 +- pstl/.clang-format | 20 - pstl/CMakeLists.txt | 103 - pstl/CREDITS.txt | 21 - pstl/LICENSE.TXT | 307 - pstl/README.md | 35 - pstl/cmake/ParallelSTLConfig.cmake.in | 19 - pstl/docs/ReleaseNotes.rst | 40 - pstl/include/__pstl_algorithm | 15 - pstl/include/__pstl_config_site.in | 17 - pstl/include/__pstl_execution | 15 - pstl/include/__pstl_numeric | 15 - pstl/include/pstl/internal/algorithm_fwd.h | 1202 --- pstl/include/pstl/internal/algorithm_impl.h | 3819 ---------- pstl/include/pstl/internal/execution_defs.h | 100 - pstl/include/pstl/internal/execution_impl.h | 105 - .../pstl/internal/glue_algorithm_defs.h | 558 -- .../pstl/internal/glue_algorithm_impl.h | 1108 --- .../pstl/internal/glue_execution_defs.h | 55 - pstl/include/pstl/internal/glue_memory_defs.h | 85 - pstl/include/pstl/internal/glue_memory_impl.h | 352 - .../include/pstl/internal/glue_numeric_defs.h | 124 - .../include/pstl/internal/glue_numeric_impl.h | 232 - pstl/include/pstl/internal/memory_impl.h | 112 - pstl/include/pstl/internal/numeric_fwd.h | 139 - pstl/include/pstl/internal/numeric_impl.h | 383 - pstl/include/pstl/internal/omp/parallel_for.h | 64 - .../pstl/internal/omp/parallel_for_each.h | 59 - .../pstl/internal/omp/parallel_invoke.h | 50 - .../pstl/internal/omp/parallel_merge.h | 98 - .../pstl/internal/omp/parallel_reduce.h | 73 - .../include/pstl/internal/omp/parallel_scan.h | 136 - .../omp/parallel_stable_partial_sort.h | 33 - .../pstl/internal/omp/parallel_stable_sort.h | 160 - .../internal/omp/parallel_transform_reduce.h | 113 - .../internal/omp/parallel_transform_scan.h | 32 - pstl/include/pstl/internal/omp/util.h | 173 - pstl/include/pstl/internal/parallel_backend.h | 37 - .../pstl/internal/parallel_backend_omp.h | 58 - .../pstl/internal/parallel_backend_serial.h | 137 - .../pstl/internal/parallel_backend_tbb.h | 1296 ---- .../pstl/internal/parallel_backend_utils.h | 263 - pstl/include/pstl/internal/parallel_impl.h | 90 - pstl/include/pstl/internal/pstl_config.h | 204 - .../pstl/internal/unseq_backend_simd.h | 862 --- pstl/include/pstl/internal/utils.h | 177 - pstl/test/CMakeLists.txt | 41 - ...eader_inclusion_order_algorithm_0.pass.cpp | 21 - ...eader_inclusion_order_algorithm_1.pass.cpp | 21 - .../header_inclusion_order_memory_0.pass.cpp | 21 - .../header_inclusion_order_memory_1.pass.cpp | 21 - .../header_inclusion_order_numeric_0.pass.cpp | 21 - .../header_inclusion_order_numeric_1.pass.cpp | 21 - pstl/test/pstl/version.pass.cpp | 20 - .../alg.merge/inplace_merge.pass.cpp | 159 - .../std/algorithms/alg.merge/merge.pass.cpp | 113 - .../alg.copy/copy_if.pass.cpp | 147 - .../alg.partitions/is_partitioned.pass.cpp | 101 - .../alg.partitions/partition.pass.cpp | 178 - .../alg.partitions/partition_copy.pass.cpp | 116 - .../alg.reverse/reverse.pass.cpp | 104 - .../alg.reverse/reverse_copy.pass.cpp | 130 - .../copy_move.pass.cpp | 197 - .../alg.modifying.operations/fill.pass.cpp | 100 - .../generate.pass.cpp | 104 - .../alg.modifying.operations/remove.pass.cpp | 161 - .../remove_copy.pass.cpp | 91 - .../alg.modifying.operations/replace.pass.cpp | 160 - .../replace_copy.pass.cpp | 105 - .../alg.modifying.operations/rotate.pass.cpp | 176 - .../rotate_copy.pass.cpp | 146 - .../swap_ranges.pass.cpp | 133 - .../transform_binary.pass.cpp | 122 - .../transform_unary.pass.cpp | 91 - .../alg.modifying.operations/unique.pass.cpp | 163 - .../unique_copy_equal.pass.cpp | 135 - .../alg.nonmodifying/adjacent_find.pass.cpp | 114 - .../alg.nonmodifying/all_of.pass.cpp | 117 - .../alg.nonmodifying/any_of.pass.cpp | 103 - .../alg.nonmodifying/count.pass.cpp | 108 - .../alg.nonmodifying/equal.pass.cpp | 168 - .../algorithms/alg.nonmodifying/find.pass.cpp | 96 - .../alg.nonmodifying/find_end.pass.cpp | 123 - .../alg.nonmodifying/find_first_of.pass.cpp | 112 - .../alg.nonmodifying/find_if.pass.cpp | 109 - .../alg.nonmodifying/for_each.pass.cpp | 102 - .../alg.nonmodifying/mismatch.pass.cpp | 132 - .../alg.nonmodifying/none_of.pass.cpp | 101 - .../alg.nonmodifying/nth_element.pass.cpp | 175 - .../alg.nonmodifying/search_n.pass.cpp | 109 - .../alg.heap.operations/is_heap.pass.cpp | 146 - .../lexicographical_compare.pass.cpp | 175 - .../alg.min.max/minmax_element.pass.cpp | 192 - .../alg.set.operations/includes.pass.cpp | 106 - .../alg.set.operations/set.pass.cpp | 280 - .../algorithms/alg.sorting/is_sorted.pass.cpp | 100 - .../alg.sorting/partial_sort.pass.cpp | 149 - .../alg.sorting/partial_sort_copy.pass.cpp | 196 - .../std/algorithms/alg.sorting/sort.pass.cpp | 247 - pstl/test/std/lit.local.cfg | 2 - .../numeric.ops/adjacent_difference.pass.cpp | 170 - .../std/numerics/numeric.ops/reduce.pass.cpp | 114 - .../std/numerics/numeric.ops/scan.fail.cpp | 28 - .../std/numerics/numeric.ops/scan.pass.cpp | 201 - .../numeric.ops/transform_reduce.pass.cpp | 129 - .../numeric.ops/transform_scan.pass.cpp | 177 - .../uninitialized_construct.pass.cpp | 123 - .../uninitialized_copy_move.pass.cpp | 143 - .../uninitialized_fill_destroy.pass.cpp | 93 - pstl/test/support/pstl_test_config.h | 52 - pstl/test/support/stdlib/algorithm | 26 - pstl/test/support/stdlib/execution | 50 - pstl/test/support/stdlib/memory | 26 - pstl/test/support/stdlib/numeric | 26 - pstl/test/support/utils.h | 1318 ---- third-party/unittest/googletest/src/gtest.cc | 1 + utils/bazel/WORKSPACE | 9 + .../llvm-project-overlay/clang/BUILD.bazel | 5 + .../llvm-project-overlay/libc/BUILD.bazel | 336 + .../libc/libc_build_rules.bzl | 30 + .../libc/test/UnitTest/BUILD.bazel | 3 + .../libc/test/include/BUILD.bazel | 362 + .../libc/test/libc_test_rules.bzl | 46 +- .../libc/test/src/wchar/BUILD.bazel | 224 + .../llvm-project-overlay/lldb/BUILD.bazel | 2 + .../lldb/source/Plugins/BUILD.bazel | 1 + .../llvm-project-overlay/llvm/BUILD.bazel | 19 +- .../llvm-project-overlay/llvm/config.bzl | 1 + .../llvm/include/llvm/Config/llvm-config.h | 3 + .../llvm-project-overlay/mlir/BUILD.bazel | 79 +- .../mlir/python/BUILD.bazel | 26 + .../mlir/test/BUILD.bazel | 1 + utils/bazel/llvm_configs/llvm-config.h.cmake | 3 + utils/bazel/third_party_build/pyyaml.BUILD | 16 + 5577 files changed, 198669 insertions(+), 119665 deletions(-) create mode 100644 .github/copilot-instructions.md rename amd/comgr/test-lit/comgr-sources/{compile-minimal-test.c => compile-opencl-minimal.c} (92%) create mode 100644 amd/comgr/test-lit/comgr-sources/data-action.c create mode 100644 amd/comgr/test-lit/comgr-sources/get-version.c create mode 100644 amd/comgr/test-lit/comgr-sources/status-string.c create mode 100644 amd/comgr/test-lit/compile-opencl-2.cl create mode 100644 amd/comgr/test-lit/data-action.c create mode 100644 amd/comgr/test-lit/get-version.c create mode 100644 amd/comgr/test-lit/status-string.c delete mode 100644 amd/comgr/test/options_test.c create mode 100644 bolt/test/X86/zero-density.s create mode 100644 bolt/test/binary-analysis/AArch64/gs-pauth-tail-calls.s create mode 100644 bolt/test/code-at-high-address.c create mode 100644 bolt/test/program-header.test create mode 100644 clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.cpp create mode 100644 clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.h create mode 100644 clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst create mode 100644 clang-tools-extra/test/clang-doc/json/nested-namespace.cpp create mode 100644 clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/mutex create mode 100644 clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/missing-std-forward-custom-function.cpp create mode 100644 clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/rvalue-reference-param-not-moved-custom-function.cpp create mode 100644 clang-tools-extra/test/clang-tidy/checkers/modernize/use-scope-lock-warn-on-using-and-typedef-false.cpp create mode 100644 clang-tools-extra/test/clang-tidy/checkers/modernize/use-scoped-lock-warn-on-single-locks-false.cpp create mode 100644 clang-tools-extra/test/clang-tidy/checkers/modernize/use-scoped-lock.cpp create mode 100644 clang/docs/coro-async-task-continuations.png create mode 100644 clang/docs/coro-generator-suspended.png create mode 100644 clang/docs/coro-generator-variables.png delete mode 100644 clang/include/clang/CIR/Interfaces/CIRFPTypeInterface.td rename clang/include/clang/CIR/Interfaces/{CIRFPTypeInterface.h => CIRTypeInterfaces.h} (62%) create mode 100644 clang/include/clang/CIR/Interfaces/CIRTypeInterfaces.td create mode 100644 clang/include/clang/Interpreter/RemoteJITUtils.h create mode 100644 clang/lib/CIR/CodeGen/CIRGenOpenACC.cpp rename clang/lib/CIR/Interfaces/{CIRFPTypeInterface.cpp => CIRTypeInterfaces.cpp} (73%) delete mode 100644 clang/lib/Driver/ToolChains/RISCVToolchain.cpp delete mode 100644 clang/lib/Driver/ToolChains/RISCVToolchain.h create mode 100644 clang/lib/Interpreter/RemoteJITUtils.cpp create mode 100644 clang/test/AST/ByteCode/libcxx/rvalue-reference-param.cpp create mode 100644 clang/test/AST/ByteCode/libcxx/tuple-decompose-for-range.cpp create mode 100644 clang/test/AST/absurdly_big_struct.cpp create mode 100644 clang/test/Analysis/Checkers/WebKit/call-args-safe-functions.mm delete mode 100644 clang/test/Analysis/analyzer_test.py create mode 100644 clang/test/Analysis/cstring-should-not-invalidate.cpp create mode 100644 clang/test/Analysis/getline-unixapi-invalid-signatures.c create mode 100644 clang/test/Analysis/lambda-convert-to-func-ptr.cpp delete mode 100644 clang/test/Analysis/z3/enabled.c create mode 100644 clang/test/CIR/CodeGen/assign-operator.cpp create mode 100644 clang/test/CIR/CodeGen/bitfield-union.c create mode 100644 clang/test/CIR/CodeGen/builtin_bit.cpp create mode 100644 clang/test/CIR/CodeGen/complex-builtins.cpp create mode 100644 clang/test/CIR/CodeGen/ctor-alias.cpp create mode 100644 clang/test/CIR/CodeGen/generic-selection.c create mode 100644 clang/test/CIR/CodeGen/new.cpp create mode 100644 clang/test/CIR/CodeGen/non-type-template-param.cpp create mode 100644 clang/test/CIR/CodeGen/opt-info-attr.cpp create mode 100644 clang/test/CIR/CodeGen/pack-indexing.cpp create mode 100644 clang/test/CIR/CodeGenOpenACC/cache.c create mode 100644 clang/test/CIR/CodeGenOpenACC/combined-copyin-copyout-create.c create mode 100644 clang/test/CIR/CodeGenOpenACC/compute-copyin-copyout-create.c create mode 100644 clang/test/CIR/CodeGenOpenACC/data-copy-copyin-copyout-create.c create mode 100644 clang/test/CIR/CodeGenOpenACC/enter-data.c create mode 100644 clang/test/CIR/CodeGenOpenACC/exit-data.c create mode 100644 clang/test/CIR/CodeGenOpenACC/update.c create mode 100644 clang/test/CIR/IR/invalid-func.cir create mode 100644 clang/test/CIR/IR/invalid-opt-info.cir delete mode 100644 clang/test/CIR/IR/invalid-vector-create-wrong-size.cir delete mode 100644 clang/test/CIR/IR/invalid-vector-create-wrong-type.cir delete mode 100644 clang/test/CIR/IR/invalid-vector-shift-wrong-result-type.cir delete mode 100644 clang/test/CIR/IR/invalid-vector-shuffle-dyn-wrong-operands.cir delete mode 100644 clang/test/CIR/IR/invalid-vector-shuffle-wrong-index.cir delete mode 100644 clang/test/CIR/IR/invalid-vector-zero-size.cir create mode 100644 clang/test/CIR/Transforms/complex-imag-fold.cir create mode 100644 clang/test/CIR/Transforms/complex-real-fold.cir create mode 100644 clang/test/CIR/func-linkage.cpp create mode 100644 clang/test/ClangScanDeps/modules-full-named-modules.cppm create mode 100644 clang/test/ClangScanDeps/raw-strings.cpp create mode 100644 clang/test/CodeCompletion/skip-explicit-object-parameter.cpp create mode 100644 clang/test/CodeGen/AArch64/attr-fp8-function.c create mode 100644 clang/test/CodeGen/LoongArch/bitint.c create mode 100644 clang/test/CodeGen/PowerPC/builtins-bcd-transform.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/non-overloaded/nds_vd4dots.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/non-overloaded/nds_vd4dotsu.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/non-overloaded/nds_vd4dotu.c (100%) create mode 100644 clang/test/CodeGen/RISCV/andes-intrinsics/non-policy/non-overloaded/nds_vfncvtbf16s.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/non-overloaded/nds_vfpmadb.c (99%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/non-overloaded/nds_vfpmadt.c (99%) create mode 100644 clang/test/CodeGen/RISCV/andes-intrinsics/non-policy/non-overloaded/nds_vfwcvtsbf16.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/overloaded/nds_vd4dots.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/overloaded/nds_vd4dotsu.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/overloaded/nds_vd4dotu.c (100%) create mode 100644 clang/test/CodeGen/RISCV/andes-intrinsics/non-policy/overloaded/nds_vfncvtbf16s.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/overloaded/nds_vfpmadb.c (99%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/non-policy/overloaded/nds_vfpmadt.c (99%) create mode 100644 clang/test/CodeGen/RISCV/andes-intrinsics/non-policy/overloaded/nds_vfwcvtsbf16.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/non-overloaded/nds_vd4dots.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/non-overloaded/nds_vd4dotsu.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/non-overloaded/nds_vd4dotu.c (100%) create mode 100644 clang/test/CodeGen/RISCV/andes-intrinsics/policy/non-overloaded/nds_vfncvtbf16s.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/non-overloaded/nds_vfpmadb.c (99%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/non-overloaded/nds_vfpmadt.c (99%) create mode 100644 clang/test/CodeGen/RISCV/andes-intrinsics/policy/non-overloaded/nds_vfwcvtsbf16.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/overloaded/nds_vd4dots.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/overloaded/nds_vd4dotsu.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/overloaded/nds_vd4dotu.c (100%) create mode 100644 clang/test/CodeGen/RISCV/andes-intrinsics/policy/overloaded/nds_vfncvtbf16s.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/overloaded/nds_vfpmadb.c (99%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => andes-intrinsics}/policy/overloaded/nds_vfpmadt.c (99%) create mode 100644 clang/test/CodeGen/RISCV/andes-intrinsics/policy/overloaded/nds_vfwcvtsbf16.c rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vfnrclip_x_f_qf.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vfnrclip_x_f_qf_rm.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vfnrclip_xu_f_qf.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vfnrclip_xu_f_qf_rm.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vfwmacc_4x4x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vqmacc_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vqmacc_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vqmaccsu_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vqmaccsu_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vqmaccu_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vqmaccu_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vqmaccus_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/non-overloaded/sf_vqmaccus_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vfnrclip_x_f_qf.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vfnrclip_x_f_qf_rm.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vfnrclip_xu_f_qf.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vfnrclip_xu_f_qf_rm.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vfwmacc_4x4x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vqmacc_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vqmacc_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vqmaccsu_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vqmaccsu_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vqmaccu_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vqmaccu_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vqmaccus_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/non-policy/overloaded/sf_vqmaccus_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vfnrclip_x_f_qf.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vfnrclip_x_f_qf_rm.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vfnrclip_xu_f_qf.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vfnrclip_xu_f_qf_rm.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vfwmacc_4x4x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vqmacc_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vqmacc_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vqmaccsu_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vqmaccsu_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vqmaccu_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vqmaccu_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vqmaccus_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/non-overloaded/sf_vqmaccus_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vfnrclip_x_f_qf.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vfnrclip_x_f_qf_rm.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vfnrclip_xu_f_qf.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vfnrclip_xu_f_qf_rm.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vfwmacc_4x4x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vqmacc_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vqmacc_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vqmaccsu_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vqmaccsu_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vqmaccu_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vqmaccu_4x8x4.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vqmaccus_2x8x2.c (100%) rename clang/test/CodeGen/RISCV/{rvv-intrinsics-autogenerated => sifive-intrinsics}/policy/overloaded/sf_vqmaccus_4x8x4.c (100%) create mode 100644 clang/test/CodeGen/WebAssembly/wasm-exception-model-flag-parse-ir-input.ll create mode 100644 clang/test/CodeGen/WebAssembly/wasm-invalid-exception-kinds.ll create mode 100644 clang/test/CodeGen/X86/ms-secure-hotpatch-bad-file.c create mode 100644 clang/test/CodeGen/X86/ms-secure-hotpatch-cpp.cpp create mode 100644 clang/test/CodeGen/X86/ms-secure-hotpatch-eh.cpp create mode 100644 clang/test/CodeGen/X86/ms-secure-hotpatch-globals.c create mode 100644 clang/test/CodeGen/X86/ms-secure-hotpatch-lto.c create mode 100644 clang/test/CodeGen/X86/ms-secure-hotpatch.c create mode 100644 clang/test/CodeGen/arm64-microsoft-sys.c create mode 100644 clang/test/CodeGen/fallow-runtime-check-skip-hot-cutoff.c create mode 100644 clang/test/CodeGenCXX/builtin-invoke.cpp create mode 100644 clang/test/CodeGenCXX/debug-info-dtor-implicit-args.cpp create mode 100644 clang/test/CodeGenOpenCL/builtins-amdgcn-gfx1250-async-load-store-lds.cl create mode 100644 clang/test/CodeGenOpenCL/builtins-amdgcn-gfx1250-load-tr.cl create mode 100644 clang/test/CodeGenOpenCL/builtins-amdgcn-gfx1250-tensor-load-store.cl create mode 100644 clang/test/DebugInfo/KeyInstructions/atomic.c create mode 100644 clang/test/DebugInfo/KeyInstructions/init-member-memcopyable-2.cpp create mode 100644 clang/test/DebugInfo/KeyInstructions/init-member-memcopyable.cpp create mode 100644 clang/test/Driver/HLSL/dxc_fvk_layout.hlsl rename libcxx/test/libcxx/selftest/file_dependencies/a.txt => clang/test/Driver/Inputs/basic_aarch64_gcc_tree/aarch64-none-elf/include/c++/8.2.1/.keep (100%) rename libcxx/test/libcxx/selftest/file_dependencies/dir/b.txt => clang/test/Driver/Inputs/basic_aarch64_gcc_tree/aarch64-none-elf/lib/.keep (100%) create mode 100644 clang/test/Driver/Inputs/basic_aarch64_gcc_tree/aarch64-none-elf/lib/crt0.o create mode 100755 clang/test/Driver/Inputs/basic_aarch64_gcc_tree/bin/aarch64-none-elf-ld create mode 100644 clang/test/Driver/Inputs/basic_aarch64_gcc_tree/lib/gcc/aarch64-none-elf/8.2.1/crtbegin.o create mode 100644 clang/test/Driver/Inputs/basic_aarch64_gcc_tree/lib/gcc/aarch64-none-elf/8.2.1/crtend.o create mode 100644 clang/test/Driver/Inputs/basic_aarch64_nogcc_tree/aarch64-none-elf/lib/crt0.o create mode 100644 clang/test/Driver/Inputs/basic_aarch64_nogcc_tree/aarch64-none-elf/lib/crtbegin.o create mode 100644 clang/test/Driver/Inputs/basic_aarch64_nogcc_tree/aarch64-none-elf/lib/crtend.o create mode 100755 clang/test/Driver/Inputs/basic_aarch64_nogcc_tree/bin/aarch64-none-elf-ld create mode 100644 clang/test/Driver/Inputs/basic_arm_gcc_tree/armv6m-none-eabi/include/c++/8.2.1/.keep create mode 100644 clang/test/Driver/Inputs/basic_arm_gcc_tree/armv6m-none-eabi/lib/.keep create mode 100644 clang/test/Driver/Inputs/basic_arm_gcc_tree/armv6m-none-eabi/lib/crt0.o create mode 100755 clang/test/Driver/Inputs/basic_arm_gcc_tree/bin/armv6m-none-eabi-ld create mode 100644 clang/test/Driver/Inputs/basic_arm_gcc_tree/lib/gcc/armv6m-none-eabi/8.2.1/crtbegin.o create mode 100644 clang/test/Driver/Inputs/basic_arm_gcc_tree/lib/gcc/armv6m-none-eabi/8.2.1/crtend.o create mode 100644 clang/test/Driver/Inputs/basic_arm_nogcc_tree/armv6m-none-eabi/lib/crt0.o create mode 100644 clang/test/Driver/Inputs/basic_arm_nogcc_tree/armv6m-none-eabi/lib/crtbegin.o create mode 100644 clang/test/Driver/Inputs/basic_arm_nogcc_tree/armv6m-none-eabi/lib/crtend.o create mode 100755 clang/test/Driver/Inputs/basic_arm_nogcc_tree/bin/armv6m-none-eabi-ld create mode 100644 clang/test/Driver/aarch64-gnutools.c create mode 100644 clang/test/Driver/aarch64-toolchain-extra.c create mode 100644 clang/test/Driver/aarch64-toolchain.c create mode 100644 clang/test/Driver/arm-gnutools.c create mode 100644 clang/test/Driver/arm-toolchain-extra.c create mode 100644 clang/test/Driver/arm-toolchain.c create mode 100644 clang/test/Driver/baremetal-undefined-symbols.c create mode 100644 clang/test/Driver/check-no-multlib-warning.c create mode 100644 clang/test/Driver/dxc_hlsl-rootsig-ver.hlsl create mode 100644 clang/test/Driver/fallow-runtime-check-skip-hot-cutoff.c create mode 100644 clang/test/Driver/ir-exception-model.c create mode 100644 clang/test/Driver/print-enabled-extensions/aarch64-gb10.c delete mode 100644 clang/test/Driver/riscv-args.c create mode 100644 clang/test/ExtractAPI/pointers.c create mode 100644 clang/test/Index/inline-assembly.c create mode 100644 clang/test/Interpreter/out-of-process.cpp create mode 100644 clang/test/Modules/ModulesLocalNamespace.cppm create mode 100644 clang/test/Modules/mingw-exceptions.cppm create mode 100644 clang/test/Modules/no-transitive-decl-change-4.cppm create mode 100644 clang/test/Modules/pr118137.cppm create mode 100644 clang/test/Modules/pr145975.cppm create mode 100644 clang/test/Modules/template-declare.cppm create mode 100644 clang/test/Modules/var-init-side-effects-modulemap.cpp create mode 100644 clang/test/OpenMP/openmp-6-future-spellings.cpp create mode 100644 clang/test/Options/Gis.hlsl create mode 100644 clang/test/Parser/c23-typeof.m create mode 100644 clang/test/Preprocessor/macro_paste_identifier_ucn.c rename clang/test/{CodeGen => Sema}/attr-cpuspecific-cpus.c (97%) create mode 100644 clang/test/Sema/attr-nonstring_safe.c create mode 100644 clang/test/Sema/builtins-bcd-transform.c create mode 100644 clang/test/Sema/deep_recursion.c create mode 100644 clang/test/Sema/rvv-andes-required-features-invalid.c create mode 100644 clang/test/SemaCXX/P1979.cpp create mode 100644 clang/test/SemaCXX/aarch64-streaming-sve-vector-conversions.cpp create mode 100644 clang/test/SemaCXX/builtin-invoke.cpp create mode 100644 clang/test/SemaCXX/wmissing-noreturn-suggestion.cpp create mode 100644 clang/test/SemaCXX/wreturn-always-throws.cpp create mode 100644 clang/test/SemaHIP/amdgpu-feature-builtins-cant-jump.hip create mode 100644 clang/test/SemaHIP/amdgpu-feature-builtins-return-type-deduction.hip create mode 100644 clang/test/SemaOpenACC/cache-warn-invalid-varloc.cpp create mode 100644 clang/test/SemaOpenCL/amd-media-ops.cl create mode 100644 clang/unittests/AllClangUnitTests.cpp create mode 100644 compiler-rt/lib/asan/asan.link_with_main_exec.txt create mode 100644 compiler-rt/lib/asan/asan_cxx.link_with_main_exec.txt create mode 100644 compiler-rt/test/asan/TestCases/Windows/alloc_dealloc_mismatch.cpp create mode 100644 compiler-rt/test/msan/msan_print_shadow_on_outlined_check.cpp create mode 100644 compiler-rt/test/tsan/java_heap_init2.cpp create mode 100644 compiler-rt/test/tsan/munmap_clear_shadow.c create mode 100644 cross-project-tests/dtlto/README.md create mode 100644 cross-project-tests/dtlto/ld-dtlto.c create mode 100644 cross-project-tests/dtlto/lit.local.cfg create mode 100644 flang/lib/Semantics/check-omp-atomic.cpp create mode 100644 flang/lib/Semantics/check-omp-loop.cpp create mode 100644 flang/lib/Semantics/check-omp-metadirective.cpp create mode 100644 flang/lib/Semantics/openmp-utils.cpp create mode 100644 flang/lib/Semantics/openmp-utils.h create mode 100644 flang/module/cooperative_groups.f90 create mode 100644 flang/test/Driver/fopenmp-version.F90 create mode 100644 flang/test/Driver/tco-emit-final-mlir.fir create mode 100644 flang/test/Fir/OpenACC/openacc-type-categories-class.f90 create mode 100644 flang/test/Integration/amdgpu-target-desc-cast-to-global-addrspace.f90 create mode 100644 flang/test/Integration/debug-cyclic-derived-type-caching-complex.f90 create mode 100644 flang/test/Integration/debug-cyclic-derived-type-caching-simple.f90 create mode 100644 flang/test/Integration/skip-external-rtti-definition.F90 create mode 100644 flang/test/Lower/CUDA/cuda-cooperative.cuf create mode 100644 flang/test/Lower/OpenMP/minmax-optional-parameters.f90 create mode 100644 flang/test/Lower/OpenMP/nested-loop-transformation-construct01.f90 create mode 100644 flang/test/Lower/OpenMP/nested-loop-transformation-construct02.f90 create mode 100644 flang/test/Lower/OpenMP/target-data-if-false.f90 create mode 100644 flang/test/Lower/OpenMP/target-data-skip-mapper-calls.f90 create mode 100644 flang/test/Lower/OpenMP/wsloop-reduction-logical-kinds.f90 create mode 100644 flang/test/Lower/variable-common-viewed-as-module-var.f90 create mode 100644 flang/test/Parser/OpenMP/loop-transformation-construct01.f90 create mode 100644 flang/test/Parser/OpenMP/loop-transformation-construct02.f90 create mode 100644 flang/test/Parser/issue-146362.1.f90 create mode 100644 flang/test/Parser/issue-146362.2.f90 create mode 100644 flang/test/Preprocessing/bug1077.F90 create mode 100644 flang/test/Semantics/OpenMP/loop-transformation-construct01.f90 create mode 100644 flang/test/Semantics/bug1046.f90 create mode 100644 flang/test/Semantics/bug1056.f90 create mode 100644 flang/test/Semantics/bug1092.F90 create mode 100644 flang/test/Semantics/bug144453.f90 create mode 100644 flang/test/Semantics/function-result-extent-max.f90 create mode 100644 flang/test/Transforms/debug-omp-target-op-1.fir create mode 100644 flang/test/Transforms/debug-omp-target-op-2.fir create mode 100644 flang/test/Transforms/tbaa-for-local-vars.fir create mode 100644 libc/src/setjmp/arm/sigsetjmp.cpp create mode 100644 libc/src/string/memory_utils/arm/inline_memcpy.h create mode 100644 libc/src/wchar/wcscspn.cpp create mode 100644 libc/src/wchar/wcscspn.h create mode 100644 libc/src/wchar/wcsnlen.cpp create mode 100644 libc/src/wchar/wcsnlen.h create mode 100644 libc/src/wchar/wcstok.cpp create mode 100644 libc/src/wchar/wcstok.h create mode 100644 libc/src/wchar/wctomb.cpp create mode 100644 libc/src/wchar/wctomb.h create mode 100644 libc/test/integration/src/stdlib/gpu/aligned_alloc.cpp create mode 100644 libc/test/integration/src/stdlib/gpu/realloc.cpp create mode 100644 libc/test/src/wchar/wcscspn_test.cpp create mode 100644 libc/test/src/wchar/wcsnlen_test.cpp create mode 100644 libc/test/src/wchar/wcstok_test.cpp create mode 100644 libc/test/src/wchar/wctomb_test.cpp rename libclc/clc/include/clc/{math => shared}/binary_decl_with_int_second_arg.inc (74%) create mode 100644 libclc/clc/include/clc/shared/binary_def_scalarize.inc rename libclc/clc/include/clc/{math => shared}/binary_def_with_int_second_arg.inc (80%) create mode 100644 libclc/clc/include/clc/shared/ternary_def_scalarize.inc create mode 100644 libclc/clc/include/clc/shared/unary_def_scalarize.inc create mode 100644 libclc/opencl/include/clc/opencl/opencl-base.h create mode 100644 libcxx/include/__iterator/product_iterator.h create mode 100644 libcxx/include/__locale_dir/check_grouping.h create mode 100644 libcxx/include/__locale_dir/get_c_locale.h create mode 100644 libcxx/include/__locale_dir/messages.h create mode 100644 libcxx/include/__locale_dir/money.h create mode 100644 libcxx/include/__locale_dir/num.h create mode 100644 libcxx/include/__locale_dir/scan_keyword.h create mode 100644 libcxx/include/__locale_dir/time.h create mode 100644 libcxx/include/__locale_dir/wbuffer_convert.h create mode 100644 libcxx/include/__locale_dir/wstring_convert.h delete mode 100644 libcxx/include/__type_traits/add_lvalue_reference.h rename libcxx/include/__type_traits/{add_rvalue_reference.h => add_reference.h} (51%) create mode 100644 libcxx/test/extensions/gnu/hash/specializations.pass.cpp rename libcxx/test/{libcxx/extensions/hash/specializations.compile.fail.cpp => extensions/gnu/hash/specializations.verify.cpp} (70%) rename libcxx/test/{libcxx/extensions/hash_map/const_iterator.compile.fail.cpp => extensions/gnu/hash_map/const_iterator.verify.cpp} (55%) create mode 100644 libcxx/test/extensions/gnu/lit.local.cfg delete mode 100644 libcxx/test/libcxx/extensions/hash/specializations.pass.cpp create mode 100644 libcxx/test/libcxx/iterators/product_iterator.pass.cpp rename libcxx/test/{libcxx => }/selftest/additional_compile_flags/conditional-compile-flags.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/additional_compile_flags/lit.local.cfg (100%) rename libcxx/test/{libcxx => }/selftest/additional_compile_flags/substitutes-in-compile-flags.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/additional_compile_flags/substitutes-in-run.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/compile.fail.cpp/compile-error.compile.fail.cpp (100%) rename libcxx/test/{libcxx => }/selftest/compile.fail.cpp/compile-success.compile.fail.cpp (100%) rename libcxx/test/{libcxx => }/selftest/compile.pass.cpp/compile-error.compile.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/compile.pass.cpp/compile-success.compile.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/compile.pass.cpp/link-error.compile.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/compile.pass.cpp/run-error.compile.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/compile.pass.mm/compile-error.compile.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/compile.pass.mm/compile-success.compile.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/compile.pass.mm/link-error.compile.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/compile.pass.mm/run-error.compile.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/convenience_substitutions/build_run.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/convenience_substitutions/verify.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/dsl/dsl.sh.py (99%) rename libcxx/test/{libcxx => }/selftest/dsl/lit.local.cfg (100%) create mode 100644 libcxx/test/selftest/file_dependencies/a.txt rename libcxx/test/{libcxx => }/selftest/file_dependencies/absolute-and-relative-paths.sh.cpp (100%) create mode 100644 libcxx/test/selftest/file_dependencies/dir/b.txt rename libcxx/test/{libcxx => }/selftest/file_dependencies/substitute-in-dependencies.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/gen.cpp/empty.gen.cpp (100%) rename libcxx/test/{libcxx => }/selftest/gen.cpp/one.gen.cpp (100%) rename libcxx/test/{libcxx => }/selftest/gen.cpp/two.gen.cpp (100%) rename libcxx/test/{libcxx => }/selftest/link.fail.cpp/compile-error.link.fail.cpp (100%) rename libcxx/test/{libcxx => }/selftest/link.fail.cpp/link-error.link.fail.cpp (100%) rename libcxx/test/{libcxx => }/selftest/link.fail.cpp/link-success.link.fail.cpp (100%) rename libcxx/test/{libcxx => }/selftest/link.pass.cpp/compile-error.link.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/link.pass.cpp/link-error.link.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/link.pass.cpp/link-success.link.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/link.pass.cpp/run-error.link.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/link.pass.mm/compile-error.link.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/link.pass.mm/link-error.link.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/link.pass.mm/link-success.link.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/link.pass.mm/run-error.link.pass.mm (100%) rename libcxx/test/{libcxx => selftest}/lit.local.cfg (100%) rename libcxx/test/{libcxx => }/selftest/modules/no-modules.sh.cpp (73%) rename libcxx/test/{libcxx => }/selftest/modules/std-and-std.compat-module.sh.cpp (82%) rename libcxx/test/{libcxx => }/selftest/modules/std-module.sh.cpp (82%) rename libcxx/test/{libcxx => }/selftest/modules/std.compat-module.sh.cpp (82%) rename libcxx/test/{libcxx => }/selftest/pass.cpp/compile-error.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/pass.cpp/link-error.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/pass.cpp/run-error.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/pass.cpp/run-success.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/pass.cpp/werror.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/pass.mm/compile-error.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/pass.mm/link-error.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/pass.mm/no-arc.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/pass.mm/run-error.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/pass.mm/run-success.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/pass.mm/use-objective-cxx.pass.mm (100%) rename libcxx/test/{libcxx => }/selftest/remote-substitutions.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/sh.cpp/run-error.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/sh.cpp/run-success.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/sh.cpp/substitutions.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/sh.cpp/werror.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/shell-no-escape-builtins.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/stdin-is-piped.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/test_macros.pass.cpp (100%) rename libcxx/test/{libcxx => }/selftest/tmpdir-exists.sh.cpp (100%) rename libcxx/test/{libcxx => }/selftest/verify.cpp/no-diagnostics-unmarked.verify.cpp (100%) rename libcxx/test/{libcxx => }/selftest/verify.cpp/no-diagnostics.verify.cpp (100%) rename libcxx/test/{libcxx => }/selftest/verify.cpp/no-werror.verify.cpp (100%) rename libcxx/test/{libcxx => }/selftest/verify.cpp/right-diagnostic.verify.cpp (100%) rename libcxx/test/{libcxx => }/selftest/verify.cpp/wrong-diagnostic.verify.cpp (100%) create mode 100644 libcxx/test/std/iterators/iterator.range/mandatory_inclusions.gen.py create mode 100644 libcxx/test/std/thread/futures/futures.async/thread_create_failure.pass.cpp create mode 100644 libcxx/test/std/thread/futures/futures.async/wait_on_destruct.pass.cpp create mode 100644 libcxx/test/std/utilities/function.objects/refwrap/common_reference.compile.pass.cpp create mode 100755 libcxx/utils/ci/buildkite-pipeline-trigger.sh create mode 100644 lld/ELF/Arch/TargetImpl.h create mode 100644 lld/docs/DTLTO.rst create mode 100644 lld/test/COFF/exported-dllmain.test create mode 100644 lld/test/ELF/aarch64-branch-to-branch.s create mode 100644 lld/test/ELF/dtlto/files.test create mode 100644 lld/test/ELF/dtlto/options.test create mode 100644 lld/test/ELF/dtlto/partitions.test create mode 100644 lld/test/ELF/lto/lazy-debug.ll create mode 100644 lld/test/ELF/x86-64-branch-to-branch.s delete mode 100644 lld/test/wasm/compress-relocs.ll create mode 100644 lld/test/wasm/compress-relocs.s create mode 100644 lld/test/wasm/compress-relocs64.s create mode 100644 lldb/docs/use/mcp.md delete mode 100644 lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp delete mode 100644 lldb/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.h delete mode 100644 lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp delete mode 100644 lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h delete mode 100644 lldb/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp delete mode 100644 lldb/source/Plugins/Process/Utility/RegisterContextMach_i386.h create mode 100644 lldb/source/Plugins/Process/mach-core/RegisterContextUnifiedCore.cpp create mode 100644 lldb/source/Plugins/Process/mach-core/RegisterContextUnifiedCore.h rename lldb/test/API/{functionalities/data-formatter/data-formatter-stl/libcxx/deque => commands/frame/var-dil/basics/BitField}/Makefile (75%) create mode 100644 lldb/test/API/commands/frame/var-dil/basics/BitField/TestFrameVarDILBitField.py create mode 100644 lldb/test/API/commands/frame/var-dil/basics/BitField/main.cpp create mode 100644 lldb/test/API/commands/frame/var-dil/basics/GlobalVariableLookup/extern.cpp rename lldb/test/API/{functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr => commands/frame/var-dil/basics/Indirection}/Makefile (70%) create mode 100644 lldb/test/API/commands/frame/var-dil/basics/Indirection/TestFrameVarDILIndirection.py create mode 100644 lldb/test/API/commands/frame/var-dil/basics/Indirection/main.cpp create mode 100644 lldb/test/API/commands/frame/var-dil/basics/PointerDereference/Makefile create mode 100644 lldb/test/API/commands/frame/var-dil/basics/PointerDereference/TestFrameVarDILPointerDereference.py create mode 100644 lldb/test/API/commands/frame/var-dil/basics/PointerDereference/main.cpp create mode 100644 lldb/test/API/commands/frame/var-dil/basics/QualifiedId/Makefile create mode 100644 lldb/test/API/commands/frame/var-dil/basics/QualifiedId/TestFrameVarDILQualifiedId.py create mode 100644 lldb/test/API/commands/frame/var-dil/basics/QualifiedId/main.cpp create mode 100644 lldb/test/API/commands/frame/var-dil/basics/SyntheticDereference/Makefile create mode 100644 lldb/test/API/commands/frame/var-dil/basics/SyntheticDereference/TestFrameVarDILSyntheticDereference.py create mode 100644 lldb/test/API/commands/frame/var-dil/basics/SyntheticDereference/main.cpp create mode 100644 lldb/test/API/commands/frame/var-dil/basics/SyntheticDereference/wrapPtrSynthProvider.py create mode 100644 lldb/test/API/commands/protocol/TestMCPUnixSocket.py create mode 100644 lldb/test/API/commands/statistics/basic/baz.cpp create mode 100644 lldb/test/API/commands/statistics/basic/third.cpp create mode 100644 lldb/test/API/functionalities/breakpoint/breakpoint_locations/after_rebuild/Makefile create mode 100644 lldb/test/API/functionalities/breakpoint/breakpoint_locations/after_rebuild/TestLocationsAfterRebuild.py create mode 100644 lldb/test/API/functionalities/breakpoint/breakpoint_locations/after_rebuild/main.c create mode 100644 lldb/test/API/functionalities/breakpoint/breakpoint_locations/after_rebuild/second_main.c create mode 100644 lldb/test/API/functionalities/breakpoint/breakpoint_locations/after_rebuild/third_main.c create mode 100644 lldb/test/API/functionalities/breakpoint/hardware_breakpoints/simple_hw_breakpoints/Makefile create mode 100644 lldb/test/API/functionalities/breakpoint/hardware_breakpoints/simple_hw_breakpoints/TestSimpleHWBreakpoints.py create mode 100644 lldb/test/API/functionalities/breakpoint/hardware_breakpoints/simple_hw_breakpoints/main.c create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/atomic/Makefile rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx/atomic/TestLibCxxAtomic.py => generic/atomic/TestDataFormatterStdAtomic.py} (89%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx => generic}/atomic/main.cpp (51%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx => generic}/chrono/Makefile (82%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx/chrono/TestDataFormatterLibcxxChrono.py => generic/chrono/TestDataFormatterStdChrono.py} (98%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx => generic}/chrono/main.cpp (100%) create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/map/Makefile rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx/map/TestDataFormatterLibccMap.py => generic/map/TestDataFormatterStdMap.py} (94%) create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/map/main.cpp create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/shared_ptr/Makefile rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx/shared_ptr/TestDataFormatterLibcxxSharedPtr.py => generic/shared_ptr/TestDataFormatterStdSharedPtr.py} (54%) create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/shared_ptr/main.cpp create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unique_ptr/Makefile create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/unique_ptr/TestDataFormatterStdUniquePtr.py rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx => generic}/unique_ptr/main.cpp (58%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libstdcpp/map => generic/vbool}/Makefile (72%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libstdcpp => generic}/vbool/TestDataFormatterStdVBool.py (81%) create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vbool/main.cpp create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vector/Makefile rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/{libcxx/vector/TestDataFormatterLibcxxVector.py => generic/vector/TestDataFormatterStdVector.py} (84%) create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/generic/vector/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/Makefile delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/TestDataFormatterLibcxxDeque.py delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/deque/main.cpp rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/{vbool => invalid-string}/Makefile (98%) create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/invalid-string/TestDataFormatterLibcxxInvalidString.py create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/invalid-string/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/map/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/Makefile delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/shared_ptr/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unique_ptr/Makefile delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unique_ptr/TestDataFormatterLibcxxUniquePtr.py rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/{map => unordered_map-iterator}/Makefile (100%) rename lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/{unordered_map => unordered_map-iterator}/TestDataFormatterLibccUnorderedMap.py (51%) create mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered_map-iterator/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered_map/Makefile delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/unordered_map/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vector/Makefile delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/Makefile delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/TestDataFormatterInvalidStdUniquePtr.py delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/Makefile delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/main.cpp delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/Makefile delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py delete mode 100644 lldb/test/API/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/main.cpp create mode 100644 lldb/test/API/functionalities/postmortem/elf-core/expr/TestExpr.py create mode 100644 lldb/test/API/functionalities/postmortem/elf-core/expr/linux-x86_64.core create mode 100755 lldb/test/API/functionalities/postmortem/elf-core/expr/linux-x86_64.out create mode 100644 lldb/test/API/functionalities/postmortem/elf-core/expr/main.cpp create mode 100644 lldb/test/API/lang/objc/class-without-methods/Makefile create mode 100644 lldb/test/API/lang/objc/class-without-methods/Point.h create mode 100644 lldb/test/API/lang/objc/class-without-methods/Point.m create mode 100644 lldb/test/API/lang/objc/class-without-methods/TestObjCClassWithoutMethods.py create mode 100644 lldb/test/API/lang/objc/class-without-methods/main.m create mode 100644 lldb/test/API/linux/aarch64/mte_core_file/core.mte.notags create mode 100644 lldb/test/API/macosx/lc-note/additional-registers/Makefile create mode 100644 lldb/test/API/macosx/lc-note/additional-registers/TestMetadataRegisters.py create mode 100644 lldb/test/API/macosx/lc-note/additional-registers/add-lcnote.cpp create mode 100644 lldb/test/API/macosx/lc-note/additional-registers/main.c delete mode 100644 lldb/test/API/macosx/simulator/hello.c create mode 100644 lldb/test/API/macosx/simulator/hello.cpp create mode 100644 lldb/test/API/riscv/step/Makefile create mode 100644 lldb/test/API/riscv/step/TestSoftwareStep.py create mode 100644 lldb/test/API/riscv/step/branch.c create mode 100644 lldb/test/API/riscv/step/incomplete_sequence_without_lr.c create mode 100644 lldb/test/API/riscv/step/incomplete_sequence_without_sc.c create mode 100644 lldb/test/API/riscv/step/main.c create mode 100644 lldb/test/API/tools/lldb-dap/step/other.h create mode 100644 lldb/unittests/SymbolFile/DWARF/DWARF64UnitTest.cpp create mode 100644 llvm/docs/QualGroup.rst create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/InProcessMemoryAccess.h create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/MemoryAccess.h create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/SelfExecutorProcessControl.h create mode 100644 llvm/include/llvm/Frontend/HLSL/RootSignatureMetadata.h rename llvm/include/llvm/Frontend/HLSL/{HLSLRootSignatureUtils.h => RootSignatureValidations.h} (50%) create mode 100644 llvm/include/llvm/Frontend/OpenMP/DirectiveNameParser.h delete mode 100644 llvm/include/llvm/IR/RuntimeLibcalls.def create mode 100644 llvm/include/llvm/IR/RuntimeLibcalls.td create mode 100644 llvm/include/llvm/IR/RuntimeLibcallsImpl.td delete mode 100644 llvm/include/llvm/MC/MCFixupKindInfo.h delete mode 100644 llvm/include/llvm/MC/MCFragment.h create mode 100644 llvm/include/llvm/MC/MCGOFFAttributes.h create mode 100644 llvm/lib/CodeGen/WindowsSecureHotPatching.cpp create mode 100644 llvm/lib/DebugInfo/DWARF/LowLevel/CMakeLists.txt create mode 100644 llvm/lib/ExecutionEngine/Orc/InProcessMemoryAccess.cpp create mode 100644 llvm/lib/ExecutionEngine/Orc/SelfExecutorProcessControl.cpp create mode 100644 llvm/lib/Frontend/HLSL/HLSLRootSignature.cpp delete mode 100644 llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp create mode 100644 llvm/lib/Frontend/HLSL/RootSignatureMetadata.cpp create mode 100644 llvm/lib/Frontend/HLSL/RootSignatureValidations.cpp create mode 100644 llvm/lib/Frontend/OpenMP/DirectiveNameParser.cpp delete mode 100644 llvm/lib/IR/ZOSLibcallNames.def create mode 100644 llvm/lib/MC/MCSectionGOFF.cpp delete mode 100644 llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h create mode 100644 llvm/lib/Target/AMDGPU/AMDGPURewriteAGPRCopyMFMA.cpp delete mode 100644 llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.h delete mode 100644 llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp delete mode 100644 llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.h delete mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp delete mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.h delete mode 100644 llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp delete mode 100644 llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.h create mode 100644 llvm/lib/Target/RISCV/RISCVInstrInfoP.td delete mode 100644 llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.cpp delete mode 100644 llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.h delete mode 100644 llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCExpr.h create mode 100644 llvm/lib/Target/X86/X86SchedLunarlakeP.td delete mode 100644 llvm/lib/Target/Xtensa/MCTargetDesc/XtensaMCExpr.h create mode 100644 llvm/test/Analysis/CostModel/AArch64/ldexp.ll create mode 100644 llvm/test/Analysis/CostModel/AArch64/lrint.ll create mode 100644 llvm/test/Analysis/CostModel/AArch64/segmented-shufflevector-patterns.ll create mode 100644 llvm/test/Analysis/CostModel/AArch64/sve-ldexp.ll create mode 100644 llvm/test/Analysis/CostModel/AArch64/sve-lrint.ll create mode 100644 llvm/test/Analysis/CostModel/RISCV/exp.ll create mode 100644 llvm/test/Analysis/IR2Vec/Inputs/dummy_2D_vocab.json create mode 100644 llvm/test/Analysis/IR2Vec/Inputs/incorrect_vocab1.json create mode 100644 llvm/test/Analysis/IR2Vec/Inputs/incorrect_vocab2.json create mode 100644 llvm/test/Analysis/IR2Vec/Inputs/incorrect_vocab3.json create mode 100644 llvm/test/Analysis/IR2Vec/Inputs/incorrect_vocab4.json create mode 100644 llvm/test/Analysis/IR2Vec/dbg-inst.ll create mode 100644 llvm/test/Analysis/IR2Vec/unreachable.ll create mode 100644 llvm/test/Analysis/IR2Vec/vocab-test.ll create mode 100644 llvm/test/Analysis/LoopAccessAnalysis/dependences-i128-inductions.ll create mode 100644 llvm/test/CodeGen/AArch64/GlobalISel/prelegalizer-combiner-use-vector-truncate.mir create mode 100644 llvm/test/CodeGen/AArch64/PHIElimination-reuse-copy.mir create mode 100644 llvm/test/CodeGen/AArch64/arm64-zero-cycle-regmov-fpr.ll create mode 100644 llvm/test/CodeGen/AArch64/arm64-zero-cycle-regmov-gpr.ll delete mode 100644 llvm/test/CodeGen/AArch64/arm64-zero-cycle-regmov-gpr32.ll create mode 100644 llvm/test/CodeGen/AArch64/machine-outliner-loh.ll create mode 100644 llvm/test/CodeGen/AArch64/machine-outliner-loh.mir create mode 100644 llvm/test/CodeGen/AArch64/no-promote-scalabale-const-to-global.ll create mode 100644 llvm/test/CodeGen/AArch64/rem-by-const.ll create mode 100644 llvm/test/CodeGen/AArch64/sme-must-save-lr-for-vg.ll create mode 100644 llvm/test/CodeGen/AArch64/sme2-intrinsics-fclamp.ll create mode 100644 llvm/test/CodeGen/AArch64/sme2-intrinsics-sclamp.ll create mode 100644 llvm/test/CodeGen/AArch64/sme2-intrinsics-uclamp.ll create mode 100644 llvm/test/CodeGen/AArch64/streaming-func-no-sme.ll create mode 100644 llvm/test/CodeGen/AArch64/sve-indexed-arithmetic.ll create mode 100644 llvm/test/CodeGen/AArch64/sve-merging-unary.ll create mode 100644 llvm/test/CodeGen/AArch64/sve2-intrinsics-rax1.ll create mode 100644 llvm/test/CodeGen/AArch64/sve2-intrinsics-sm4.ll create mode 100644 llvm/test/CodeGen/AArch64/sve2p1-intrinsics-qcvtn.ll create mode 100644 llvm/test/CodeGen/AMDGPU/alloc-aligned-tuples-gfx1250.mir create mode 100644 llvm/test/CodeGen/AMDGPU/amdgpu-snop-padding.mir create mode 100644 llvm/test/CodeGen/AMDGPU/global-load-xcnt.ll create mode 100644 llvm/test/CodeGen/AMDGPU/inflate-reg-class-vgpr-mfma-to-agpr-negative-tests.mir create mode 100644 llvm/test/CodeGen/AMDGPU/inflate-reg-class-vgpr-mfma-to-av-with-load-source.mir create mode 100644 llvm/test/CodeGen/AMDGPU/inflate-reg-class-vgpr-mfma-to-av.mir create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.f16.fp8.ll create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.atomic.async.barrier.arrive.b64.ll create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.atomic.barrier.arrive.rtn.b64.ll create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.ordered.add-unsupported.ll create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.load.tr.gfx1250.w32.ll create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.monitor.sleep.ll create mode 100644 llvm/test/CodeGen/AMDGPU/llvm.amdgcn.tensor.load.store.ll create mode 100644 llvm/test/CodeGen/AMDGPU/ptradd-sdag-undef-poison.ll create mode 100644 llvm/test/CodeGen/AMDGPU/rewrite-vgpr-mfma-to-agpr.ll create mode 100644 llvm/test/CodeGen/AMDGPU/rsq.f32-safe.ll create mode 100644 llvm/test/CodeGen/AMDGPU/srl64_reduce_flags.ll create mode 100644 llvm/test/CodeGen/AMDGPU/undef-handling-crash-in-ra.ll create mode 100644 llvm/test/CodeGen/AMDGPU/wait-xcnt.mir create mode 100644 llvm/test/CodeGen/AMDGPU/waitcnt-trailing.mir create mode 100644 llvm/test/CodeGen/ARM/Windows/frexp.ll create mode 100644 llvm/test/CodeGen/ARM/cmp-select-sign.ll create mode 100644 llvm/test/CodeGen/ARM/frexp-soften-libcall-error.ll create mode 100644 llvm/test/CodeGen/ARM/ifcvt_unanalyzable_fallthrough.mir create mode 100644 llvm/test/CodeGen/ARM/powi-soften-libcall-error.ll create mode 100644 llvm/test/CodeGen/DirectX/BufferLoadInt64.ll create mode 100644 llvm/test/CodeGen/DirectX/BufferStoreInt64.ll create mode 100644 llvm/test/CodeGen/DirectX/CBufferAccess/memcpy.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-AddressU.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-AddressV.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-AddressW.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-BorderColor.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-ComparisonFunc.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-Filter.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-MaxAnisotropy.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-MaxLod.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-MinLod.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-MinLopBias.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-RegisterSpace.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-ShaderRegister.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers-Invalid-ShaderVisibility.ll create mode 100644 llvm/test/CodeGen/DirectX/ContainerData/RootSignature-StaticSamplers.ll create mode 100644 llvm/test/CodeGen/DirectX/issue-145408-gep-struct-fix.ll create mode 100644 llvm/test/CodeGen/DirectX/strip-rootsignatures.ll create mode 100644 llvm/test/CodeGen/Hexagon/hexagon-strcpy.ll create mode 100644 llvm/test/CodeGen/LoongArch/calling-conv-ilp32d.ll create mode 100644 llvm/test/CodeGen/LoongArch/lasx/ir-instruction/bitcast-extract-element.ll create mode 100644 llvm/test/CodeGen/LoongArch/lasx/ir-instruction/fix-xvshuf.ll create mode 100644 llvm/test/CodeGen/LoongArch/lasx/ir-instruction/insert-bitcast-element.ll create mode 100644 llvm/test/CodeGen/LoongArch/lasx/ir-instruction/insert-extract-element.ll create mode 100644 llvm/test/CodeGen/LoongArch/lasx/ir-instruction/insert-extract-pair-elements.ll create mode 100644 llvm/test/CodeGen/LoongArch/lsx/ir-instruction/bitcast-extract-element.ll create mode 100644 llvm/test/CodeGen/LoongArch/lsx/ir-instruction/insert-bitcast-element.ll create mode 100644 llvm/test/CodeGen/LoongArch/lsx/ir-instruction/insert-extract-element.ll create mode 100644 llvm/test/CodeGen/MSP430/powi-soften-libcall-error.ll create mode 100644 llvm/test/CodeGen/NVPTX/frameindex-lifetime.ll create mode 100644 llvm/test/CodeGen/PowerPC/builtins-bcd-transform.ll create mode 100644 llvm/test/CodeGen/PowerPC/crreduce-reg.mir create mode 100644 llvm/test/CodeGen/PowerPC/memintr32.ll create mode 100644 llvm/test/CodeGen/PowerPC/memintr64.ll create mode 100644 llvm/test/CodeGen/RISCV/pr145363.ll create mode 100644 llvm/test/CodeGen/RISCV/rvv/fixed-vectors-llround.ll create mode 100644 llvm/test/CodeGen/RISCV/rvv/fixed-vectors-lround.ll rename llvm/test/CodeGen/RISCV/rvv/{fixed-vectors-vp-reverser-float.ll => fixed-vectors-vp-reverse-float.ll} (71%) rename llvm/test/CodeGen/RISCV/rvv/{fixed-vectors-vp-reverser-int.ll => fixed-vectors-vp-reverse-int.ll} (100%) delete mode 100644 llvm/test/CodeGen/RISCV/rvv/rvv-peephole-vmerge-vops-mir.ll create mode 100644 llvm/test/CodeGen/RISCV/rvv/vmerge-peephole.mir create mode 100644 llvm/test/CodeGen/RISCV/xmips-cbop.ll create mode 100644 llvm/test/CodeGen/RISCV/xqcicm.ll create mode 100644 llvm/test/CodeGen/SPIRV/capability-FloatControl2.ll create mode 100644 llvm/test/CodeGen/SPIRV/hlsl-resources/MixedBufferLoadStore.ll create mode 100644 llvm/test/CodeGen/SPIRV/hlsl-resources/SignedBufferLoadStore.ll create mode 100644 llvm/test/CodeGen/SPIRV/hlsl-resources/UnsignedBufferLoadStore.ll rename llvm/test/{MC/GOFF/ppa1.ll => CodeGen/SystemZ/zos-ppa1.ll} (97%) create mode 100644 llvm/test/CodeGen/SystemZ/zos-section-1.ll create mode 100644 llvm/test/CodeGen/SystemZ/zos-section-2.ll create mode 100644 llvm/test/CodeGen/WebAssembly/debug-code-stackification.ll create mode 100644 llvm/test/CodeGen/WebAssembly/simd-illegal-bitmask.ll create mode 100644 llvm/test/CodeGen/WebAssembly/simd-setcc-reductions.ll create mode 100644 llvm/test/CodeGen/X86/GlobalISel/llvm.sincos.mir create mode 100644 llvm/test/CodeGen/X86/dag-combiner-fma-folding.ll create mode 100644 llvm/test/CodeGen/X86/frame-pointer-reserved.ll create mode 100644 llvm/test/CodeGen/X86/ms-secure-hotpatch-attr.ll create mode 100644 llvm/test/CodeGen/X86/ms-secure-hotpatch-bad-file.ll create mode 100644 llvm/test/CodeGen/X86/ms-secure-hotpatch-direct-global-access.ll create mode 100644 llvm/test/CodeGen/X86/ms-secure-hotpatch-functions-file.ll create mode 100644 llvm/test/CodeGen/X86/ms-secure-hotpatch-functions-list.ll create mode 100644 llvm/test/CodeGen/X86/x86-access-to-global.ll create mode 100644 llvm/test/CodeGen/Xtensa/invalid-tls.ll create mode 100644 llvm/test/CodeGen/Xtensa/select-cc-fp.ll create mode 100644 llvm/test/CodeGen/Xtensa/threadptr.ll create mode 100644 llvm/test/DebugInfo/KeyInstructions/Generic/link-two-modes.ll create mode 100644 llvm/test/DebugInfo/KeyInstructions/Generic/roundtrip.ll create mode 100644 llvm/test/DebugInfo/KeyInstructions/Generic/verify.ll create mode 100644 llvm/test/DebugInfo/KeyInstructions/X86/dwarf-inline-modes.mir create mode 100644 llvm/test/DebugInfo/MIR/AArch64/entry_value_gets_propagated_aarch64.mir create mode 100644 llvm/test/DebugInfo/MIR/X86/entry_value_clobbered_stack_copy.mir create mode 100644 llvm/test/DebugInfo/MIR/X86/entry_value_gets_propagated_X86.mir create mode 100644 llvm/test/FileCheck/var-escape.txt create mode 100644 llvm/test/Instrumentation/MemorySanitizer/or.ll create mode 100644 llvm/test/LTO/AArch64/module-asm.ll create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_ds.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_load_tr.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_unsupported.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vds_alias.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vflat.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vflat_alias.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vimage.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vimage_err.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop1-fake16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop1.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop1_dpp16-fake16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop1_dpp16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop1_dpp8-fake16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop1_dpp8.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop1_err.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3-fake16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3_err.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3_from_vop1-fake16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3_from_vop1.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3_from_vop1_dpp16-fake16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3_from_vop1_dpp16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3_from_vop1_dpp8-fake16.s create mode 100644 llvm/test/MC/AMDGPU/gfx1250_asm_vop3_from_vop1_dpp8.s create mode 100644 llvm/test/MC/AMDGPU/gfx9_asm_vop2_features.s create mode 100644 llvm/test/MC/ARM/Relocations/thumb-branch-out-of-range.s create mode 100644 llvm/test/MC/ARM/Relocations/thumb-branch.s delete mode 100644 llvm/test/MC/ARM/thumb-branches.s create mode 100644 llvm/test/MC/BPF/bad-tied.s create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_ds.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_load_tr.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vflat.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vimage.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vop1.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vop1_dpp16.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vop1_dpp8.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vop3.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vop3_from_vop1.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vop3_from_vop1_dpp16.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx1250_dasm_vop3_from_vop1_dpp8.txt create mode 100644 llvm/test/MC/Disassembler/AMDGPU/gfx9_vop2_features.txt create mode 100644 llvm/test/MC/Disassembler/Xtensa/dfpaccel.txt create mode 100644 llvm/test/MC/Disassembler/Xtensa/threadptr.txt delete mode 100644 llvm/test/MC/ELF/comdat.s create mode 100644 llvm/test/MC/ELF/group.s create mode 100644 llvm/test/MC/ELF/mc-dump.s create mode 100644 llvm/test/MC/RISCV/Relocations/mc-dump.s create mode 100644 llvm/test/MC/RISCV/rv32p-invalid.s create mode 100644 llvm/test/MC/RISCV/rv64p-invalid.s create mode 100644 llvm/test/MC/RISCV/xandesvsintload-valid.s create mode 100644 llvm/test/MC/X86/Relocations/x86-16.s create mode 100644 llvm/test/MC/X86/Relocations/x86-32.s create mode 100644 llvm/test/MC/X86/Relocations/x86-64.s create mode 100644 llvm/test/MC/X86/gotpcrel-non-globals.ll delete mode 100644 llvm/test/MC/X86/unused_reg_var_assign.s create mode 100644 llvm/test/MC/Xtensa/dfpaccel.s create mode 100644 llvm/test/MC/Xtensa/threadptr.s create mode 100644 llvm/test/Other/fatlto.ll create mode 100644 llvm/test/Other/pipeline-alias-errors.ll create mode 100644 llvm/test/TableGen/DecoderEmitterFnTable.td create mode 100644 llvm/test/TableGen/RuntimeLibcallEmitter.td create mode 100644 llvm/test/Transforms/Attributor/AMDGPU/tag-invariant-loads.ll create mode 100644 llvm/test/Transforms/CodeGenPrepare/X86/sink-addr-recreate.ll create mode 100644 llvm/test/Transforms/Coroutines/coro-split-dbg-labels.ll rename llvm/test/Transforms/Coroutines/{coro-split-no-lieftime.ll => coro-split-no-lifetime.ll} (100%) delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-dest-non-array.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-global-dest.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-non-byte-array.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-non-const-global.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-string-multi-use.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-1.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-2.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-lengths-dont-match.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-more-than-64-bytes.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-ptrtoint.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-struct-test.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-volatile.ll delete mode 100644 llvm/test/Transforms/GlobalOpt/ARM/lit.local.cfg create mode 100644 llvm/test/Transforms/InferAlignment/gep-recurrence.ll create mode 100644 llvm/test/Transforms/Inline/simplify-crosscallsite.ll create mode 100644 llvm/test/Transforms/InstCombine/SystemZ/lit.local.cfg create mode 100644 llvm/test/Transforms/InstCombine/SystemZ/printf-opt-alignment.ll create mode 100644 llvm/test/Transforms/InstCombine/binop-recurrence.ll create mode 100644 llvm/test/Transforms/InstCombine/fold-shuffle-ext.ll create mode 100644 llvm/test/Transforms/InstCombine/sub-after-sle-is-non-negative.ll create mode 100644 llvm/test/Transforms/InstCombine/vec_extract_through_broadcast.ll create mode 100644 llvm/test/Transforms/LICM/salvage-hoisted-minmax.ll create mode 100644 llvm/test/Transforms/LoopInterchange/position-in-pipeline.ll create mode 100644 llvm/test/Transforms/LoopVectorize/AArch64/licm-calls.ll create mode 100644 llvm/test/Transforms/LoopVectorize/AArch64/partial-reduce.ll create mode 100644 llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-to-widen-memory-derived-ivs.ll delete mode 100644 llvm/test/Transforms/LoopVectorize/RISCV/vplan-vp-select-intrinsics.ll delete mode 100644 llvm/test/Transforms/LoopVectorize/dereferenceable-info-from-assumption-variable-size.ll create mode 100644 llvm/test/Transforms/LoopVectorize/narrow-to-single-scalar.ll create mode 100644 llvm/test/Transforms/LoopVectorize/reuse-lcssa-phi-scev-expansion.ll create mode 100644 llvm/test/Transforms/LoopVectorize/single-early-exit-deref-assumptions.ll create mode 100644 llvm/test/Transforms/LoopVectorize/single-early-exit-interleave-hint.ll create mode 100644 llvm/test/Transforms/MergeICmps/X86/blockaddresses.ll create mode 100644 llvm/test/Transforms/PhaseOrdering/always-inline-alloca-promotion.ll create mode 100644 llvm/test/Transforms/PhaseOrdering/memset-dse.ll create mode 100644 llvm/test/Transforms/lower-builtin-allow-check-pipeline.ll create mode 100644 llvm/test/Verifier/branch-weight.ll create mode 100644 llvm/test/Verifier/dead-on-return.ll create mode 100644 llvm/test/Verifier/value-profile.ll create mode 100644 llvm/test/tools/llvm-debuginfo-analyzer/WebAssembly/wasm-32bit-tombstone.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/independent-load-stores.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/partially-overlapping-groups.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-aes.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-avx1.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-avx2.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-avxgfni.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-avxvnni.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-bmi2.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-clflushopt.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-clwb.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-cmov.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-cmpxchg.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-f16c.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-fma.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-fsgsbase.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-gfni.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-lea.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-lzcnt.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-mmx.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-movbe.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-pclmul.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-popcnt.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-prefetchw.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-rdrand.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-rdseed.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-sse1.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-sse2.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-sse3.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-sse41.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-sse42.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-ssse3.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-vaes.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-vpclmulqdq.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-x86_32.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-x86_64.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-x87.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/resources-xsave.s create mode 100644 llvm/test/tools/llvm-mca/X86/LunarlakeP/zero-idioms.s create mode 100644 llvm/test/tools/llvm-objcopy/COFF/string-table.test create mode 100644 llvm/test/tools/llvm-objdump/ELF/AArch64/symbolize-operands-executable.yaml create mode 100644 llvm/test/tools/llvm-objdump/ELF/AArch64/symbolize-operands-relocatable.s create mode 100644 llvm/test/tools/llvm-original-di-preservation/Inputs/expected-origin.html create mode 100644 llvm/test/tools/llvm-original-di-preservation/Inputs/origin.json create mode 100644 llvm/unittests/Frontend/OpenMPDirectiveNameParserTest.cpp create mode 100644 llvm/unittests/Frontend/OpenMPDirectiveNameTest.cpp create mode 100644 llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp create mode 100644 llvm/utils/gn/secondary/llvm/lib/DebugInfo/DWARF/LowLevel/BUILD.gn create mode 100644 mlir/include/mlir/Dialect/LLVMIR/XeVMDialect.h create mode 100644 mlir/include/mlir/Dialect/LLVMIR/XeVMOps.td create mode 100644 mlir/include/mlir/Dialect/OpenMP/OpenMPOpsAttributes.h create mode 100644 mlir/include/mlir/Dialect/OpenMP/OpenMPOpsEnums.h create mode 100644 mlir/include/mlir/Dialect/XeGPU/IR/XeGPUTargetInfo.h create mode 100644 mlir/include/mlir/Support/StateStack.h create mode 100644 mlir/include/mlir/Support/WalkResult.h create mode 100644 mlir/lib/Dialect/AMDGPU/Transforms/MaskedloadToLoad.cpp delete mode 100644 mlir/lib/Dialect/AMDGPU/Transforms/TransferReadToLoad.cpp rename mlir/lib/Dialect/ArmNeon/Transforms/{LowerContractionToSMMLAPattern.cpp => LowerContractionToNeonI8MMPattern.cpp} (59%) create mode 100644 mlir/lib/Dialect/EmitC/Transforms/WrapFuncInClass.cpp create mode 100644 mlir/lib/Dialect/LLVMIR/IR/XeVMDialect.cpp create mode 100644 mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp create mode 100644 mlir/lib/Dialect/Tosa/Transforms/TosaConvertIntegerTypeToSignless.cpp rename pstl/include/__pstl_memory => mlir/lib/Support/StateStack.cpp (61%) create mode 100644 mlir/python/mlir/dialects/TransformDebugExtensionOps.td create mode 100644 mlir/python/mlir/dialects/transform/debug.py create mode 100644 mlir/test/Conversion/AMDGPUToROCDL/transpose_load.mlir create mode 100644 mlir/test/Conversion/AMDGPUToROCDL/transpose_load_reject.mlir create mode 100644 mlir/test/Conversion/GPUToSPIRV/rotate.mlir rename mlir/test/Dialect/AMDGPU/{transfer-read-to-load.mlir => maskedload-to-load.mlir} (56%) create mode 100644 mlir/test/Dialect/Affine/simplify-min-max-ops.mlir create mode 100644 mlir/test/Dialect/ArmSVE/legalize-transfer-read.mlir create mode 100644 mlir/test/Dialect/EmitC/wrap_emitc_func_in_class.mlir create mode 100644 mlir/test/Dialect/EmitC/wrap_emitc_func_in_class_noAttr.mlir create mode 100644 mlir/test/Dialect/LLVMIR/xevm.mlir create mode 100644 mlir/test/Dialect/Tensor/reify-shapes.mlir create mode 100644 mlir/test/Dialect/Tosa/tosa-convert-integer-type-to-signless.mlir create mode 100644 mlir/test/Dialect/Tosa/tosa-validation-valid.mlir create mode 100644 mlir/test/Integration/Dialect/Vector/CPU/ArmNeon/vector-contract-i8mm.mlir create mode 100644 mlir/test/Integration/Dialect/Vector/CPU/ArmSVE/transfer-read-scalable-non-trailing.mlir create mode 100644 mlir/test/Target/LLVMIR/nvvm/elect.mlir create mode 100644 mlir/test/Target/LLVMIR/omptarget-debug-empty.mlir create mode 100644 mlir/test/Target/LLVMIR/omptarget-debug-map-link-loc.mlir create mode 100644 mlir/test/Target/LLVMIR/openmp-nested-task-target-parallel.mlir create mode 100644 mlir/test/Target/SPIRV/tensorARM.mlir create mode 100644 mlir/test/Transforms/make-composed-folded-affine-apply.mlir create mode 100644 mlir/test/mlir-translate/emitc_classops.mlir create mode 100644 mlir/test/python/dialects/transform_debug_ext.py create mode 100644 offload/test/mapping/duplicate_mappings_1.cpp create mode 100644 offload/test/mapping/duplicate_mappings_2.cpp create mode 100644 offload/test/offloading/disable_default_device.c create mode 100644 offload/test/ompTest/test/asserter-seq-test.cpp create mode 100644 offload/unittests/Conformance/CMakeLists.txt create mode 100644 offload/unittests/Conformance/device_code/CMakeLists.txt create mode 100644 offload/unittests/Conformance/device_code/sin.c create mode 100644 offload/unittests/Conformance/sin.cpp create mode 100644 offload/unittests/OffloadAPI/device_code/localmem.c create mode 100644 offload/unittests/OffloadAPI/device_code/localmem_reduction.c create mode 100644 offload/unittests/OffloadAPI/device_code/localmem_static.c create mode 100644 openmp/runtime/test/ompt/misc/lock_double_destroy.cpp delete mode 100644 pstl/.clang-format delete mode 100644 pstl/CMakeLists.txt delete mode 100644 pstl/CREDITS.txt delete mode 100644 pstl/LICENSE.TXT delete mode 100644 pstl/README.md delete mode 100644 pstl/cmake/ParallelSTLConfig.cmake.in delete mode 100644 pstl/docs/ReleaseNotes.rst delete mode 100644 pstl/include/__pstl_algorithm delete mode 100644 pstl/include/__pstl_config_site.in delete mode 100644 pstl/include/__pstl_execution delete mode 100644 pstl/include/__pstl_numeric delete mode 100644 pstl/include/pstl/internal/algorithm_fwd.h delete mode 100644 pstl/include/pstl/internal/algorithm_impl.h delete mode 100644 pstl/include/pstl/internal/execution_defs.h delete mode 100644 pstl/include/pstl/internal/execution_impl.h delete mode 100644 pstl/include/pstl/internal/glue_algorithm_defs.h delete mode 100644 pstl/include/pstl/internal/glue_algorithm_impl.h delete mode 100644 pstl/include/pstl/internal/glue_execution_defs.h delete mode 100644 pstl/include/pstl/internal/glue_memory_defs.h delete mode 100644 pstl/include/pstl/internal/glue_memory_impl.h delete mode 100644 pstl/include/pstl/internal/glue_numeric_defs.h delete mode 100644 pstl/include/pstl/internal/glue_numeric_impl.h delete mode 100644 pstl/include/pstl/internal/memory_impl.h delete mode 100644 pstl/include/pstl/internal/numeric_fwd.h delete mode 100644 pstl/include/pstl/internal/numeric_impl.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_for.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_for_each.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_invoke.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_merge.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_reduce.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_scan.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_stable_partial_sort.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_stable_sort.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_transform_reduce.h delete mode 100644 pstl/include/pstl/internal/omp/parallel_transform_scan.h delete mode 100644 pstl/include/pstl/internal/omp/util.h delete mode 100644 pstl/include/pstl/internal/parallel_backend.h delete mode 100644 pstl/include/pstl/internal/parallel_backend_omp.h delete mode 100644 pstl/include/pstl/internal/parallel_backend_serial.h delete mode 100644 pstl/include/pstl/internal/parallel_backend_tbb.h delete mode 100644 pstl/include/pstl/internal/parallel_backend_utils.h delete mode 100644 pstl/include/pstl/internal/parallel_impl.h delete mode 100644 pstl/include/pstl/internal/pstl_config.h delete mode 100644 pstl/include/pstl/internal/unseq_backend_simd.h delete mode 100644 pstl/include/pstl/internal/utils.h delete mode 100644 pstl/test/CMakeLists.txt delete mode 100644 pstl/test/pstl/header_inclusion_order_algorithm_0.pass.cpp delete mode 100644 pstl/test/pstl/header_inclusion_order_algorithm_1.pass.cpp delete mode 100644 pstl/test/pstl/header_inclusion_order_memory_0.pass.cpp delete mode 100644 pstl/test/pstl/header_inclusion_order_memory_1.pass.cpp delete mode 100644 pstl/test/pstl/header_inclusion_order_numeric_0.pass.cpp delete mode 100644 pstl/test/pstl/header_inclusion_order_numeric_1.pass.cpp delete mode 100644 pstl/test/pstl/version.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.merge/merge.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/alg.copy/copy_if.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/alg.partitions/partition_copy.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/alg.reverse/reverse_copy.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/copy_move.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/fill.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/generate.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/remove.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/remove_copy.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/replace.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/replace_copy.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/rotate.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/rotate_copy.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/swap_ranges.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/transform_binary.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/transform_unary.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/unique.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.modifying.operations/unique_copy_equal.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/adjacent_find.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/all_of.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/any_of.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/count.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/equal.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/find.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/find_end.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/find_first_of.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/find_if.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/for_each.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/mismatch.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/none_of.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/nth_element.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.nonmodifying/search_n.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/alg.heap.operations/is_heap.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/alg.lex.comparison/lexicographical_compare.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/alg.set.operations/includes.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/is_sorted.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/partial_sort.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/partial_sort_copy.pass.cpp delete mode 100644 pstl/test/std/algorithms/alg.sorting/sort.pass.cpp delete mode 100644 pstl/test/std/lit.local.cfg delete mode 100644 pstl/test/std/numerics/numeric.ops/adjacent_difference.pass.cpp delete mode 100644 pstl/test/std/numerics/numeric.ops/reduce.pass.cpp delete mode 100644 pstl/test/std/numerics/numeric.ops/scan.fail.cpp delete mode 100644 pstl/test/std/numerics/numeric.ops/scan.pass.cpp delete mode 100644 pstl/test/std/numerics/numeric.ops/transform_reduce.pass.cpp delete mode 100644 pstl/test/std/numerics/numeric.ops/transform_scan.pass.cpp delete mode 100644 pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_construct.pass.cpp delete mode 100644 pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_copy_move.pass.cpp delete mode 100644 pstl/test/std/utilities/memory/specialized.algorithms/uninitialized_fill_destroy.pass.cpp delete mode 100644 pstl/test/support/pstl_test_config.h delete mode 100644 pstl/test/support/stdlib/algorithm delete mode 100644 pstl/test/support/stdlib/execution delete mode 100644 pstl/test/support/stdlib/memory delete mode 100644 pstl/test/support/stdlib/numeric delete mode 100644 pstl/test/support/utils.h create mode 100644 utils/bazel/llvm-project-overlay/libc/test/src/wchar/BUILD.bazel create mode 100644 utils/bazel/third_party_build/pyyaml.BUILD diff --git a/.ci/compute_projects.py b/.ci/compute_projects.py index 80e4e0221b3d..c3cf714ce6c1 100644 --- a/.ci/compute_projects.py +++ b/.ci/compute_projects.py @@ -77,6 +77,7 @@ DEPENDENT_RUNTIMES_TO_TEST = { "clang": {"compiler-rt"}, "clang-tools-extra": {"libc"}, + "libc": {"libc"}, ".ci": {"compiler-rt", "libc"}, } DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = { diff --git a/.ci/compute_projects_test.py b/.ci/compute_projects_test.py index 5efac2636698..6299931e1ec3 100644 --- a/.ci/compute_projects_test.py +++ b/.ci/compute_projects_test.py @@ -187,7 +187,7 @@ def test_top_level_file(self): self.assertEqual(env_variables["runtimes_check_targets"], "") self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "") - def test_exclude_runtiems_in_projects(self): + def test_exclude_libcxx_in_projects(self): env_variables = compute_projects.get_env_variables( ["libcxx/CMakeLists.txt"], "Linux" ) @@ -197,6 +197,16 @@ def test_exclude_runtiems_in_projects(self): self.assertEqual(env_variables["runtimes_check_targets"], "") self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "") + def test_include_libc_in_runtimes(self): + env_variables = compute_projects.get_env_variables( + ["libc/CMakeLists.txt"], "Linux" + ) + self.assertEqual(env_variables["projects_to_build"], "clang;lld") + self.assertEqual(env_variables["project_check_targets"], "") + self.assertEqual(env_variables["runtimes_to_build"], "libc") + self.assertEqual(env_variables["runtimes_check_targets"], "check-libc") + self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "") + def test_exclude_docs(self): env_variables = compute_projects.get_env_variables( ["llvm/docs/CIBestPractices.rst"], "Linux" diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh index 89447963b852..8d1faab13986 100755 --- a/.ci/monolithic-linux.sh +++ b/.ci/monolithic-linux.sh @@ -56,7 +56,7 @@ runtime_targets_needs_reconfig="${5}" lit_args="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --use-unique-output-file-name --timeout=1200 --time-tests" -echo "--- cmake" +echo "::group::cmake" export PIP_BREAK_SYSTEM_PACKAGES=1 pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt @@ -85,38 +85,49 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ -D LLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON \ -D CMAKE_INSTALL_PREFIX="${INSTALL_DIR}" -echo "--- ninja" +echo "::endgroup::" +echo "::group::ninja" + # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} +echo "::endgroup::" + if [[ "${runtime_targets}" != "" ]]; then - echo "--- ninja runtimes" + echo "::group::ninja runtimes" ninja -C "${BUILD_DIR}" ${runtime_targets} + + echo "::endgroup::" fi # Compiling runtimes with just-built Clang and running their tests # as an additional testing for Clang. if [[ "${runtime_targets_needs_reconfig}" != "" ]]; then - echo "--- cmake runtimes C++26" + echo "::group::cmake runtimes C++26" cmake \ -D LIBCXX_TEST_PARAMS="std=c++26" \ -D LIBCXXABI_TEST_PARAMS="std=c++26" \ "${BUILD_DIR}" - echo "--- ninja runtimes C++26" + echo "::endgroup::" + echo "::group::ninja runtimes C++26" ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} - echo "--- cmake runtimes clang modules" + echo "::endgroup::" + echo "::group::cmake runtimes clang modules" cmake \ -D LIBCXX_TEST_PARAMS="enable_modules=clang" \ -D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \ "${BUILD_DIR}" - echo "--- ninja runtimes clang modules" + echo "::endgroup::" + echo "::group::ninja runtimes clang modules" ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} + + echo "::endgroup::" fi diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh index dc2913830e92..c27111bf5aa1 100755 --- a/.ci/monolithic-windows.sh +++ b/.ci/monolithic-windows.sh @@ -46,7 +46,7 @@ trap at-exit EXIT projects="${1}" targets="${2}" -echo "--- cmake" +echo "::group::cmake" pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt export CC=cl @@ -78,6 +78,10 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \ -D LLVM_PARALLEL_COMPILE_JOBS=${MAX_PARALLEL_COMPILE_JOBS} \ -D LLVM_PARALLEL_LINK_JOBS=${MAX_PARALLEL_LINK_JOBS} -echo "--- ninja" +echo "::endgroup::" +echo "::group::ninja" + # Targets are not escaped as they are passed as separate arguments. ninja -C "${BUILD_DIR}" -k 0 ${targets} + +echo "::endgroup" diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 000000000000..03748938700e --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,4 @@ +When performing a code review, pay close attention to code modifying a function's +control flow. Could the change result in the corruption of performance profile +data? Could the change result in invalid debug information, in particular for +branches and calls? diff --git a/.github/new-prs-labeler.yml b/.github/new-prs-labeler.yml index 2f8d5745668d..863090af9af7 100644 --- a/.github/new-prs-labeler.yml +++ b/.github/new-prs-labeler.yml @@ -632,6 +632,10 @@ llvm:instcombine: - llvm/test/Transforms/InstCombine/** - llvm/test/Transforms/InstSimplify/** +llvm:vectorcombine: + - llvm/lib/Transforms/Vectorize/VectorCombine.cpp + - llvm/test/Transforms/VectorCombine/** + clangd: - clang-tools-extra/clangd/** diff --git a/.github/workflows/hlsl-test-all.yaml b/.github/workflows/hlsl-test-all.yaml index 93a1c6d2662d..b6530fe11b84 100644 --- a/.github/workflows/hlsl-test-all.yaml +++ b/.github/workflows/hlsl-test-all.yaml @@ -43,13 +43,13 @@ jobs: - name: Checkout OffloadTest uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - repository: llvm-beanz/offload-test-suite + repository: llvm/offload-test-suite ref: main path: OffloadTest - name: Checkout Golden Images uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: - repository: llvm-beanz/offload-golden-images + repository: llvm/offload-golden-images ref: main path: golden-images - name: Setup Windows diff --git a/.github/workflows/libcxx-restart-preempted-jobs.yaml b/.github/workflows/libcxx-restart-preempted-jobs.yaml index 9706f0459922..accb84efb5c9 100644 --- a/.github/workflows/libcxx-restart-preempted-jobs.yaml +++ b/.github/workflows/libcxx-restart-preempted-jobs.yaml @@ -20,7 +20,7 @@ permissions: jobs: restart: - if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled') + if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure') name: "Restart Job" permissions: statuses: read @@ -32,7 +32,10 @@ jobs: uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1 with: script: | - const failure_regex = /Process completed with exit code 1./ + // The "The run was canceled by" message comes from a user manually canceling a workflow + // the "higher priority" message comes from github canceling a workflow because the user updated the change. + // And the "exit code 1" message indicates a genuine failure. + const failure_regex = /(Process completed with exit code 1.)/ const preemption_regex = /(The runner has received a shutdown signal)|(The operation was canceled)/ const wf_run = context.payload.workflow_run @@ -74,7 +77,7 @@ jobs: console.log('Check run was not completed. Skipping.'); continue; } - if (check_run.conclusion != 'failure' && check_run.conclusion != 'cancelled') { + if (check_run.conclusion != 'failure') { console.log('Check run had conclusion: ' + check_run.conclusion + '. Skipping.'); continue; } @@ -153,91 +156,3 @@ jobs: run_id: context.payload.workflow_run.id }) await create_check_run('success', 'Restarted workflow run due to preempted job') - - restart-test: - if: github.repository_owner == 'llvm' && (github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'cancelled') && github.event.actor.login == 'ldionne' # TESTING ONLY - name: "Restart Job (test)" - permissions: - statuses: read - checks: write - actions: write - runs-on: ubuntu-24.04 - steps: - - name: "Restart Job (test)" - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1 - with: - script: | - const FAILURE_REGEX = /Process completed with exit code 1./ - const PREEMPTION_REGEX = /(The runner has received a shutdown signal)|(The operation was canceled)/ - - function log(msg) { - core.notice(msg) - } - - const wf_run = context.payload.workflow_run - log(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`) - - log('Listing check runs for suite') - const check_suites = await github.rest.checks.listForSuite({ - owner: context.repo.owner, - repo: context.repo.repo, - check_suite_id: context.payload.workflow_run.check_suite_id, - per_page: 100 // FIXME: We don't have 100 check runs yet, but we should handle this better. - }) - - preemptions = []; - legitimate_failures = []; - for (check_run of check_suites.data.check_runs) { - log(`Checking check run: ${check_run.id}`); - if (check_run.status != 'completed') { - log('Check run was not completed. Skipping.'); - continue; - } - - if (check_run.conclusion != 'failure' && check_run.conclusion != 'cancelled') { - log(`Check run had conclusion: ${check_run.conclusion}. Skipping.`); - continue; - } - - annotations = await github.rest.checks.listAnnotations({ - owner: context.repo.owner, - repo: context.repo.repo, - check_run_id: check_run.id - }) - - preemption_annotation = annotations.data.find(function(annotation) { - return annotation.annotation_level == 'failure' && - annotation.message.match(PREEMPTION_REGEX) != null; - }); - if (preemption_annotation != null) { - log(`Found preemption message: ${preemption_annotation.message}`); - preemptions.push(check_run); - break; - } - - failure_annotation = annotations.data.find(function(annotation) { - return annotation.annotation_level == 'failure' && - annotation.message.match(FAILURE_REGEX) != null; - }); - if (failure_annotation != null) { - log(`Found legitimate failure annotation: ${failure_annotation.message}`); - legitimate_failures.push(check_run); - break; - } - } - - if (preemptions) { - log('Found some preempted jobs'); - if (legitimate_failures) { - log('Also found some legitimate failures, so not restarting the workflow.'); - } else { - log('Did not find any legitimate failures. Restarting workflow.'); - await github.rest.actions.reRunWorkflowFailedJobs({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id - }) - } - } else { - log('Did not find any preempted jobs. Not restarting the workflow.'); - } diff --git a/amd/comgr/include/amd_comgr.h.in b/amd/comgr/include/amd_comgr.h.in index 3c7df1c0901e..3f2f75586d61 100644 --- a/amd/comgr/include/amd_comgr.h.in +++ b/amd/comgr/include/amd_comgr.h.in @@ -1563,9 +1563,6 @@ amd_comgr_action_info_get_working_directory_path( * * @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p * action_info is an invalid action info object. - * - * @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES - * Unable to update action info object as out of resources. */ amd_comgr_status_t AMD_COMGR_API amd_comgr_action_info_set_logging( @@ -1584,9 +1581,6 @@ amd_comgr_action_info_set_logging( * * @retval ::AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT @p * action_info is an invalid action info object. @p logging is NULL. - * - * @retval ::AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES - * Unable to update the data object as out of resources. */ amd_comgr_status_t AMD_COMGR_API amd_comgr_action_info_get_logging( diff --git a/amd/comgr/src/comgr-compiler.cpp b/amd/comgr/src/comgr-compiler.cpp index 756513246f25..5e69d9b9cfab 100644 --- a/amd/comgr/src/comgr-compiler.cpp +++ b/amd/comgr/src/comgr-compiler.cpp @@ -810,10 +810,16 @@ amd_comgr_status_t AMDGPUCompiler::createTmpDirs() { return AMD_COMGR_STATUS_SUCCESS; } +amd_comgr_status_t AMDGPUCompiler::removeTmpDirs() { + if (TmpDir.empty()) { + return AMD_COMGR_STATUS_SUCCESS; + } + ProfilePoint Point("RemoveDir"); + +#ifdef _WIN32 // On windows fs::remove_directories takes huge time so use fs::remove. -amd_comgr_status_t removeDirectory(const StringRef DirName) { std::error_code EC; - for (fs::directory_iterator Dir(DirName, EC), DirEnd; Dir != DirEnd && !EC; + for (fs::directory_iterator Dir(TmpDir, EC), DirEnd; Dir != DirEnd && !EC; Dir.increment(EC)) { const StringRef Path = Dir->path(); @@ -843,25 +849,16 @@ amd_comgr_status_t removeDirectory(const StringRef DirName) { } } - if (fs::remove(DirName)) { + if (fs::remove(TmpDir)) { return AMD_COMGR_STATUS_ERROR; } return AMD_COMGR_STATUS_SUCCESS; -} - -amd_comgr_status_t AMDGPUCompiler::removeTmpDirs() { - if (TmpDir.empty()) { - return AMD_COMGR_STATUS_SUCCESS; - } - ProfilePoint Point("RemoveDir"); -#ifndef _WIN32 +#else if (fs::remove_directories(TmpDir)) { return AMD_COMGR_STATUS_ERROR; } return AMD_COMGR_STATUS_SUCCESS; -#else - return removeDirectory(TmpDir); #endif } diff --git a/amd/comgr/test-lit/CMakeLists.txt b/amd/comgr/test-lit/CMakeLists.txt index b7466b21be51..73966d7f3072 100644 --- a/amd/comgr/test-lit/CMakeLists.txt +++ b/amd/comgr/test-lit/CMakeLists.txt @@ -40,8 +40,11 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) add_comgr_lit_binary(source-to-bc-with-dev-libs c) add_comgr_lit_binary(spirv-translator c) -add_comgr_lit_binary(compile-minimal-test c) +add_comgr_lit_binary(compile-opencl-minimal c) add_comgr_lit_binary(spirv-to-reloc c) add_comgr_lit_binary(unbundle c) +add_comgr_lit_binary(get-version c) +add_comgr_lit_binary(status-string c) +add_comgr_lit_binary(data-action c) add_dependencies(check-comgr test-lit) diff --git a/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached-bad-dir.cl b/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached-bad-dir.cl index b8b9c48b227d..df6aa7f068f8 100644 --- a/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached-bad-dir.cl +++ b/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached-bad-dir.cl @@ -6,7 +6,7 @@ // RUN: AMD_COMGR_CACHE_DIR=%t.txt \ // RUN: AMD_COMGR_EMIT_VERBOSE_LOGS=1 \ // RUN: AMD_COMGR_REDIRECT_LOGS=%t.log \ -// RUN: compile-minimal-test %S/../compile-minimal-test.cl %t.bin +// RUN: compile-opencl-minimal %S/../compile-minimal-test.cl %t.bin 1.2 // RUN: llvm-objdump -d %t.bin | FileCheck %S/../compile-minimal-test.cl // RUN: FileCheck --check-prefix=BAD %s < %t.log // BAD: Failed to open cache file diff --git a/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached-bad-policy.cl b/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached-bad-policy.cl index f5962b8ac62f..c1f4bf35d5af 100644 --- a/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached-bad-policy.cl +++ b/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached-bad-policy.cl @@ -6,7 +6,7 @@ // RUN: AMD_COMGR_CACHE_POLICY="foo=2h" \ // RUN: AMD_COMGR_EMIT_VERBOSE_LOGS=1 \ // RUN: AMD_COMGR_REDIRECT_LOGS=%t.log \ -// RUN: compile-minimal-test %S/../compile-minimal-test.cl %t.bin +// RUN: compile-opencl-minimal %S/../compile-minimal-test.cl %t.bin 1.2 // RUN: llvm-objdump -d %t.bin | FileCheck %S/../compile-minimal-test.cl // RUN: FileCheck --check-prefix=BAD %s < %t.log // BAD: when parsing the cache policy: Unknown key: 'foo' diff --git a/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached.cl b/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached.cl index 06471b1d6088..546d6dfd4864 100644 --- a/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached.cl +++ b/amd/comgr/test-lit/cache-tests/compile-minimal-test-cached.cl @@ -1,16 +1,16 @@ // RUN: rm -fr %t.cache // // RUN: unset AMD_COMGR_CACHE -// RUN: AMD_COMGR_CACHE_DIR=%t.cache compile-minimal-test \ -// RUN: %S/../compile-minimal-test.cl %t.bin +// RUN: AMD_COMGR_CACHE_DIR=%t.cache compile-opencl-minimal \ +// RUN: %S/../compile-minimal-test.cl %t.bin 1.2 // RUN: llvm-objdump -d %t.bin | FileCheck %S/../compile-minimal-test.cl // RUN: [ -d %t.cache ] // // RUN: rm -fr %t.cache // // RUN: export AMD_COMGR_CACHE=0 -// RUN: AMD_COMGR_CACHE_DIR=%t.cache compile-minimal-test \ -// RUN: %S/../compile-minimal-test.cl %t.bin +// RUN: AMD_COMGR_CACHE_DIR=%t.cache compile-opencl-minimal \ +// RUN: %S/../compile-minimal-test.cl %t.bin 1.2 // RUN: llvm-objdump -d %t.bin | FileCheck %S/../compile-minimal-test.cl // RUN: [ ! -d %t.cache ] // @@ -19,8 +19,8 @@ // COM: Run once and check that the cache directory exists and it has more than // COM 1 element (one for the cache tag, one or more for the cached // COM: commands) -// RUN: AMD_COMGR_CACHE_DIR=%t.cache compile-minimal-test \ -// RUN: %S/../compile-minimal-test.cl %t_a.bin +// RUN: AMD_COMGR_CACHE_DIR=%t.cache compile-opencl-minimal \ +// RUN: %S/../compile-minimal-test.cl %t_a.bin 1.2 // RUN: llvm-objdump -d %t_a.bin | FileCheck %S/../compile-minimal-test.cl // RUN: COUNT_BEFORE=$(ls "%t.cache" | wc -l) @@ -28,8 +28,8 @@ // COM: elements for src->bc since we currently not support it. // RUN: [ 3 -eq $COUNT_BEFORE ] // -// RUN: AMD_COMGR_CACHE_DIR=%t.cache compile-minimal-test \ -// RUN: %S/../compile-minimal-test.cl %t_b.bin +// RUN: AMD_COMGR_CACHE_DIR=%t.cache compile-opencl-minimal \ +// RUN: %S/../compile-minimal-test.cl %t_b.bin 1.2 // RUN: llvm-objdump -d %t_b.bin | FileCheck %S/../compile-minimal-test.cl // RUN: COUNT_AFTER=$(ls "%t.cache" | wc -l) // RUN: [ $COUNT_AFTER = $COUNT_BEFORE ] diff --git a/amd/comgr/test-lit/comgr-sources/common.h b/amd/comgr/test-lit/comgr-sources/common.h index 8f95bfcc2eae..130d25f685da 100644 --- a/amd/comgr/test-lit/comgr-sources/common.h +++ b/amd/comgr/test-lit/comgr-sources/common.h @@ -38,6 +38,17 @@ } \ } while (false) +#define fail_amd_comgr_(call) \ + do { \ + amd_comgr_status_t status = amd_comgr_##call; \ + if (status == AMD_COMGR_STATUS_SUCCESS) { \ + const char *reason = ""; \ + amd_comgr_status_string(status, &reason); \ + fail(#call " expected fail: %s\n file, line: %s, %d\n", reason, \ + __FILE__, __LINE__); \ + } \ + } while (false) + static void fail(const char *format, ...) { va_list ap; va_start(ap, format); diff --git a/amd/comgr/test-lit/comgr-sources/compile-minimal-test.c b/amd/comgr/test-lit/comgr-sources/compile-opencl-minimal.c similarity index 92% rename from amd/comgr/test-lit/comgr-sources/compile-minimal-test.c rename to amd/comgr/test-lit/comgr-sources/compile-opencl-minimal.c index d7a33045b482..a5a69167a7dc 100644 --- a/amd/comgr/test-lit/comgr-sources/compile-minimal-test.c +++ b/amd/comgr/test-lit/comgr-sources/compile-opencl-minimal.c @@ -1,4 +1,4 @@ -//===- compile-minimal-test.c ---------------------------------------------===// +//===- compile-opencl-minimal.c -------------------------------------------===// // // Part of Comgr, under the Apache License v2.0 with LLVM Exceptions. See // amd/comgr/LICENSE.TXT in this repository for license information. @@ -26,6 +26,16 @@ int main(int argc, char *argv[]) { SizeSource = setBuf(argv[1], &BufSource); + amd_comgr_language_t OpenCLVersion; + if (strcmp(argv[3], "1.2")) { + OpenCLVersion = AMD_COMGR_LANGUAGE_OPENCL_1_2; + } + else if (strcmp(argv[3], "2.0")) { + OpenCLVersion = AMD_COMGR_LANGUAGE_OPENCL_1_2; + } + else + fail("unsupported OCL version: %s", argv[3]); + amd_comgr_(create_data_set(&DataSetIn)); amd_comgr_(create_data(AMD_COMGR_DATA_KIND_SOURCE, &DataSource)); amd_comgr_(set_data(DataSource, SizeSource, BufSource)); diff --git a/amd/comgr/test-lit/comgr-sources/data-action.c b/amd/comgr/test-lit/comgr-sources/data-action.c new file mode 100644 index 000000000000..13cb24c65890 --- /dev/null +++ b/amd/comgr/test-lit/comgr-sources/data-action.c @@ -0,0 +1,129 @@ +//===- compile-minimal-test.c ---------------------------------------------===// +// +// Part of Comgr, under the Apache License v2.0 with LLVM Exceptions. See +// amd/comgr/LICENSE.TXT in this repository for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "amd_comgr.h" +#include "common.h" +#include +#include +#include + +int main(int argc, char *argv[]) { + amd_comgr_action_info_t DataAction; + amd_comgr_(create_action_info(&DataAction)); + + // ---- set_language, get_language + amd_comgr_language_t Language; + amd_comgr_( + action_info_set_language(DataAction, AMD_COMGR_LANGUAGE_NONE)); + amd_comgr_(action_info_get_language(DataAction, &Language)); + if (Language != AMD_COMGR_LANGUAGE_NONE) + fail("AMD_COMGR_LANGUAGE_NONE not returned!"); + + amd_comgr_( + action_info_set_language(DataAction, AMD_COMGR_LANGUAGE_OPENCL_1_2)); + amd_comgr_(action_info_get_language(DataAction, &Language)); + if (Language != AMD_COMGR_LANGUAGE_OPENCL_1_2) + fail("AMD_COMGR_LANGUAGE_OPENCL_1_2 not returned!"); + + amd_comgr_( + action_info_set_language(DataAction, AMD_COMGR_LANGUAGE_OPENCL_2_0)); + amd_comgr_(action_info_get_language(DataAction, &Language)); + if (Language != AMD_COMGR_LANGUAGE_OPENCL_2_0) + fail("AMD_COMGR_LANGUAGE_OPENCL_2_0 not returned!"); + + amd_comgr_( + action_info_set_language(DataAction, AMD_COMGR_LANGUAGE_HIP)); + amd_comgr_(action_info_get_language(DataAction, &Language)); + if (Language != AMD_COMGR_LANGUAGE_HIP) + fail("AMD_COMGR_LANGUAGE_HIP not returned!"); + + amd_comgr_( + action_info_set_language(DataAction, AMD_COMGR_LANGUAGE_LLVM_IR)); + amd_comgr_(action_info_get_language(DataAction, &Language)); + if (Language != AMD_COMGR_LANGUAGE_LLVM_IR) + fail("AMD_COMGR_LANGUAGE_LLVM_IR not returned!"); + + // ---- set_isa_name, get_isa_name + // Tested in comgr/test/get_data_isa_name_test.c + + // ---- set_option_list, get_option_list_count, get_option_list_item + const char *Options[] = {"foo", "bar", "bazqux", "aaaaaaaaaaaaaaaaaaaaa"}; + size_t OptionsCount = sizeof(Options) / sizeof(Options[0]); + + amd_comgr_(action_info_set_option_list(DataAction, Options, OptionsCount)); + + size_t ActualCount; + amd_comgr_(action_info_get_option_list_count(DataAction, &ActualCount)); + + if (OptionsCount != ActualCount) { + fail("incorrect option count: expected %zu, saw %zu", OptionsCount, + ActualCount); + } + + size_t Size; + for (size_t I = 0; I < OptionsCount; ++I) { + amd_comgr_(action_info_get_option_list_item(DataAction, I, &Size, NULL)); + + char *Option = calloc(Size, sizeof(char)); + amd_comgr_(action_info_get_option_list_item(DataAction, I, &Size, Option)); + + if (strcmp(Options[I], Option)) { + fail("incorrect option string: expected '%s', saw '%s'", Options[I], + Option); + } + free(Option); + } + + fail_amd_comgr_(action_info_get_option_list_item(DataAction, OptionsCount, + &Size, NULL)); + fail_amd_comgr_(action_info_get_option_list_count(DataAction, NULL)); + fail_amd_comgr_(action_info_get_option_list_item(DataAction, 0, NULL, NULL)); + + // ---- set_bundle_entry_ids, get_bundle_entry_id_count, get_bundle_entry_id + // Tested in comgr/test/unbundle-hip-test.c + + // ---- set_working_directory_path, get_working_directory_path + const char *Path = "/path/to/my/directory"; + amd_comgr_(action_info_set_working_directory_path(DataAction, Path)); + + amd_comgr_(action_info_get_working_directory_path(DataAction, &Size, + NULL)); + char *GetPath = calloc(Size, sizeof(char)); + amd_comgr_(action_info_get_working_directory_path(DataAction, &Size, + GetPath)); + + if (strcmp(Path, GetPath)) + fail("incorrect path string: expected '%s', saw '%s'", Path, GetPath); + free(GetPath); + + // ---- set_logging, get_logging + amd_comgr_(action_info_set_logging(DataAction, true)); + + bool GetLogging; + amd_comgr_(action_info_get_logging(DataAction, &GetLogging)); + + if (!GetLogging) + fail("incorrect logging boolean: expected 'true', saw 'false'"); + + amd_comgr_(action_info_set_logging(DataAction, false)); + amd_comgr_(action_info_get_logging(DataAction, &GetLogging)); + + if (GetLogging) + fail("incorrect logging boolean: expected 'false', saw 'true'"); + + // ---- set_device_lib_linking + amd_comgr_(action_info_set_device_lib_linking(DataAction, true)); + amd_comgr_(action_info_set_device_lib_linking(DataAction, false)); + + // ---- set_vfs + amd_comgr_(action_info_set_vfs(DataAction, true)); + amd_comgr_(action_info_set_vfs(DataAction, false)); + + amd_comgr_(destroy_action_info(DataAction)); + return 0; +} diff --git a/amd/comgr/test-lit/comgr-sources/get-version.c b/amd/comgr/test-lit/comgr-sources/get-version.c new file mode 100644 index 000000000000..2af958848239 --- /dev/null +++ b/amd/comgr/test-lit/comgr-sources/get-version.c @@ -0,0 +1,25 @@ +//===- get-version.c ------------------------------------------------------===// +// +// Part of Comgr, under the Apache License v2.0 with LLVM Exceptions. See +// amd/comgr/LICENSE.TXT in this repository for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "amd_comgr.h" +#include "common.h" + +int main(int argc, char *argv[]) { + + size_t *Major = malloc(sizeof(size_t)); + size_t *Minor = malloc(sizeof(size_t)); + + amd_comgr_get_version(Major, Minor); + + if (*Major != 3 || *Minor != 0) + fail("incorrect version: expected 3.0, saw %d, %d", *Major, *Minor); + + free(Major); + free(Minor); + return 0; +} diff --git a/amd/comgr/test-lit/comgr-sources/status-string.c b/amd/comgr/test-lit/comgr-sources/status-string.c new file mode 100644 index 000000000000..ffad82be9c9a --- /dev/null +++ b/amd/comgr/test-lit/comgr-sources/status-string.c @@ -0,0 +1,42 @@ +//===- status-string.c ----------------------------------------------------===// +// +// Part of Comgr, under the Apache License v2.0 with LLVM Exceptions. See +// amd/comgr/LICENSE.TXT in this repository for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "amd_comgr.h" +#include "common.h" +#include +#include +#include + +int main(int argc, char *argv[]) { + const char *StatusString = malloc(sizeof(char) * 100); + amd_comgr_(status_string(AMD_COMGR_STATUS_SUCCESS, &StatusString)); + if (strcmp(StatusString, "SUCCESS")) + fail("incorrect status: expected 'SUCCESS', saw '%s'", StatusString); + + amd_comgr_(status_string(AMD_COMGR_STATUS_ERROR, &StatusString)); + if (strcmp(StatusString, "ERROR")) + fail("incorrect status: expected 'ERROR', saw '%s'", StatusString); + + amd_comgr_(status_string(AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT, + &StatusString)); + if (strcmp(StatusString, "INVALID_ARGUMENT")) { + fail("incorrect status: expected 'INVALID_ARGUMENT', saw '%s'", + StatusString); + } + + amd_comgr_(status_string(AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES, + &StatusString)); + if (strcmp(StatusString, "OUT_OF_RESOURCES")) { + fail("incorrect status: expected 'OUT_OF_RESOURCES', saw '%s'", + StatusString); + } + + fail_amd_comgr_(status_string(-1, &StatusString)); + free(StatusString); + return 0; +} diff --git a/amd/comgr/test-lit/compile-minimal-test.cl b/amd/comgr/test-lit/compile-minimal-test.cl index 460692d1ce61..3f09758519d4 100644 --- a/amd/comgr/test-lit/compile-minimal-test.cl +++ b/amd/comgr/test-lit/compile-minimal-test.cl @@ -1,6 +1,6 @@ // COM: Run Comgr binary to compile OpenCL source into LLVM IR Bitcode, // COM: and, then generate an executable -// RUN: compile-minimal-test %s %t.bin +// RUN: compile-opencl-minimal %s %t.bin 1.2 // COM: Dissasemble // RUN: llvm-objdump -d %t.bin | FileCheck %s diff --git a/amd/comgr/test-lit/compile-opencl-2.cl b/amd/comgr/test-lit/compile-opencl-2.cl new file mode 100644 index 000000000000..67d7164f69b4 --- /dev/null +++ b/amd/comgr/test-lit/compile-opencl-2.cl @@ -0,0 +1,12 @@ +// COM: Run Comgr binary to compile OpenCL source into LLVM IR Bitcode, +// COM: and, then generate an executable +// RUN: compile-opencl-minimal %s %t.bin 2.0 + +// COM: Dissasemble +// RUN: llvm-objdump -d %t.bin | FileCheck %s +// CHECK: : +// CHECK: s_endpgm + +void kernel add(__global float *A, __global float *B, __global float *C) { + *C = *A + *B; +} diff --git a/amd/comgr/test-lit/data-action.c b/amd/comgr/test-lit/data-action.c new file mode 100644 index 000000000000..0df24cc3148c --- /dev/null +++ b/amd/comgr/test-lit/data-action.c @@ -0,0 +1,2 @@ +// COM: Run Comgr binary test data action APIs +// RUN: data-action diff --git a/amd/comgr/test-lit/get-version.c b/amd/comgr/test-lit/get-version.c new file mode 100644 index 000000000000..d5b3cf63d2fa --- /dev/null +++ b/amd/comgr/test-lit/get-version.c @@ -0,0 +1,2 @@ +// COM: Test Comgr get_version() API +// RUN: get-version diff --git a/amd/comgr/test-lit/status-string.c b/amd/comgr/test-lit/status-string.c new file mode 100644 index 000000000000..6e04df4d8ca1 --- /dev/null +++ b/amd/comgr/test-lit/status-string.c @@ -0,0 +1,2 @@ +// COM: Check the Comgr status string API +// RUN: status-string diff --git a/amd/comgr/test-lit/time-statistics.cl b/amd/comgr/test-lit/time-statistics.cl index 5881e3787984..2e546b2c434e 100644 --- a/amd/comgr/test-lit/time-statistics.cl +++ b/amd/comgr/test-lit/time-statistics.cl @@ -1,5 +1,5 @@ // COM: Check for any runtime errors with the Comgr Profilier -// RUN: AMD_COMGR_TIME_STATISTICS=1 compile-minimal-test %s %t.bin +// RUN: AMD_COMGR_TIME_STATISTICS=1 compile-opencl-minimal %s %t.bin 1.2 // RUN: test -f PerfStatsLog.txt void kernel add(__global float *A, __global float *B, __global float *C) { diff --git a/amd/comgr/test/CMakeLists.txt b/amd/comgr/test/CMakeLists.txt index 4d6d15e32ed1..1899e3cb2540 100644 --- a/amd/comgr/test/CMakeLists.txt +++ b/amd/comgr/test/CMakeLists.txt @@ -227,7 +227,6 @@ add_comgr_test(link_test c) add_comgr_test(isa_name_parsing_test c) add_comgr_test(get_data_isa_name_test c) add_comgr_test(include_subdirectory_test c) -add_comgr_test(options_test c) add_comgr_test(demangle_test c) add_comgr_test(fail_to_build_driver c) add_comgr_test(file_map c) diff --git a/amd/comgr/test/compile_source_with_device_libs_to_bc_test.c b/amd/comgr/test/compile_source_with_device_libs_to_bc_test.c index 78dd46e9b118..802d726cb95b 100644 --- a/amd/comgr/test/compile_source_with_device_libs_to_bc_test.c +++ b/amd/comgr/test/compile_source_with_device_libs_to_bc_test.c @@ -16,8 +16,8 @@ int main(int argc, char *argv[]) { char *BufSource; size_t SizeSource; amd_comgr_data_t DataSource; - amd_comgr_data_set_t DataSetIn, DataSetPch, DataSetBc, DataSetLinked, - DataSetReloc, DataSetExec; + amd_comgr_data_set_t DataSetIn, DataSetBc, DataSetLinked, DataSetReloc, + DataSetExec; amd_comgr_action_info_t DataAction; amd_comgr_status_t Status; const char *CodeGenOptions[] = {"-mcode-object-version=5", "-mllvm", @@ -48,25 +48,6 @@ int main(int argc, char *argv[]) { "amdgcn-amd-amdhsa--gfx900"); checkError(Status, "amd_comgr_action_info_set_isa_name"); - Status = amd_comgr_create_data_set(&DataSetPch); - checkError(Status, "amd_comgr_create_data_set"); - - Status = amd_comgr_do_action(AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS, - DataAction, DataSetIn, DataSetPch); - checkError(Status, "amd_comgr_do_action"); - - size_t Count; - Status = amd_comgr_action_data_count( - DataSetPch, AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER, &Count); - checkError(Status, "amd_comgr_action_data_count"); - - if (Count != 0) { - printf("AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS Failed: " - "produced %zu precompiled header objects (expected 0)\n", - Count); - exit(1); - } - Status = amd_comgr_create_data_set(&DataSetBc); checkError(Status, "amd_comgr_create_data_set"); @@ -76,9 +57,10 @@ int main(int argc, char *argv[]) { Status = amd_comgr_do_action( AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC, DataAction, - DataSetPch, DataSetBc); + DataSetIn, DataSetBc); checkError(Status, "amd_comgr_do_action"); + size_t Count; Status = amd_comgr_action_data_count(DataSetBc, AMD_COMGR_DATA_KIND_BC, &Count); checkError(Status, "amd_comgr_action_data_count"); @@ -151,8 +133,6 @@ int main(int argc, char *argv[]) { checkError(Status, "amd_comgr_release_data"); Status = amd_comgr_destroy_data_set(DataSetIn); checkError(Status, "amd_comgr_destroy_data_set"); - Status = amd_comgr_destroy_data_set(DataSetPch); - checkError(Status, "amd_comgr_destroy_data_set"); Status = amd_comgr_destroy_data_set(DataSetBc); checkError(Status, "amd_comgr_destroy_data_set"); Status = amd_comgr_destroy_data_set(DataSetLinked); diff --git a/amd/comgr/test/compile_source_with_device_libs_to_bc_with_vfs_test.c b/amd/comgr/test/compile_source_with_device_libs_to_bc_with_vfs_test.c index 1d355017d6d9..1c98243f6305 100644 --- a/amd/comgr/test/compile_source_with_device_libs_to_bc_with_vfs_test.c +++ b/amd/comgr/test/compile_source_with_device_libs_to_bc_with_vfs_test.c @@ -16,8 +16,8 @@ int main(int argc, char *argv[]) { char *BufSource; size_t SizeSource; amd_comgr_data_t DataSource; - amd_comgr_data_set_t DataSetIn, DataSetPch, DataSetBc, DataSetLinked, - DataSetReloc, DataSetExec; + amd_comgr_data_set_t DataSetIn, DataSetBc, DataSetLinked, DataSetReloc, + DataSetExec; amd_comgr_action_info_t DataAction; amd_comgr_status_t Status; const char *CodeGenOptions[] = {"-mcode-object-version=5", "-mllvm", @@ -51,25 +51,6 @@ int main(int argc, char *argv[]) { Status = amd_comgr_action_info_set_vfs(DataAction, true); checkError(Status, "amd_comgr_action_info_set_vfs"); - Status = amd_comgr_create_data_set(&DataSetPch); - checkError(Status, "amd_comgr_create_data_set"); - - Status = amd_comgr_do_action(AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS, - DataAction, DataSetIn, DataSetPch); - checkError(Status, "amd_comgr_do_action"); - - size_t Count; - Status = amd_comgr_action_data_count( - DataSetPch, AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER, &Count); - checkError(Status, "amd_comgr_action_data_count"); - - if (Count != 0) { - printf("AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS Failed: " - "produced %zu precompiled header objects (expected 0)\n", - Count); - exit(1); - } - Status = amd_comgr_create_data_set(&DataSetBc); checkError(Status, "amd_comgr_create_data_set"); @@ -79,9 +60,10 @@ int main(int argc, char *argv[]) { Status = amd_comgr_do_action( AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC, DataAction, - DataSetPch, DataSetBc); + DataSetIn, DataSetBc); checkError(Status, "amd_comgr_do_action"); + size_t Count; Status = amd_comgr_action_data_count(DataSetBc, AMD_COMGR_DATA_KIND_BC, &Count); checkError(Status, "amd_comgr_action_data_count"); @@ -154,8 +136,6 @@ int main(int argc, char *argv[]) { checkError(Status, "amd_comgr_release_data"); Status = amd_comgr_destroy_data_set(DataSetIn); checkError(Status, "amd_comgr_destroy_data_set"); - Status = amd_comgr_destroy_data_set(DataSetPch); - checkError(Status, "amd_comgr_destroy_data_set"); Status = amd_comgr_destroy_data_set(DataSetBc); checkError(Status, "amd_comgr_destroy_data_set"); Status = amd_comgr_destroy_data_set(DataSetLinked); diff --git a/amd/comgr/test/options_test.c b/amd/comgr/test/options_test.c deleted file mode 100644 index 9d54ffff8466..000000000000 --- a/amd/comgr/test/options_test.c +++ /dev/null @@ -1,66 +0,0 @@ -//===- options_test.c -----------------------------------------------------===// -// -// Part of Comgr, under the Apache License v2.0 with LLVM Exceptions. See -// amd/comgr/LICENSE.TXT in this repository for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "amd_comgr.h" -#include "common.h" -#include -#include -#include - -void testList(amd_comgr_action_info_t ActionInfo, const char *Options[], - size_t Count) { - size_t ActualCount; - amd_comgr_status_t Status; - - Status = amd_comgr_action_info_set_option_list(ActionInfo, Options, Count); - checkError(Status, "amd_comgr_action_info_set_option_list"); - - Status = - amd_comgr_action_info_get_option_list_count(ActionInfo, &ActualCount); - checkError(Status, "amd_comgr_action_info_get_option_list_count"); - - if (Count != ActualCount) { - fail("incorrect option count: expected %zu, saw %zu", Count, ActualCount); - } - - for (size_t I = 0; I < Count; ++I) { - size_t Size; - Status = - amd_comgr_action_info_get_option_list_item(ActionInfo, I, &Size, NULL); - checkError(Status, "amd_comgr_action_info_get_option_list_item"); - char *Option = calloc(Size, sizeof(char)); - Status = amd_comgr_action_info_get_option_list_item(ActionInfo, I, &Size, - Option); - checkError(Status, "amd_comgr_action_info_get_option_list_item"); - if (strcmp(Options[I], Option)) { - fail("incorrect option string: expected '%s', saw '%s'", Options[I], - Option); - } - free(Option); - } -} - -int main(int argc, char *argv[]) { - amd_comgr_action_info_t ActionInfo; - amd_comgr_status_t Status; - - Status = amd_comgr_create_action_info(&ActionInfo); - checkError(Status, "amd_comgr_create_action_info"); - - const char *Options[] = {"foo", "bar", "bazqux", "aaaaaaaaaaaaaaaaaaaaa"}; - size_t OptionsCount = sizeof(Options) / sizeof(Options[0]); - - for (size_t I = 0; I <= OptionsCount; ++I) { - for (size_t J = 0; I + J <= OptionsCount; ++J) { - testList(ActionInfo, Options + I, J); - } - } - - Status = amd_comgr_destroy_action_info(ActionInfo); - checkError(Status, "amd_comgr_destroy_action_info"); -} diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h index 64e524e2f13d..91ecf89da618 100644 --- a/bolt/include/bolt/Core/BinaryContext.h +++ b/bolt/include/bolt/Core/BinaryContext.h @@ -73,14 +73,15 @@ struct SegmentInfo { uint64_t FileSize; /// Size in file. uint64_t Alignment; /// Alignment of the segment. bool IsExecutable; /// Is the executable bit set on the Segment? + bool IsWritable; /// Is the segment writable. void print(raw_ostream &OS) const { OS << "SegmentInfo { Address: 0x" << Twine::utohexstr(Address) << ", Size: 0x" << Twine::utohexstr(Size) << ", FileOffset: 0x" << Twine::utohexstr(FileOffset) << ", FileSize: 0x" << Twine::utohexstr(FileSize) << ", Alignment: 0x" - << Twine::utohexstr(Alignment) << ", " << (IsExecutable ? "x" : " ") - << "}"; + << Twine::utohexstr(Alignment) << ", " << (IsExecutable ? "x" : "") + << (IsWritable ? "w" : "") << " }"; }; }; @@ -333,9 +334,14 @@ class BinaryContext { std::optional Source, unsigned CUID, unsigned DWARFVersion); + /// Input file segment info + /// /// [start memory address] -> [segment info] mapping. std::map SegmentMapInfo; + /// Newly created segments. + std::vector NewSegments; + /// Symbols that are expected to be undefined in MCContext during emission. std::unordered_set UndefinedSymbols; diff --git a/bolt/include/bolt/Core/BinarySection.h b/bolt/include/bolt/Core/BinarySection.h index ad2fed2cf27e..154a8d12de5c 100644 --- a/bolt/include/bolt/Core/BinarySection.h +++ b/bolt/include/bolt/Core/BinarySection.h @@ -523,11 +523,6 @@ inline uint8_t *copyByteArray(const uint8_t *Data, uint64_t Size) { return Array; } -inline uint8_t *copyByteArray(StringRef Buffer) { - return copyByteArray(reinterpret_cast(Buffer.data()), - Buffer.size()); -} - inline uint8_t *copyByteArray(ArrayRef Buffer) { return copyByteArray(reinterpret_cast(Buffer.data()), Buffer.size()); diff --git a/bolt/include/bolt/Core/MCPlusBuilder.h b/bolt/include/bolt/Core/MCPlusBuilder.h index 804100db8079..b99cf8b40ef5 100644 --- a/bolt/include/bolt/Core/MCPlusBuilder.h +++ b/bolt/include/bolt/Core/MCPlusBuilder.h @@ -1393,7 +1393,7 @@ class MCPlusBuilder { return getTargetSymbol(BinaryExpr->getLHS()); auto *SymbolRefExpr = dyn_cast(Expr); - if (SymbolRefExpr && SymbolRefExpr->getKind() == MCSymbolRefExpr::VK_None) + if (SymbolRefExpr && SymbolRefExpr->getSpecifier() == 0) return &SymbolRefExpr->getSymbol(); return nullptr; diff --git a/bolt/include/bolt/Profile/DataAggregator.h b/bolt/include/bolt/Profile/DataAggregator.h index cc28a06c151e..c7400b0d45ca 100644 --- a/bolt/include/bolt/Profile/DataAggregator.h +++ b/bolt/include/bolt/Profile/DataAggregator.h @@ -236,8 +236,7 @@ class DataAggregator : public DataReader { /// Launch a perf subprocess with given args and save output for later /// parsing. - void launchPerfProcess(StringRef Name, PerfProcessInfo &PPI, - const char *ArgsString, bool Wait); + void launchPerfProcess(StringRef Name, PerfProcessInfo &PPI, StringRef Args); /// Delete all temporary files created to hold the output generated by spawned /// subprocesses during the aggregation job @@ -374,6 +373,9 @@ class DataAggregator : public DataReader { /// Parse a single pair of binary full path and associated build-id std::optional> parseNameBuildIDPair(); + /// Coordinate reading and parsing of perf.data file + void parsePerfData(BinaryContext &BC); + /// Coordinate reading and parsing of pre-aggregated file /// /// The regular perf2bolt aggregation job is to read perf output directly. diff --git a/bolt/include/bolt/Rewrite/RewriteInstance.h b/bolt/include/bolt/Rewrite/RewriteInstance.h index 94dd06e91d6b..91d62a78de39 100644 --- a/bolt/include/bolt/Rewrite/RewriteInstance.h +++ b/bolt/include/bolt/Rewrite/RewriteInstance.h @@ -202,6 +202,9 @@ class RewriteInstance { /// Map code sections generated by BOLT. void mapCodeSections(BOLTLinker::SectionMapper MapSection); + /// Map code without relocating sections. + void mapCodeSectionsInPlace(BOLTLinker::SectionMapper MapSection); + /// Map the rest of allocatable sections. void mapAllocatableSections(BOLTLinker::SectionMapper MapSection); @@ -297,6 +300,9 @@ class RewriteInstance { return FUNC(ELF64BE); \ } + /// Update loadable segment information based on new sections. + void updateSegmentInfo(); + /// Patch ELF book-keeping info. void patchELFPHDRTable(); diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp index b998d7160aae..eec68ff5a5fc 100644 --- a/bolt/lib/Core/BinaryFunction.cpp +++ b/bolt/lib/Core/BinaryFunction.cpp @@ -3328,10 +3328,7 @@ void BinaryFunction::duplicateConstantIslands() { // Update instruction reference Operand = MCOperand::createExpr(BC.MIB->getTargetExprFor( - Inst, - MCSymbolRefExpr::create(ColdSymbol, MCSymbolRefExpr::VK_None, - *BC.Ctx), - *BC.Ctx, 0)); + Inst, MCSymbolRefExpr::create(ColdSymbol, *BC.Ctx), *BC.Ctx, 0)); ++OpNum; } } diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp index e356481bbdc7..5d44e1a1a490 100644 --- a/bolt/lib/Passes/BinaryPasses.cpp +++ b/bolt/lib/Passes/BinaryPasses.cpp @@ -1765,27 +1765,26 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) { if (opts::ShowDensity) { double Density = 0.0; - // Sorted by the density in descending order. - llvm::stable_sort(FuncDensityList, - [&](const std::pair &A, - const std::pair &B) { - if (A.first != B.first) - return A.first > B.first; - return A.second < B.second; - }); + llvm::sort(FuncDensityList); uint64_t AccumulatedSamples = 0; - uint32_t I = 0; assert(opts::ProfileDensityCutOffHot <= 1000000 && "The cutoff value is greater than 1000000(100%)"); - while (AccumulatedSamples < - TotalSampleCount * - static_cast(opts::ProfileDensityCutOffHot) / - 1000000 && - I < FuncDensityList.size()) { - AccumulatedSamples += FuncDensityList[I].second; - Density = FuncDensityList[I].first; - I++; + // Subtract samples in zero-density functions (no fall-throughs) from + // TotalSampleCount (not used anywhere below). + for (const auto [CurDensity, CurSamples] : FuncDensityList) { + if (CurDensity != 0.0) + break; + TotalSampleCount -= CurSamples; + } + const uint64_t CutoffSampleCount = + 1.f * TotalSampleCount * opts::ProfileDensityCutOffHot / 1000000; + // Process functions in decreasing density order + for (const auto [CurDensity, CurSamples] : llvm::reverse(FuncDensityList)) { + if (AccumulatedSamples >= CutoffSampleCount) + break; + AccumulatedSamples += CurSamples; + Density = CurDensity; } if (Density == 0.0) { BC.errs() << "BOLT-WARNING: the output profile is empty or the " diff --git a/bolt/lib/Passes/Instrumentation.cpp b/bolt/lib/Passes/Instrumentation.cpp index fbf889279f1c..c2f876f0dff9 100644 --- a/bolt/lib/Passes/Instrumentation.cpp +++ b/bolt/lib/Passes/Instrumentation.cpp @@ -666,8 +666,7 @@ Error Instrumentation::runOnFunctions(BinaryContext &BC) { auto IsLEA = [&BC](const MCInst &Inst) { return BC.MIB->isLEA64r(Inst); }; const auto LEA = std::find_if( std::next(llvm::find_if(reverse(BB), IsLEA)), BB.rend(), IsLEA); - LEA->getOperand(4).setExpr( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *BC.Ctx)); + LEA->getOperand(4).setExpr(MCSymbolRefExpr::create(Target, *BC.Ctx)); } else { BC.errs() << "BOLT-WARNING: ___GLOBAL_init_65535 not found\n"; } diff --git a/bolt/lib/Passes/PAuthGadgetScanner.cpp b/bolt/lib/Passes/PAuthGadgetScanner.cpp index 95e831fe9c8c..f928dd49edb2 100644 --- a/bolt/lib/Passes/PAuthGadgetScanner.cpp +++ b/bolt/lib/Passes/PAuthGadgetScanner.cpp @@ -82,6 +82,22 @@ namespace PAuthGadgetScanner { dbgs() << "\n"; } +// Iterates over BinaryFunction's instructions like a range-based for loop: +// +// iterateOverInstrs(BF, [&](MCInstReference Inst) { +// // loop body +// }); +template static void iterateOverInstrs(BinaryFunction &BF, T Fn) { + if (BF.hasCFG()) { + for (BinaryBasicBlock &BB : BF) + for (int64_t I = 0, E = BB.size(); I < E; ++I) + Fn(MCInstInBBReference(&BB, I)); + } else { + for (auto I : BF.instrs()) + Fn(MCInstInBFReference(&BF, I.first)); + } +} + // This class represents mapping from a set of arbitrary physical registers to // consecutive array indexes. class TrackedRegisters { @@ -342,6 +358,29 @@ class SrcSafetyAnalysis { return S; } + /// Computes a reasonably pessimistic estimation of the register state when + /// the previous instruction is not known for sure. Takes the set of registers + /// which are trusted at function entry and removes all registers that can be + /// clobbered inside this function. + SrcState computePessimisticState(BinaryFunction &BF) { + BitVector ClobberedRegs(NumRegs); + iterateOverInstrs(BF, [&](MCInstReference Inst) { + BC.MIB->getClobberedRegs(Inst, ClobberedRegs); + + // If this is a call instruction, no register is safe anymore, unless + // it is a tail call. Ignore tail calls for the purpose of estimating the + // worst-case scenario, assuming no instructions are executed in the + // caller after this point anyway. + if (BC.MIB->isCall(Inst) && !BC.MIB->isTailCall(Inst)) + ClobberedRegs.set(); + }); + + SrcState S = createEntryState(); + S.SafeToDerefRegs.reset(ClobberedRegs); + S.TrustedRegs.reset(ClobberedRegs); + return S; + } + BitVector getClobberedRegs(const MCInst &Point) const { BitVector Clobbered(NumRegs); // Assume a call can clobber all registers, including callee-saved @@ -545,6 +584,10 @@ class DataflowSrcSafetyAnalysis using SrcSafetyAnalysis::BC; using SrcSafetyAnalysis::computeNext; + // Pessimistic initial state for basic blocks without any predecessors + // (not needed for most functions, thus initialized lazily). + SrcState PessimisticState; + public: DataflowSrcSafetyAnalysis(BinaryFunction &BF, MCPlusBuilder::AllocatorIdTy AllocId, @@ -585,6 +628,18 @@ class DataflowSrcSafetyAnalysis if (BB.isEntryPoint()) return createEntryState(); + // If a basic block without any predecessors is found in an optimized code, + // this likely means that some CFG edges were not detected. Pessimistically + // assume any register that can ever be clobbered in this function to be + // unsafe before this basic block. + // Warn about this fact in FunctionAnalysis::findUnsafeUses(), as it likely + // means imprecise CFG information. + if (BB.pred_empty()) { + if (PessimisticState.empty()) + PessimisticState = computePessimisticState(*BB.getParent()); + return PessimisticState; + } + return SrcState(); } @@ -682,19 +737,14 @@ template class CFGUnawareAnalysis { // // Then, a function can be split into a number of disjoint contiguous sequences // of instructions without labels in between. These sequences can be processed -// the same way basic blocks are processed by data-flow analysis, assuming -// pessimistically that all registers are unsafe at the start of each sequence. +// the same way basic blocks are processed by data-flow analysis, with the same +// pessimistic estimation of the initial state at the start of each sequence +// (except the first instruction of the function). class CFGUnawareSrcSafetyAnalysis : public SrcSafetyAnalysis, public CFGUnawareAnalysis { using SrcSafetyAnalysis::BC; BinaryFunction &BF; - /// Creates a state with all registers marked unsafe (not to be confused - /// with empty state). - SrcState createUnsafeState() const { - return SrcState(NumRegs, RegsToTrackInstsFor.getNumTrackedRegisters()); - } - public: CFGUnawareSrcSafetyAnalysis(BinaryFunction &BF, MCPlusBuilder::AllocatorIdTy AllocId, @@ -704,6 +754,7 @@ class CFGUnawareSrcSafetyAnalysis : public SrcSafetyAnalysis, } void run() override { + const SrcState DefaultState = computePessimisticState(BF); SrcState S = createEntryState(); for (auto &I : BF.instrs()) { MCInst &Inst = I.second; @@ -718,7 +769,7 @@ class CFGUnawareSrcSafetyAnalysis : public SrcSafetyAnalysis, LLVM_DEBUG({ traceInst(BC, "Due to label, resetting the state before", Inst); }); - S = createUnsafeState(); + S = DefaultState; } // Attach the state *before* this instruction executes. @@ -1268,6 +1319,90 @@ shouldReportReturnGadget(const BinaryContext &BC, const MCInstReference &Inst, return make_gadget_report(RetKind, Inst, *RetReg); } +/// While BOLT already marks some of the branch instructions as tail calls, +/// this function tries to detect less obvious cases, assuming false positives +/// are acceptable as long as there are not too many of them. +/// +/// It is possible that not all the instructions classified as tail calls by +/// this function are safe to be considered as such for the purpose of code +/// transformations performed by BOLT. The intention of this function is to +/// spot some of actually missed tail calls (and likely a number of unrelated +/// indirect branch instructions) as long as this doesn't increase the amount +/// of false positive reports unacceptably. +static bool shouldAnalyzeTailCallInst(const BinaryContext &BC, + const BinaryFunction &BF, + const MCInstReference &Inst) { + // Some BC.MIB->isXYZ(Inst) methods simply delegate to MCInstrDesc::isXYZ() + // (such as isBranch at the time of writing this comment), some don't (such + // as isCall). For that reason, call MCInstrDesc's methods explicitly when + // it is important. + const MCInstrDesc &Desc = + BC.MII->get(static_cast(Inst).getOpcode()); + // Tail call should be a branch (but not necessarily an indirect one). + if (!Desc.isBranch()) + return false; + + // Always analyze the branches already marked as tail calls by BOLT. + if (BC.MIB->isTailCall(Inst)) + return true; + + // Try to also check the branches marked as "UNKNOWN CONTROL FLOW" - the + // below is a simplified condition from BinaryContext::printInstruction. + bool IsUnknownControlFlow = + BC.MIB->isIndirectBranch(Inst) && !BC.MIB->getJumpTable(Inst); + + if (BF.hasCFG() && IsUnknownControlFlow) + return true; + + return false; +} + +static std::optional> +shouldReportUnsafeTailCall(const BinaryContext &BC, const BinaryFunction &BF, + const MCInstReference &Inst, const SrcState &S) { + static const GadgetKind UntrustedLRKind( + "untrusted link register found before tail call"); + + if (!shouldAnalyzeTailCallInst(BC, BF, Inst)) + return std::nullopt; + + // Not only the set of registers returned by getTrustedLiveInRegs() can be + // seen as a reasonable target-independent _approximation_ of "the LR", these + // are *exactly* those registers used by SrcSafetyAnalysis to initialize the + // set of trusted registers on function entry. + // Thus, this function basically checks that the precondition expected to be + // imposed by a function call instruction (which is hardcoded into the target- + // specific getTrustedLiveInRegs() function) is also respected on tail calls. + SmallVector RegsToCheck = BC.MIB->getTrustedLiveInRegs(); + LLVM_DEBUG({ + traceInst(BC, "Found tail call inst", Inst); + traceRegMask(BC, "Trusted regs", S.TrustedRegs); + }); + + // In musl on AArch64, the _start function sets LR to zero and calls the next + // stage initialization function at the end, something along these lines: + // + // _start: + // mov x30, #0 + // ; ... other initialization ... + // b _start_c ; performs "exit" system call at some point + // + // As this would produce a false positive for every executable linked with + // such libc, ignore tail calls performed by ELF entry function. + if (BC.StartFunctionAddress && + *BC.StartFunctionAddress == Inst.getFunction()->getAddress()) { + LLVM_DEBUG({ dbgs() << " Skipping tail call in ELF entry function.\n"; }); + return std::nullopt; + } + + // Returns at most one report per instruction - this is probably OK... + for (auto Reg : RegsToCheck) + if (!S.TrustedRegs[Reg]) + return make_gadget_report(UntrustedLRKind, Inst, Reg); + + return std::nullopt; +} + static std::optional> shouldReportCallGadget(const BinaryContext &BC, const MCInstReference &Inst, const SrcState &S) { @@ -1344,17 +1479,6 @@ shouldReportAuthOracle(const BinaryContext &BC, const MCInstReference &Inst, return make_gadget_report(AuthOracleKind, Inst, *AuthReg); } -template static void iterateOverInstrs(BinaryFunction &BF, T Fn) { - if (BF.hasCFG()) { - for (BinaryBasicBlock &BB : BF) - for (int64_t I = 0, E = BB.size(); I < E; ++I) - Fn(MCInstInBBReference(&BB, I)); - } else { - for (auto I : BF.instrs()) - Fn(MCInstInBFReference(&BF, I.first)); - } -} - static SmallVector collectRegsToTrack(ArrayRef> Reports) { SmallSet RegsToTrack; @@ -1375,17 +1499,60 @@ void FunctionAnalysisContext::findUnsafeUses( BF.dump(); }); + bool UnreachableBBReported = false; + if (BF.hasCFG()) { + // Warn on basic blocks being unreachable according to BOLT (at most once + // per BinaryFunction), as this likely means the CFG reconstructed by BOLT + // is imprecise. A basic block can be + // * reachable from an entry basic block - a hopefully correct non-empty + // state is propagated to that basic block sooner or later. All basic + // blocks are expected to belong to this category under normal conditions. + // * reachable from a "directly unreachable" BB (a basic block that has no + // direct predecessors and this is not because it is an entry BB) - *some* + // non-empty state is propagated to this basic block sooner or later, as + // the initial state of directly unreachable basic blocks is + // pessimistically initialized to "all registers are unsafe" + // - a warning can be printed for the "directly unreachable" basic block + // * neither reachable from an entry nor from a "directly unreachable" BB + // (such as if this BB is in an isolated loop of basic blocks) - the final + // state is computed to be empty for this basic block + // - a warning can be printed for this basic block + for (BinaryBasicBlock &BB : BF) { + MCInst *FirstInst = BB.getFirstNonPseudoInstr(); + // Skip empty basic block early for simplicity. + if (!FirstInst) + continue; + + bool IsDirectlyUnreachable = BB.pred_empty() && !BB.isEntryPoint(); + bool HasNoStateComputed = Analysis->getStateBefore(*FirstInst).empty(); + if (!IsDirectlyUnreachable && !HasNoStateComputed) + continue; + + // Arbitrarily attach the report to the first instruction of BB. + // This is printed as "[message] in function [name], basic block ..., + // at address ..." when the issue is reported to the user. + Reports.push_back(make_generic_report( + MCInstReference::get(FirstInst, BF), + "Warning: possibly imprecise CFG, the analysis quality may be " + "degraded in this function. According to BOLT, unreachable code is " + "found" /* in function [name]... */)); + UnreachableBBReported = true; + break; // One warning per function. + } + } + // FIXME: Warn the user about imprecise analysis when the function has no CFG + // information at all. + iterateOverInstrs(BF, [&](MCInstReference Inst) { if (BC.MIB->isCFI(Inst)) return; const SrcState &S = Analysis->getStateBefore(Inst); - - // If non-empty state was never propagated from the entry basic block - // to Inst, assume it to be unreachable and report a warning. if (S.empty()) { - Reports.push_back( - make_generic_report(Inst, "Warning: unreachable instruction found")); + LLVM_DEBUG( + { traceInst(BC, "Instruction has no state, skipping", Inst); }); + assert(UnreachableBBReported && "Should be reported at least once"); + (void)UnreachableBBReported; return; } @@ -1395,6 +1562,9 @@ void FunctionAnalysisContext::findUnsafeUses( if (PacRetGadgetsOnly) return; + if (auto Report = shouldReportUnsafeTailCall(BC, BF, Inst, S)) + Reports.push_back(*Report); + if (auto Report = shouldReportCallGadget(BC, Inst, S)) Reports.push_back(*Report); if (auto Report = shouldReportSigningOracle(BC, Inst, S)) diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp index 5c8af3710720..c60591c02b6c 100644 --- a/bolt/lib/Profile/DataAggregator.cpp +++ b/bolt/lib/Profile/DataAggregator.cpp @@ -197,34 +197,27 @@ void DataAggregator::start() { if (opts::BasicAggregation) { launchPerfProcess("events without LBR", MainEventsPPI, - "script -F pid,event,ip", - /*Wait = */ false); + "script -F pid,event,ip"); } else if (!opts::ITraceAggregation.empty()) { // Disable parsing memory profile from trace data, unless requested by user. if (!opts::ParseMemProfile.getNumOccurrences()) opts::ParseMemProfile = false; - - std::string ItracePerfScriptArgs = llvm::formatv( - "script -F pid,brstack --itrace={0}", opts::ITraceAggregation); launchPerfProcess("branch events with itrace", MainEventsPPI, - ItracePerfScriptArgs.c_str(), - /*Wait = */ false); + "script -F pid,brstack --itrace=" + + opts::ITraceAggregation); } else { - launchPerfProcess("branch events", MainEventsPPI, "script -F pid,brstack", - /*Wait = */ false); + launchPerfProcess("branch events", MainEventsPPI, "script -F pid,brstack"); } if (opts::ParseMemProfile) - launchPerfProcess("mem events", MemEventsPPI, "script -F pid,event,addr,ip", - /*Wait = */ false); + launchPerfProcess("mem events", MemEventsPPI, + "script -F pid,event,addr,ip"); launchPerfProcess("process events", MMapEventsPPI, - "script --show-mmap-events --no-itrace", - /*Wait = */ false); + "script --show-mmap-events --no-itrace"); launchPerfProcess("task events", TaskEventsPPI, - "script --show-task-events --no-itrace", - /*Wait = */ false); + "script --show-task-events --no-itrace"); } void DataAggregator::abort() { @@ -246,13 +239,13 @@ void DataAggregator::abort() { } void DataAggregator::launchPerfProcess(StringRef Name, PerfProcessInfo &PPI, - const char *ArgsString, bool Wait) { + StringRef Args) { SmallVector Argv; outs() << "PERF2BOLT: spawning perf job to read " << Name << '\n'; Argv.push_back(PerfPath.data()); - StringRef(ArgsString).split(Argv, ' '); + Args.split(Argv, ' '); Argv.push_back("-f"); Argv.push_back("-i"); Argv.push_back(Filename.c_str()); @@ -286,64 +279,45 @@ void DataAggregator::launchPerfProcess(StringRef Name, PerfProcessInfo &PPI, << "\n"; }); - if (Wait) - PPI.PI.ReturnCode = sys::ExecuteAndWait(PerfPath.data(), Argv, - /*envp*/ std::nullopt, Redirects); - else - PPI.PI = sys::ExecuteNoWait(PerfPath.data(), Argv, /*envp*/ std::nullopt, - Redirects); + PPI.PI = sys::ExecuteNoWait(PerfPath.data(), Argv, /*envp*/ std::nullopt, + Redirects); } void DataAggregator::processFileBuildID(StringRef FileBuildID) { + auto WarningCallback = [](int ReturnCode, StringRef ErrBuf) { + errs() << "PERF-ERROR: return code " << ReturnCode << "\n" << ErrBuf; + }; + PerfProcessInfo BuildIDProcessInfo; - launchPerfProcess("buildid list", - BuildIDProcessInfo, - "buildid-list", - /*Wait = */true); - - if (BuildIDProcessInfo.PI.ReturnCode != 0) { - ErrorOr> MB = - MemoryBuffer::getFileOrSTDIN(BuildIDProcessInfo.StderrPath.data()); - StringRef ErrBuf = (*MB)->getBuffer(); - - errs() << "PERF-ERROR: return code " << BuildIDProcessInfo.PI.ReturnCode - << '\n'; - errs() << ErrBuf; + launchPerfProcess("buildid list", BuildIDProcessInfo, "buildid-list"); + if (prepareToParse("buildid", BuildIDProcessInfo, WarningCallback)) return; - } - ErrorOr> MB = - MemoryBuffer::getFileOrSTDIN(BuildIDProcessInfo.StdoutPath.data()); - if (std::error_code EC = MB.getError()) { - errs() << "Cannot open " << BuildIDProcessInfo.StdoutPath.data() << ": " - << EC.message() << "\n"; + std::optional FileName = getFileNameForBuildID(FileBuildID); + if (FileName && *FileName == sys::path::filename(BC->getFilename())) { + outs() << "PERF2BOLT: matched build-id and file name\n"; return; } - FileBuf = std::move(*MB); - ParsingBuf = FileBuf->getBuffer(); - - std::optional FileName = getFileNameForBuildID(FileBuildID); - if (!FileName) { - if (hasAllBuildIDs()) { - errs() << "PERF2BOLT-ERROR: failed to match build-id from perf output. " - "This indicates the input binary supplied for data aggregation " - "is not the same recorded by perf when collecting profiling " - "data, or there were no samples recorded for the binary. " - "Use -ignore-build-id option to override.\n"; - if (!opts::IgnoreBuildID) - abort(); - } else { - errs() << "PERF2BOLT-WARNING: build-id will not be checked because perf " - "data was recorded without it\n"; - return; - } - } else if (*FileName != llvm::sys::path::filename(BC->getFilename())) { + if (FileName) { errs() << "PERF2BOLT-WARNING: build-id matched a different file name\n"; BuildIDBinaryName = std::string(*FileName); - } else { - outs() << "PERF2BOLT: matched build-id and file name\n"; + return; + } + + if (!hasAllBuildIDs()) { + errs() << "PERF2BOLT-WARNING: build-id will not be checked because perf " + "data was recorded without it\n"; + return; } + + errs() << "PERF2BOLT-ERROR: failed to match build-id from perf output. " + "This indicates the input binary supplied for data aggregation " + "is not the same recorded by perf when collecting profiling " + "data, or there were no samples recorded for the binary. " + "Use -ignore-build-id option to override.\n"; + if (!opts::IgnoreBuildID) + abort(); } bool DataAggregator::checkPerfDataMagic(StringRef FileName) { @@ -432,7 +406,8 @@ int DataAggregator::prepareToParse(StringRef Name, PerfProcessInfo &Process, std::string Error; outs() << "PERF2BOLT: waiting for perf " << Name << " collection to finish...\n"; - sys::ProcessInfo PI = sys::Wait(Process.PI, std::nullopt, &Error); + std::optional PS; + sys::ProcessInfo PI = sys::Wait(Process.PI, std::nullopt, &Error, &PS); if (!Error.empty()) { errs() << "PERF-ERROR: " << PerfPath << ": " << Error << "\n"; @@ -440,6 +415,15 @@ int DataAggregator::prepareToParse(StringRef Name, PerfProcessInfo &Process, exit(1); } + LLVM_DEBUG({ + const float UserSec = 1.f * PS->UserTime.count() / 1e6; + const float TotalSec = 1.f * PS->TotalTime.count() / 1e6; + const float PeakGiB = 1.f * PS->PeakMemory / (1 << 20); + dbgs() << formatv("Finished in {0:f2}s user time, {1:f2}s total time, " + "{2:f2} GiB peak RSS\n", + UserSec, TotalSec, PeakGiB); + }); + if (PI.ReturnCode != 0) { ErrorOr> ErrorMB = MemoryBuffer::getFileOrSTDIN(Process.StderrPath.data()); @@ -466,9 +450,7 @@ int DataAggregator::prepareToParse(StringRef Name, PerfProcessInfo &Process, return PI.ReturnCode; } -Error DataAggregator::preprocessProfile(BinaryContext &BC) { - this->BC = &BC; - +void DataAggregator::parsePerfData(BinaryContext &BC) { auto ErrorCallback = [](int ReturnCode, StringRef ErrBuf) { errs() << "PERF-ERROR: return code " << ReturnCode << "\n" << ErrBuf; exit(1); @@ -481,11 +463,6 @@ Error DataAggregator::preprocessProfile(BinaryContext &BC) { ErrorCallback(ReturnCode, ErrBuf); }; - if (opts::ReadPreAggregated) { - parsePreAggregated(); - goto heatmap; - } - if (std::optional FileBuildID = BC.getFileBuildID()) { outs() << "BOLT-INFO: binary build-id is: " << *FileBuildID << "\n"; processFileBuildID(*FileBuildID); @@ -534,22 +511,28 @@ Error DataAggregator::preprocessProfile(BinaryContext &BC) { << '\n'; deleteTempFiles(); +} -heatmap: - // Sort parsed traces for faster processing. - llvm::sort(Traces, llvm::less_first()); +Error DataAggregator::preprocessProfile(BinaryContext &BC) { + this->BC = &BC; - if (!opts::HeatmapMode) - return Error::success(); + if (opts::ReadPreAggregated) { + parsePreAggregated(); + } else { + parsePerfData(BC); + } - if (std::error_code EC = printLBRHeatMap()) - return errorCodeToError(EC); + // Sort parsed traces for faster processing. + llvm::sort(Traces, llvm::less_first()); - if (opts::HeatmapMode == opts::HeatmapModeKind::HM_Optional) - return Error::success(); + if (opts::HeatmapMode) { + if (std::error_code EC = printLBRHeatMap()) + return errorCodeToError(EC); + if (opts::HeatmapMode == opts::HeatmapModeKind::HM_Exclusive) + exit(0); + } - assert(opts::HeatmapMode == opts::HeatmapModeKind::HM_Exclusive); - exit(0); + return Error::success(); } Error DataAggregator::readProfile(BinaryContext &BC) { diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp index 93bd93b6cb98..96045a916232 100644 --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -547,9 +547,14 @@ Error RewriteInstance::discoverStorage() { NextAvailableOffset = std::max(NextAvailableOffset, Phdr.p_offset + Phdr.p_filesz); - BC->SegmentMapInfo[Phdr.p_vaddr] = SegmentInfo{ - Phdr.p_vaddr, Phdr.p_memsz, Phdr.p_offset, - Phdr.p_filesz, Phdr.p_align, ((Phdr.p_flags & ELF::PF_X) != 0)}; + BC->SegmentMapInfo[Phdr.p_vaddr] = + SegmentInfo{Phdr.p_vaddr, + Phdr.p_memsz, + Phdr.p_offset, + Phdr.p_filesz, + Phdr.p_align, + (Phdr.p_flags & ELF::PF_X) != 0, + (Phdr.p_flags & ELF::PF_W) != 0}; if (BC->TheTriple->getArch() == llvm::Triple::x86_64 && Phdr.p_vaddr >= BinaryContext::KernelStartX86_64) BC->IsLinuxKernel = true; @@ -626,6 +631,9 @@ Error RewriteInstance::discoverStorage() { NextAvailableAddress += BC->PageAlign; } + NewTextSegmentAddress = NextAvailableAddress; + NewTextSegmentOffset = NextAvailableOffset; + if (!opts::UseGnuStack && !BC->IsLinuxKernel) { // This is where the black magic happens. Creating PHDR table in a segment // other than that containing ELF header is tricky. Some loaders and/or @@ -652,6 +660,8 @@ Error RewriteInstance::discoverStorage() { PHDRTableAddress = NextAvailableAddress; PHDRTableOffset = NextAvailableOffset; + NewTextSegmentAddress = NextAvailableAddress; + NewTextSegmentOffset = NextAvailableOffset; // Reserve space for 3 extra pheaders. unsigned Phnum = Obj.getHeader().e_phnum; @@ -664,14 +674,12 @@ Error RewriteInstance::discoverStorage() { NextAvailableAddress += Phnum * sizeof(ELF64LEPhdrTy); NextAvailableOffset += Phnum * sizeof(ELF64LEPhdrTy); - } - // Align at cache line. - NextAvailableAddress = alignTo(NextAvailableAddress, 64); - NextAvailableOffset = alignTo(NextAvailableOffset, 64); + // Align at cache line. + NextAvailableAddress = alignTo(NextAvailableAddress, 64); + NextAvailableOffset = alignTo(NextAvailableOffset, 64); + } - NewTextSegmentAddress = NextAvailableAddress; - NewTextSegmentOffset = NextAvailableOffset; BC->LayoutStartAddress = NextAvailableAddress; // Tools such as objcopy can strip section contents but leave header @@ -3853,111 +3861,138 @@ std::vector RewriteInstance::getCodeSections() { } void RewriteInstance::mapCodeSections(BOLTLinker::SectionMapper MapSection) { - if (BC->HasRelocations) { - // Map sections for functions with pre-assigned addresses. - for (BinaryFunction *InjectedFunction : BC->getInjectedBinaryFunctions()) { - const uint64_t OutputAddress = InjectedFunction->getOutputAddress(); - if (!OutputAddress) - continue; - - ErrorOr FunctionSection = - InjectedFunction->getCodeSection(); - assert(FunctionSection && "function should have section"); - FunctionSection->setOutputAddress(OutputAddress); - MapSection(*FunctionSection, OutputAddress); - InjectedFunction->setImageAddress(FunctionSection->getAllocAddress()); - InjectedFunction->setImageSize(FunctionSection->getOutputSize()); - } + if (!BC->HasRelocations) { + mapCodeSectionsInPlace(MapSection); + return; + } - // Populate the list of sections to be allocated. - std::vector CodeSections = getCodeSections(); + // Map sections for functions with pre-assigned addresses. + for (BinaryFunction *InjectedFunction : BC->getInjectedBinaryFunctions()) { + const uint64_t OutputAddress = InjectedFunction->getOutputAddress(); + if (!OutputAddress) + continue; - // Remove sections that were pre-allocated (patch sections). - llvm::erase_if(CodeSections, [](BinarySection *Section) { - return Section->getOutputAddress(); - }); - LLVM_DEBUG(dbgs() << "Code sections in the order of output:\n"; - for (const BinarySection *Section : CodeSections) - dbgs() << Section->getName() << '\n'; - ); + ErrorOr FunctionSection = + InjectedFunction->getCodeSection(); + assert(FunctionSection && "function should have section"); + FunctionSection->setOutputAddress(OutputAddress); + MapSection(*FunctionSection, OutputAddress); + InjectedFunction->setImageAddress(FunctionSection->getAllocAddress()); + InjectedFunction->setImageSize(FunctionSection->getOutputSize()); + } - uint64_t PaddingSize = 0; // size of padding required at the end + // Populate the list of sections to be allocated. + std::vector CodeSections = getCodeSections(); - // Allocate sections starting at a given Address. - auto allocateAt = [&](uint64_t Address) { - const char *LastNonColdSectionName = BC->HasWarmSection - ? BC->getWarmCodeSectionName() - : BC->getMainCodeSectionName(); - for (BinarySection *Section : CodeSections) { - Address = alignTo(Address, Section->getAlignment()); - Section->setOutputAddress(Address); - Address += Section->getOutputSize(); - - // Hugify: Additional huge page from right side due to - // weird ASLR mapping addresses (4KB aligned) - if (opts::Hugify && !BC->HasFixedLoadAddress && - Section->getName() == LastNonColdSectionName) - Address = alignTo(Address, Section->getAlignment()); - } + // Remove sections that were pre-allocated (patch sections). + llvm::erase_if(CodeSections, [](BinarySection *Section) { + return Section->getOutputAddress(); + }); + LLVM_DEBUG(dbgs() << "Code sections in the order of output:\n"; + for (const BinarySection *Section : CodeSections) dbgs() + << Section->getName() << '\n';); - // Make sure we allocate enough space for huge pages. - ErrorOr TextSection = - BC->getUniqueSectionByName(LastNonColdSectionName); - if (opts::HotText && TextSection && TextSection->hasValidSectionID()) { - uint64_t HotTextEnd = - TextSection->getOutputAddress() + TextSection->getOutputSize(); - HotTextEnd = alignTo(HotTextEnd, BC->PageAlign); - if (HotTextEnd > Address) { - PaddingSize = HotTextEnd - Address; - Address = HotTextEnd; - } - } - return Address; - }; + uint64_t PaddingSize = 0; // size of padding required at the end - // Check if we can fit code in the original .text - bool AllocationDone = false; - if (opts::UseOldText) { - const uint64_t CodeSize = - allocateAt(BC->OldTextSectionAddress) - BC->OldTextSectionAddress; + // Allocate sections starting at a given Address. + auto allocateAt = [&](uint64_t Address) { + const char *LastNonColdSectionName = BC->HasWarmSection + ? BC->getWarmCodeSectionName() + : BC->getMainCodeSectionName(); + for (BinarySection *Section : CodeSections) { + Address = alignTo(Address, Section->getAlignment()); + Section->setOutputAddress(Address); + Address += Section->getOutputSize(); + + // Hugify: Additional huge page from right side due to + // weird ASLR mapping addresses (4KB aligned) + if (opts::Hugify && !BC->HasFixedLoadAddress && + Section->getName() == LastNonColdSectionName) + Address = alignTo(Address, Section->getAlignment()); + } - if (CodeSize <= BC->OldTextSectionSize) { - BC->outs() << "BOLT-INFO: using original .text for new code with 0x" - << Twine::utohexstr(opts::AlignText) << " alignment\n"; - AllocationDone = true; - } else { - BC->errs() - << "BOLT-WARNING: original .text too small to fit the new code" - << " using 0x" << Twine::utohexstr(opts::AlignText) - << " alignment. " << CodeSize << " bytes needed, have " - << BC->OldTextSectionSize << " bytes available.\n"; - opts::UseOldText = false; + // Make sure we allocate enough space for huge pages. + ErrorOr TextSection = + BC->getUniqueSectionByName(LastNonColdSectionName); + if (opts::HotText && TextSection && TextSection->hasValidSectionID()) { + uint64_t HotTextEnd = + TextSection->getOutputAddress() + TextSection->getOutputSize(); + HotTextEnd = alignTo(HotTextEnd, BC->PageAlign); + if (HotTextEnd > Address) { + PaddingSize = HotTextEnd - Address; + Address = HotTextEnd; } } + return Address; + }; - if (!AllocationDone) - NextAvailableAddress = allocateAt(NextAvailableAddress); + // Try to allocate sections before the \p Address and return an address for + // the allocation of the first section, or 0 if [0, Address) range is not + // big enough to fit all sections. + auto allocateBefore = [&](uint64_t Address) -> uint64_t { + for (BinarySection *Section : llvm::reverse(CodeSections)) { + if (Section->getOutputSize() > Address) + return 0; + Address -= Section->getOutputSize(); + Address = alignDown(Address, Section->getAlignment()); + Section->setOutputAddress(Address); + } + return Address; + }; - // Do the mapping for ORC layer based on the allocation. - for (BinarySection *Section : CodeSections) { - LLVM_DEBUG( - dbgs() << "BOLT: mapping " << Section->getName() << " at 0x" - << Twine::utohexstr(Section->getAllocAddress()) << " to 0x" - << Twine::utohexstr(Section->getOutputAddress()) << '\n'); - MapSection(*Section, Section->getOutputAddress()); - Section->setOutputFileOffset( - getFileOffsetForAddress(Section->getOutputAddress())); + // Check if we can fit code in the original .text + bool AllocationDone = false; + if (opts::UseOldText) { + uint64_t StartAddress; + uint64_t EndAddress; + if (opts::HotFunctionsAtEnd) { + EndAddress = BC->OldTextSectionAddress + BC->OldTextSectionSize; + StartAddress = allocateBefore(EndAddress); + } else { + StartAddress = BC->OldTextSectionAddress; + EndAddress = allocateAt(BC->OldTextSectionAddress); + } + + const uint64_t CodeSize = EndAddress - StartAddress; + if (CodeSize <= BC->OldTextSectionSize) { + BC->outs() << "BOLT-INFO: using original .text for new code with 0x" + << Twine::utohexstr(opts::AlignText) << " alignment"; + if (StartAddress != BC->OldTextSectionAddress) + BC->outs() << " at 0x" << Twine::utohexstr(StartAddress); + BC->outs() << '\n'; + AllocationDone = true; + } else { + BC->errs() << "BOLT-WARNING: original .text too small to fit the new code" + << " using 0x" << Twine::utohexstr(opts::AlignText) + << " alignment. " << CodeSize << " bytes needed, have " + << BC->OldTextSectionSize << " bytes available.\n"; + opts::UseOldText = false; } + } - // Check if we need to insert a padding section for hot text. - if (PaddingSize && !opts::UseOldText) - BC->outs() << "BOLT-INFO: padding code to 0x" - << Twine::utohexstr(NextAvailableAddress) - << " to accommodate hot text\n"; + if (!AllocationDone) + NextAvailableAddress = allocateAt(NextAvailableAddress); - return; + // Do the mapping for ORC layer based on the allocation. + for (BinarySection *Section : CodeSections) { + LLVM_DEBUG(dbgs() << "BOLT: mapping " << Section->getName() << " at 0x" + << Twine::utohexstr(Section->getAllocAddress()) + << " to 0x" + << Twine::utohexstr(Section->getOutputAddress()) << '\n'); + MapSection(*Section, Section->getOutputAddress()); + Section->setOutputFileOffset( + getFileOffsetForAddress(Section->getOutputAddress())); } + // Check if we need to insert a padding section for hot text. + if (PaddingSize && !opts::UseOldText) + BC->outs() << "BOLT-INFO: padding code to 0x" + << Twine::utohexstr(NextAvailableAddress) + << " to accommodate hot text\n"; +} + +void RewriteInstance::mapCodeSectionsInPlace( + BOLTLinker::SectionMapper MapSection) { // Processing in non-relocation mode. uint64_t NewTextSectionStartAddress = NextAvailableAddress; @@ -4133,13 +4168,8 @@ void RewriteInstance::mapAllocatableSections( } if (SType == ST_READONLY) { - if (PHDRTableAddress) { - // Segment size includes the size of the PHDR area. - NewTextSegmentSize = NextAvailableAddress - PHDRTableAddress; - } else if (NewTextSegmentAddress) { - // Existing PHDR table would be updated. + if (NewTextSegmentAddress) NewTextSegmentSize = NextAvailableAddress - NewTextSegmentAddress; - } } else if (SType == ST_READWRITE) { NewWritableSegmentSize = NextAvailableAddress - NewWritableSegmentAddress; // Restore NextAvailableAddress if no new writable sections @@ -4157,6 +4187,74 @@ void RewriteInstance::updateOutputValues(const BOLTLinker &Linker) { Function->updateOutputValues(Linker); } +void RewriteInstance::updateSegmentInfo() { + // NOTE Currently .eh_frame_hdr appends to the last segment, recalculate + // last segments size based on the NextAvailableAddress variable. + if (!NewWritableSegmentSize) { + if (NewTextSegmentAddress) + NewTextSegmentSize = NextAvailableAddress - NewTextSegmentAddress; + } else { + NewWritableSegmentSize = NextAvailableAddress - NewWritableSegmentAddress; + } + + if (NewTextSegmentSize) { + SegmentInfo TextSegment = {NewTextSegmentAddress, + NewTextSegmentSize, + NewTextSegmentOffset, + NewTextSegmentSize, + BC->PageAlign, + true, + false}; + if (!opts::Instrument) { + BC->NewSegments.push_back(TextSegment); + } else { + ErrorOr Sec = + BC->getUniqueSectionByName(".bolt.instr.counters"); + assert(Sec && "expected one and only one `.bolt.instr.counters` section"); + const uint64_t Addr = Sec->getOutputAddress(); + const uint64_t Offset = Sec->getOutputFileOffset(); + const uint64_t Size = Sec->getOutputSize(); + assert(Addr > TextSegment.Address && + Addr + Size < TextSegment.Address + TextSegment.Size && + "`.bolt.instr.counters` section is expected to be included in the " + "new text segment"); + + // Set correct size for the previous header since we are breaking the + // new text segment into three segments. + uint64_t Delta = Addr - TextSegment.Address; + TextSegment.Size = Delta; + TextSegment.FileSize = Delta; + BC->NewSegments.push_back(TextSegment); + + // Create RW segment that includes the `.bolt.instr.counters` section. + SegmentInfo RWSegment = {Addr, Size, Offset, Size, BC->RegularPageSize, + false, true}; + BC->NewSegments.push_back(RWSegment); + + // Create RX segment that includes all RX sections from runtime library. + const uint64_t AddrRX = alignTo(Addr + Size, BC->RegularPageSize); + const uint64_t OffsetRX = alignTo(Offset + Size, BC->RegularPageSize); + const uint64_t SizeRX = + NewTextSegmentSize - (AddrRX - TextSegment.Address); + SegmentInfo RXSegment = { + AddrRX, SizeRX, OffsetRX, SizeRX, BC->RegularPageSize, true, false}; + BC->NewSegments.push_back(RXSegment); + } + } + + if (NewWritableSegmentSize) { + SegmentInfo DataSegmentInfo = { + NewWritableSegmentAddress, + NewWritableSegmentSize, + getFileOffsetForAddress(NewWritableSegmentAddress), + NewWritableSegmentSize, + BC->RegularPageSize, + false, + true}; + BC->NewSegments.push_back(DataSegmentInfo); + } +} + void RewriteInstance::patchELFPHDRTable() { auto ELF64LEFile = cast(InputFile); const ELFFile &Obj = ELF64LEFile->getELFFile(); @@ -4183,110 +4281,36 @@ void RewriteInstance::patchELFPHDRTable() { if (opts::Instrument) Phnum += 2; - // NOTE Currently .eh_frame_hdr appends to the last segment, recalculate - // last segments size based on the NextAvailableAddress variable. - if (!NewWritableSegmentSize) { - if (PHDRTableAddress) - NewTextSegmentSize = NextAvailableAddress - PHDRTableAddress; - else if (NewTextSegmentAddress) - NewTextSegmentSize = NextAvailableAddress - NewTextSegmentAddress; - } else { - NewWritableSegmentSize = NextAvailableAddress - NewWritableSegmentAddress; + if (BC->NewSegments.empty()) { + BC->outs() << "BOLT-INFO: not adding new segments\n"; + return; } const uint64_t SavedPos = OS.tell(); OS.seek(PHDRTableOffset); - auto createNewPhdrs = [&]() { - SmallVector NewPhdrs; - ELF64LEPhdrTy NewPhdr; - NewPhdr.p_type = ELF::PT_LOAD; - if (PHDRTableAddress) { - NewPhdr.p_offset = PHDRTableOffset; - NewPhdr.p_vaddr = PHDRTableAddress; - NewPhdr.p_paddr = PHDRTableAddress; - } else { - NewPhdr.p_offset = NewTextSegmentOffset; - NewPhdr.p_vaddr = NewTextSegmentAddress; - NewPhdr.p_paddr = NewTextSegmentAddress; - } - NewPhdr.p_filesz = NewTextSegmentSize; - NewPhdr.p_memsz = NewTextSegmentSize; - NewPhdr.p_flags = ELF::PF_X | ELF::PF_R; - NewPhdr.p_align = BC->PageAlign; - - if (!opts::Instrument) { - NewPhdrs.push_back(NewPhdr); - } else { - ErrorOr Sec = - BC->getUniqueSectionByName(".bolt.instr.counters"); - assert(Sec && "expected one and only one `.bolt.instr.counters` section"); - const uint64_t Addr = Sec->getOutputAddress(); - const uint64_t Offset = Sec->getOutputFileOffset(); - const uint64_t Size = Sec->getOutputSize(); - assert(Addr > NewPhdr.p_vaddr && - Addr + Size < NewPhdr.p_vaddr + NewPhdr.p_memsz && - "`.bolt.instr.counters` section is expected to be included in the " - "new text sgement"); - - // Set correct size for the previous header since we are breaking the - // new text segment into three segments. - uint64_t Delta = Addr - NewPhdr.p_vaddr; - NewPhdr.p_filesz = Delta; - NewPhdr.p_memsz = Delta; - NewPhdrs.push_back(NewPhdr); - - // Create a program header for a RW segment that includes the - // `.bolt.instr.counters` section only. - ELF64LEPhdrTy NewPhdrRWSegment; - NewPhdrRWSegment.p_type = ELF::PT_LOAD; - NewPhdrRWSegment.p_offset = Offset; - NewPhdrRWSegment.p_vaddr = Addr; - NewPhdrRWSegment.p_paddr = Addr; - NewPhdrRWSegment.p_filesz = Size; - NewPhdrRWSegment.p_memsz = Size; - NewPhdrRWSegment.p_flags = ELF::PF_R | ELF::PF_W; - NewPhdrRWSegment.p_align = BC->RegularPageSize; - NewPhdrs.push_back(NewPhdrRWSegment); - - // Create a program header for a RX segment that includes all the RX - // sections from runtime library. - ELF64LEPhdrTy NewPhdrRXSegment; - NewPhdrRXSegment.p_type = ELF::PT_LOAD; - const uint64_t AddrRX = alignTo(Addr + Size, BC->RegularPageSize); - const uint64_t OffsetRX = alignTo(Offset + Size, BC->RegularPageSize); - const uint64_t SizeRX = NewTextSegmentSize - (AddrRX - NewPhdr.p_paddr); - NewPhdrRXSegment.p_offset = OffsetRX; - NewPhdrRXSegment.p_vaddr = AddrRX; - NewPhdrRXSegment.p_paddr = AddrRX; - NewPhdrRXSegment.p_filesz = SizeRX; - NewPhdrRXSegment.p_memsz = SizeRX; - NewPhdrRXSegment.p_flags = ELF::PF_X | ELF::PF_R; - NewPhdrRXSegment.p_align = BC->RegularPageSize; - NewPhdrs.push_back(NewPhdrRXSegment); - } - - return NewPhdrs; + auto createPhdr = [](const SegmentInfo &SI) { + ELF64LEPhdrTy Phdr; + Phdr.p_type = ELF::PT_LOAD; + Phdr.p_offset = SI.FileOffset; + Phdr.p_vaddr = SI.Address; + Phdr.p_paddr = SI.Address; + Phdr.p_filesz = SI.FileSize; + Phdr.p_memsz = SI.Size; + Phdr.p_flags = ELF::PF_R; + if (SI.IsExecutable) + Phdr.p_flags |= ELF::PF_X; + if (SI.IsWritable) + Phdr.p_flags |= ELF::PF_W; + Phdr.p_align = SI.Alignment; + + return Phdr; }; auto writeNewSegmentPhdrs = [&]() { - if (PHDRTableAddress || NewTextSegmentSize) { - SmallVector NewPhdrs = createNewPhdrs(); - OS.write(reinterpret_cast(NewPhdrs.data()), - sizeof(ELF64LE::Phdr) * NewPhdrs.size()); - } - - if (NewWritableSegmentSize) { - ELF64LEPhdrTy NewPhdr; - NewPhdr.p_type = ELF::PT_LOAD; - NewPhdr.p_offset = getFileOffsetForAddress(NewWritableSegmentAddress); - NewPhdr.p_vaddr = NewWritableSegmentAddress; - NewPhdr.p_paddr = NewWritableSegmentAddress; - NewPhdr.p_filesz = NewWritableSegmentSize; - NewPhdr.p_memsz = NewWritableSegmentSize; - NewPhdr.p_align = BC->RegularPageSize; - NewPhdr.p_flags = ELF::PF_R | ELF::PF_W; - OS.write(reinterpret_cast(&NewPhdr), sizeof(NewPhdr)); + for (const SegmentInfo &SI : BC->NewSegments) { + ELF64LEPhdrTy Phdr = createPhdr(SI); + OS.write(reinterpret_cast(&Phdr), sizeof(Phdr)); } }; @@ -4322,11 +4346,9 @@ void RewriteInstance::patchELFPHDRTable() { case ELF::PT_GNU_STACK: if (opts::UseGnuStack) { // Overwrite the header with the new segment header. - assert(!opts::Instrument); - SmallVector NewPhdrs = createNewPhdrs(); - assert(NewPhdrs.size() == 1 && - "expect exactly one program header was created"); - NewPhdr = NewPhdrs[0]; + assert(BC->NewSegments.size() == 1 && + "Expected exactly one new segment"); + NewPhdr = createPhdr(BC->NewSegments.front()); ModdedGnuStack = true; } break; @@ -5951,8 +5973,10 @@ void RewriteInstance::rewriteFile() { addBATSection(); // Patch program header table. - if (!BC->IsLinuxKernel) + if (!BC->IsLinuxKernel) { + updateSegmentInfo(); patchELFPHDRTable(); + } // Finalize memory image of section string table. finalizeSectionStringTable(); diff --git a/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp b/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp index e6e0aeba3457..973261765f95 100644 --- a/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp +++ b/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp @@ -22,7 +22,6 @@ #include "bolt/Core/MCPlusBuilder.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/MC/MCContext.h" -#include "llvm/MC/MCFixupKindInfo.h" #include "llvm/MC/MCInstBuilder.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegister.h" @@ -1081,7 +1080,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { if (isADR(Inst) || RelType == ELF::R_AARCH64_ADR_PREL_LO21 || RelType == ELF::R_AARCH64_TLSDESC_ADR_PREL21) { - return MCSpecifierExpr::create(Expr, AArch64MCExpr::VK_ABS, Ctx); + return MCSpecifierExpr::create(Expr, AArch64::S_ABS, Ctx); } else if (isADRP(Inst) || RelType == ELF::R_AARCH64_ADR_PREL_PG_HI21 || RelType == ELF::R_AARCH64_ADR_PREL_PG_HI21_NC || RelType == ELF::R_AARCH64_TLSDESC_ADR_PAGE21 || @@ -1089,7 +1088,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { RelType == ELF::R_AARCH64_ADR_GOT_PAGE) { // Never emit a GOT reloc, we handled this in // RewriteInstance::readRelocations(). - return MCSpecifierExpr::create(Expr, AArch64MCExpr::VK_ABS_PAGE, Ctx); + return MCSpecifierExpr::create(Expr, AArch64::S_ABS_PAGE, Ctx); } else { switch (RelType) { case ELF::R_AARCH64_ADD_ABS_LO12_NC: @@ -1103,18 +1102,18 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { case ELF::R_AARCH64_TLSDESC_LD64_LO12: case ELF::R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC: case ELF::R_AARCH64_TLSLE_ADD_TPREL_LO12_NC: - return MCSpecifierExpr::create(Expr, AArch64MCExpr::VK_LO12, Ctx); + return MCSpecifierExpr::create(Expr, AArch64::S_LO12, Ctx); case ELF::R_AARCH64_MOVW_UABS_G3: - return MCSpecifierExpr::create(Expr, AArch64MCExpr::VK_ABS_G3, Ctx); + return MCSpecifierExpr::create(Expr, AArch64::S_ABS_G3, Ctx); case ELF::R_AARCH64_MOVW_UABS_G2: case ELF::R_AARCH64_MOVW_UABS_G2_NC: - return MCSpecifierExpr::create(Expr, AArch64MCExpr::VK_ABS_G2_NC, Ctx); + return MCSpecifierExpr::create(Expr, AArch64::S_ABS_G2_NC, Ctx); case ELF::R_AARCH64_MOVW_UABS_G1: case ELF::R_AARCH64_MOVW_UABS_G1_NC: - return MCSpecifierExpr::create(Expr, AArch64MCExpr::VK_ABS_G1_NC, Ctx); + return MCSpecifierExpr::create(Expr, AArch64::S_ABS_G1_NC, Ctx); case ELF::R_AARCH64_MOVW_UABS_G0: case ELF::R_AARCH64_MOVW_UABS_G0_NC: - return MCSpecifierExpr::create(Expr, AArch64MCExpr::VK_ABS_G0_NC, Ctx); + return MCSpecifierExpr::create(Expr, AArch64::S_ABS_G0_NC, Ctx); default: break; } @@ -1206,8 +1205,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { OI = Inst.begin() + 2; } - *OI = MCOperand::createExpr( - MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx)); + *OI = MCOperand::createExpr(MCSymbolRefExpr::create(TBB, *Ctx)); } /// Matches indirect branch patterns in AArch64 related to a jump table (JT), @@ -1633,8 +1631,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { .addImm(0)); Code.emplace_back(MCInstBuilder(AArch64::Bcc) .addImm(AArch64CC::EQ) - .addExpr(MCSymbolRefExpr::create( - Target, MCSymbolRefExpr::VK_None, *Ctx))); + .addExpr(MCSymbolRefExpr::create(Target, *Ctx))); return Code; } @@ -1656,8 +1653,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { .addImm(0)); Code.emplace_back(MCInstBuilder(AArch64::Bcc) .addImm(AArch64CC::NE) - .addExpr(MCSymbolRefExpr::create( - Target, MCSymbolRefExpr::VK_None, *Ctx))); + .addExpr(MCSymbolRefExpr::create(Target, *Ctx))); return Code; } @@ -1957,8 +1953,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { Inst.setOpcode(IsTailCall ? AArch64::B : AArch64::BL); Inst.clear(); Inst.addOperand(MCOperand::createExpr(getTargetExprFor( - Inst, MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx), - *Ctx, 0))); + Inst, MCSymbolRefExpr::create(Target, *Ctx), *Ctx, 0))); if (IsTailCall) convertJmpToTailCall(Inst); } @@ -2028,7 +2023,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { Inst.setOpcode(AArch64::MOVZXi); Inst.addOperand(MCOperand::createReg(AArch64::X16)); Inst.addOperand(MCOperand::createExpr( - MCSpecifierExpr::create(Target, AArch64MCExpr::VK_ABS_G3, *Ctx))); + MCSpecifierExpr::create(Target, AArch64::S_ABS_G3, *Ctx))); Inst.addOperand(MCOperand::createImm(0x30)); Seq.emplace_back(Inst); @@ -2037,7 +2032,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { Inst.addOperand(MCOperand::createReg(AArch64::X16)); Inst.addOperand(MCOperand::createReg(AArch64::X16)); Inst.addOperand(MCOperand::createExpr( - MCSpecifierExpr::create(Target, AArch64MCExpr::VK_ABS_G2_NC, *Ctx))); + MCSpecifierExpr::create(Target, AArch64::S_ABS_G2_NC, *Ctx))); Inst.addOperand(MCOperand::createImm(0x20)); Seq.emplace_back(Inst); @@ -2046,7 +2041,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { Inst.addOperand(MCOperand::createReg(AArch64::X16)); Inst.addOperand(MCOperand::createReg(AArch64::X16)); Inst.addOperand(MCOperand::createExpr( - MCSpecifierExpr::create(Target, AArch64MCExpr::VK_ABS_G1_NC, *Ctx))); + MCSpecifierExpr::create(Target, AArch64::S_ABS_G1_NC, *Ctx))); Inst.addOperand(MCOperand::createImm(0x10)); Seq.emplace_back(Inst); @@ -2055,7 +2050,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { Inst.addOperand(MCOperand::createReg(AArch64::X16)); Inst.addOperand(MCOperand::createReg(AArch64::X16)); Inst.addOperand(MCOperand::createExpr( - MCSpecifierExpr::create(Target, AArch64MCExpr::VK_ABS_G0_NC, *Ctx))); + MCSpecifierExpr::create(Target, AArch64::S_ABS_G0_NC, *Ctx))); Inst.addOperand(MCOperand::createImm(0)); Seq.emplace_back(Inst); @@ -2228,9 +2223,8 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { MCContext *Ctx) const override { Inst.setOpcode(AArch64::B); Inst.clear(); - Inst.addOperand(MCOperand::createExpr(getTargetExprFor( - Inst, MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx), - *Ctx, 0))); + Inst.addOperand(MCOperand::createExpr( + getTargetExprFor(Inst, MCSymbolRefExpr::create(TBB, *Ctx), *Ctx, 0))); } bool shouldRecordCodeRelocation(uint32_t RelType) const override { @@ -2562,7 +2556,7 @@ class AArch64MCPlusBuilder : public MCPlusBuilder { else if (Fixup.getKind() == MCFixupKind(AArch64::fixup_aarch64_pcrel_branch26)) RelType = ELF::R_AARCH64_JUMP26; - else if (FKI.Flags & MCFixupKindInfo::FKF_IsPCRel) { + else if (Fixup.isPCRel()) { switch (FKI.TargetSize) { default: return std::nullopt; diff --git a/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp b/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp index c7d664ab09d4..10b4913b6ab7 100644 --- a/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp +++ b/bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp @@ -171,8 +171,8 @@ class RISCVMCPlusBuilder : public MCPlusBuilder { (void)Result; assert(Result && "unimplemented branch"); - Inst.getOperand(SymOpIndex) = MCOperand::createExpr( - MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx)); + Inst.getOperand(SymOpIndex) = + MCOperand::createExpr(MCSymbolRefExpr::create(TBB, *Ctx)); } IndirectBranchType analyzeIndirectBranch( @@ -233,8 +233,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder { Inst.setOpcode(RISCV::JAL); Inst.clear(); Inst.addOperand(MCOperand::createReg(RISCV::X0)); - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx))); + Inst.addOperand(MCOperand::createExpr(MCSymbolRefExpr::create(TBB, *Ctx))); } StringRef getTrapFillValue() const override { @@ -246,8 +245,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder { Inst.setOpcode(Opcode); Inst.clear(); Inst.addOperand(MCOperand::createExpr(MCSpecifierExpr::create( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx), - ELF::R_RISCV_CALL_PLT, *Ctx))); + MCSymbolRefExpr::create(Target, *Ctx), ELF::R_RISCV_CALL_PLT, *Ctx))); } void createCall(MCInst &Inst, const MCSymbol *Target, @@ -563,8 +561,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder { Insts.emplace_back(MCInstBuilder(RISCV::BEQ) .addReg(RegNo) .addReg(RegTmp) - .addExpr(MCSymbolRefExpr::create( - Target, MCSymbolRefExpr::VK_None, *Ctx))); + .addExpr(MCSymbolRefExpr::create(Target, *Ctx))); return Insts; } @@ -663,14 +660,12 @@ class RISCVMCPlusBuilder : public MCPlusBuilder { if (IsTailCall) { Inst.addOperand(MCOperand::createReg(RISCV::X0)); Inst.addOperand(MCOperand::createExpr(getTargetExprFor( - Inst, MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx), - *Ctx, 0))); + Inst, MCSymbolRefExpr::create(Target, *Ctx), *Ctx, 0))); convertJmpToTailCall(Inst); } else { Inst.addOperand(MCOperand::createReg(RISCV::X1)); Inst.addOperand(MCOperand::createExpr(getTargetExprFor( - Inst, MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx), - *Ctx, 0))); + Inst, MCSymbolRefExpr::create(Target, *Ctx), *Ctx, 0))); } } diff --git a/bolt/lib/Target/X86/X86MCPlusBuilder.cpp b/bolt/lib/Target/X86/X86MCPlusBuilder.cpp index b909d7fb6bf2..09d2322a29ca 100644 --- a/bolt/lib/Target/X86/X86MCPlusBuilder.cpp +++ b/bolt/lib/Target/X86/X86MCPlusBuilder.cpp @@ -18,7 +18,6 @@ #include "bolt/Core/MCPlusBuilder.h" #include "llvm/BinaryFormat/ELF.h" #include "llvm/MC/MCContext.h" -#include "llvm/MC/MCFixupKindInfo.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstBuilder.h" #include "llvm/MC/MCInstrInfo.h" @@ -72,9 +71,9 @@ static InstructionListType createIncMemory(const MCSymbol *Target, Insts.back().addOperand(MCOperand::createImm(1)); // ScaleAmt Insts.back().addOperand(MCOperand::createReg(X86::NoRegister)); // IndexReg - Insts.back().addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, - *Ctx))); // Displacement + Insts.back().addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Target, + *Ctx))); // Displacement Insts.back().addOperand( MCOperand::createReg(X86::NoRegister)); // AddrSegmentReg return Insts; @@ -1625,9 +1624,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { Inst.insert(Inst.begin(), MCOperand::createReg(X86::NoRegister)); // AddrSegmentReg Inst.insert(Inst.begin(), - MCOperand::createExpr( // Displacement - MCSymbolRefExpr::create(TargetLocation, - MCSymbolRefExpr::VK_None, *Ctx))); + MCOperand::createExpr( // Displacement + MCSymbolRefExpr::create(TargetLocation, *Ctx))); Inst.insert(Inst.begin(), MCOperand::createReg(X86::NoRegister)); // IndexReg Inst.insert(Inst.begin(), @@ -2420,8 +2418,7 @@ class X86MCPlusBuilder : public MCPlusBuilder { .addReg(RegNo) .addImm(Imm)); Code.emplace_back(MCInstBuilder(X86::JCC_1) - .addExpr(MCSymbolRefExpr::create( - Target, MCSymbolRefExpr::VK_None, *Ctx)) + .addExpr(MCSymbolRefExpr::create(Target, *Ctx)) .addImm(X86::COND_E)); return Code; } @@ -2432,8 +2429,7 @@ class X86MCPlusBuilder : public MCPlusBuilder { InstructionListType Code; Code.emplace_back(MCInstBuilder(X86::CMP64ri8).addReg(RegNo).addImm(Imm)); Code.emplace_back(MCInstBuilder(X86::JCC_1) - .addExpr(MCSymbolRefExpr::create( - Target, MCSymbolRefExpr::VK_None, *Ctx)) + .addExpr(MCSymbolRefExpr::create(Target, *Ctx)) .addImm(X86::COND_NE)); return Code; } @@ -2447,7 +2443,7 @@ class X86MCPlusBuilder : public MCPlusBuilder { const uint64_t RelOffset = Fixup.getOffset(); uint32_t RelType; - if (FKI.Flags & MCFixupKindInfo::FKF_IsPCRel) { + if (Fixup.isPCRel()) { switch (FKI.TargetSize) { default: return std::nullopt; @@ -2738,24 +2734,23 @@ class X86MCPlusBuilder : public MCPlusBuilder { Inst.clear(); Inst.setOpcode(X86::JMP_1); Inst.clear(); - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx))); + Inst.addOperand(MCOperand::createExpr(MCSymbolRefExpr::create(TBB, *Ctx))); } void createLongUncondBranch(MCInst &Inst, const MCSymbol *Target, MCContext *Ctx) const override { Inst.setOpcode(X86::JMP_4); Inst.clear(); - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx))); + Inst.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Target, *Ctx))); } void createCall(MCInst &Inst, const MCSymbol *Target, MCContext *Ctx) override { Inst.setOpcode(X86::CALL64pcrel32); Inst.clear(); - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx))); + Inst.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Target, *Ctx))); } void createTailCall(MCInst &Inst, const MCSymbol *Target, @@ -2779,8 +2774,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { MCContext *Ctx) const override { Inst.setOpcode(X86::JCC_1); Inst.clear(); - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx))); + Inst.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Target, *Ctx))); Inst.addOperand(MCOperand::createImm(CC)); } @@ -2788,8 +2783,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { MCContext *Ctx) const override { Inst.setOpcode(X86::JCC_4); Inst.clear(); - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx))); + Inst.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Target, *Ctx))); Inst.addOperand(MCOperand::createImm(CC)); } @@ -2798,8 +2793,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { unsigned InvCC = getInvertedCondCode(getCondCode(Inst)); assert(InvCC != X86::COND_INVALID && "invalid branch instruction"); Inst.getOperand(Info->get(Inst.getOpcode()).NumOperands - 1).setImm(InvCC); - Inst.getOperand(0) = MCOperand::createExpr( - MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx)); + Inst.getOperand(0) = + MCOperand::createExpr(MCSymbolRefExpr::create(TBB, *Ctx)); } bool replaceBranchCondition(MCInst &Inst, const MCSymbol *TBB, MCContext *Ctx, @@ -2807,8 +2802,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { if (CC == X86::COND_INVALID) return false; Inst.getOperand(Info->get(Inst.getOpcode()).NumOperands - 1).setImm(CC); - Inst.getOperand(0) = MCOperand::createExpr( - MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx)); + Inst.getOperand(0) = + MCOperand::createExpr(MCSymbolRefExpr::create(TBB, *Ctx)); return true; } @@ -2846,8 +2841,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { MCContext *Ctx) const override { assert((isCall(Inst) || isBranch(Inst)) && !isIndirectBranch(Inst) && "Invalid instruction"); - Inst.getOperand(0) = MCOperand::createExpr( - MCSymbolRefExpr::create(TBB, MCSymbolRefExpr::VK_None, *Ctx)); + Inst.getOperand(0) = + MCOperand::createExpr(MCSymbolRefExpr::create(TBB, *Ctx)); } MCPhysReg getX86R11() const override { return X86::R11; } @@ -2894,8 +2889,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { bool IsTailCall) override { Inst.clear(); Inst.setOpcode(IsTailCall ? X86::JMP_4 : X86::CALL64pcrel32); - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx))); + Inst.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Target, *Ctx))); if (IsTailCall) setTailCall(Inst); } @@ -2905,8 +2900,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { Seq.clear(); MCInst Inst; Inst.setOpcode(X86::JMP_1); - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Target, MCSymbolRefExpr::VK_None, *Ctx))); + Inst.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Target, *Ctx))); if (IsTailCall) setTailCall(Inst); Seq.emplace_back(Inst); @@ -3332,8 +3327,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { Target.addOperand(MCOperand::createReg(FuncAddrReg)); if (Targets[i].first) { // Is this OK? - Target.addOperand(MCOperand::createExpr(MCSymbolRefExpr::create( - Targets[i].first, MCSymbolRefExpr::VK_None, *Ctx))); + Target.addOperand(MCOperand::createExpr( + MCSymbolRefExpr::create(Targets[i].first, *Ctx))); } else { const uint64_t Addr = Targets[i].second; // Immediate address is out of sign extended 32 bit range. @@ -3409,8 +3404,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { Je.clear(); Je.setOpcode(X86::JCC_1); if (Targets[i].first) - Je.addOperand(MCOperand::createExpr(MCSymbolRefExpr::create( - Targets[i].first, MCSymbolRefExpr::VK_None, *Ctx))); + Je.addOperand(MCOperand::createExpr( + MCSymbolRefExpr::create(Targets[i].first, *Ctx))); else Je.addOperand(MCOperand::createImm(Targets[i].second)); @@ -3422,8 +3417,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { // Jump to next compare if target addresses don't match. Jne.clear(); Jne.setOpcode(X86::JCC_1); - Jne.addOperand(MCOperand::createExpr(MCSymbolRefExpr::create( - NextTarget, MCSymbolRefExpr::VK_None, *Ctx))); + Jne.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(NextTarget, *Ctx))); Jne.addOperand(MCOperand::createImm(X86::COND_NE)); // Call specific target directly. @@ -3442,8 +3437,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { CallOrJmp.setOpcode(IsTailCall ? X86::JMP_4 : X86::CALL64pcrel32); if (Targets[i].first) - CallOrJmp.addOperand(MCOperand::createExpr(MCSymbolRefExpr::create( - Targets[i].first, MCSymbolRefExpr::VK_None, *Ctx))); + CallOrJmp.addOperand(MCOperand::createExpr( + MCSymbolRefExpr::create(Targets[i].first, *Ctx))); else CallOrJmp.addOperand(MCOperand::createImm(Targets[i].second)); } @@ -3545,8 +3540,8 @@ class X86MCPlusBuilder : public MCPlusBuilder { // Jump to target if indices match JEInst.setOpcode(X86::JCC_1); - JEInst.addOperand(MCOperand::createExpr(MCSymbolRefExpr::create( - Targets[i].first, MCSymbolRefExpr::VK_None, *Ctx))); + JEInst.addOperand(MCOperand::createExpr( + MCSymbolRefExpr::create(Targets[i].first, *Ctx))); JEInst.addOperand(MCOperand::createImm(X86::COND_E)); } @@ -3571,9 +3566,9 @@ class X86MCPlusBuilder : public MCPlusBuilder { Inst.addOperand(MCOperand::createReg(X86::RIP)); // BaseReg Inst.addOperand(MCOperand::createImm(1)); // ScaleAmt Inst.addOperand(MCOperand::createReg(X86::NoRegister)); // IndexReg - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Src, MCSymbolRefExpr::VK_None, - *Ctx))); // Displacement + Inst.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Src, + *Ctx))); // Displacement Inst.addOperand(MCOperand::createReg(X86::NoRegister)); // AddrSegmentReg } @@ -3585,9 +3580,9 @@ class X86MCPlusBuilder : public MCPlusBuilder { Inst.addOperand(MCOperand::createReg(X86::RIP)); // BaseReg Inst.addOperand(MCOperand::createImm(1)); // ScaleAmt Inst.addOperand(MCOperand::createReg(X86::NoRegister)); // IndexReg - Inst.addOperand(MCOperand::createExpr( - MCSymbolRefExpr::create(Src, MCSymbolRefExpr::VK_None, - *Ctx))); // Displacement + Inst.addOperand( + MCOperand::createExpr(MCSymbolRefExpr::create(Src, + *Ctx))); // Displacement Inst.addOperand(MCOperand::createReg(X86::NoRegister)); // AddrSegmentReg } }; diff --git a/bolt/test/X86/zero-density.s b/bolt/test/X86/zero-density.s new file mode 100644 index 000000000000..7843804ffed8 --- /dev/null +++ b/bolt/test/X86/zero-density.s @@ -0,0 +1,32 @@ +## Check that trampoline functions are excluded from density computation. + +# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o +# RUN: ld.lld %t.o -o %t +# RUN: link_fdata %s %t %t.preagg PREAGG +# RUN: llvm-strip -NLjmp %t +# RUN: perf2bolt %t -p %t.preagg --pa -o %t.fdata | FileCheck %s +# CHECK: Functions with density >= {{.*}} account for 99.00% total sample counts. +# CHECK-NOT: the output profile is empty or the --profile-density-cutoff-hot option is set too low. + + .text + .globl trampoline +trampoline: + mov main,%rax + jmpq *%rax +.size trampoline,.-trampoline +# PREAGG: f #trampoline# #trampoline# 2 + + .globl main +main: + .cfi_startproc + vmovaps %zmm31,%zmm3 + + add $0x4,%r9 + add $0x40,%r10 + dec %r14 +Ljmp: + jne main +# PREAGG: T #Ljmp# #main# #Ljmp# 10 + ret + .cfi_endproc +.size main,.-main diff --git a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s index 284f0bea607a..8e991fade2c8 100644 --- a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s +++ b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s @@ -18,6 +18,10 @@ f1: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: ret @@ -40,6 +44,10 @@ f_intermediate_overwrite1: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: autiasp // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 @@ -63,6 +71,10 @@ f_intermediate_overwrite2: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x30, x0 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autiasp @@ -102,6 +114,10 @@ f_intermediate_overwrite3: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w30, w0 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autiasp @@ -126,6 +142,10 @@ f_nonx30_ret: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x16, x30 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: mov x16, x30 @@ -215,7 +235,7 @@ f_callclobbered_calleesaved: .globl f_unreachable_instruction .type f_unreachable_instruction,@function f_unreachable_instruction: -// CHECK-LABEL: GS-PAUTH: Warning: unreachable instruction found in function f_unreachable_instruction, basic block {{[0-9a-zA-Z.]+}}, at address +// CHECK-LABEL: GS-PAUTH: Warning: possibly imprecise CFG, the analysis quality may be degraded in this function. According to BOLT, unreachable code is found in function f_unreachable_instruction, basic block {{[0-9a-zA-Z.]+}}, at address // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: add x0, x1, x2 // CHECK-NOT: instructions that write to the affected registers after any authentication are: b 1f @@ -224,20 +244,33 @@ f_unreachable_instruction: ret .size f_unreachable_instruction, .-f_unreachable_instruction -// Expected false positive: without CFG, the state is reset to all-unsafe -// after an unconditional branch. +// Without CFG, the state is reset at labels, assuming every register that can +// be clobbered in the function was actually clobbered. - .globl state_is_reset_after_indirect_branch_nocfg - .type state_is_reset_after_indirect_branch_nocfg,@function -state_is_reset_after_indirect_branch_nocfg: -// CHECK-LABEL: GS-PAUTH: non-protected ret found in function state_is_reset_after_indirect_branch_nocfg, at address -// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: ret + .globl lr_untouched_nocfg + .type lr_untouched_nocfg,@function +lr_untouched_nocfg: +// CHECK-NOT: lr_untouched_nocfg + adr x2, 1f + br x2 +1: + ret + .size lr_untouched_nocfg, .-lr_untouched_nocfg + + .globl lr_clobbered_nocfg + .type lr_clobbered_nocfg,@function +lr_clobbered_nocfg: +// CHECK-LABEL: GS-PAUTH: non-protected ret found in function lr_clobbered_nocfg, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: ret // CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: adr x2, 1f br x2 1: + b 2f + bl g // never executed, but affects the expected worst-case scenario +2: ret - .size state_is_reset_after_indirect_branch_nocfg, .-state_is_reset_after_indirect_branch_nocfg + .size lr_clobbered_nocfg, .-lr_clobbered_nocfg /// Now do a basic sanity check on every different Authentication instruction: @@ -312,6 +345,10 @@ f_autia1716: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autia1716 @@ -334,6 +371,10 @@ f_autib1716: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autib1716 @@ -356,6 +397,10 @@ f_autiax12: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autia x12, sp @@ -378,6 +423,10 @@ f_autibx12: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autib x12, sp @@ -429,6 +478,10 @@ f_autdax12: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autda x12, sp @@ -451,6 +504,10 @@ f_autdbx12: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autdb x12, sp @@ -502,6 +559,10 @@ f_autizax12: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autiza x12 @@ -524,6 +585,10 @@ f_autizbx12: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autizb x12 @@ -575,6 +640,10 @@ f_autdzax12: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autdza x12 @@ -597,6 +666,10 @@ f_autdzbx12: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autdzb x12 @@ -855,6 +928,10 @@ f_autia171615: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autia171615 @@ -877,6 +954,10 @@ f_autib171615: // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp +// CHECK-NEXT: {{[0-9a-f]+}}: bl g // CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3 // CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 // CHECK-NEXT: {{[0-9a-f]+}}: autib171615 @@ -884,3 +965,9 @@ f_autib171615: ret .size f_autib171615, .-f_autib171615 + .globl g + .type g,@function +g: + nop + ret + .size g, .-g diff --git a/bolt/test/binary-analysis/AArch64/gs-pauth-authentication-oracles.s b/bolt/test/binary-analysis/AArch64/gs-pauth-authentication-oracles.s index 717bf40df3d0..c314bc7cfe5a 100644 --- a/bolt/test/binary-analysis/AArch64/gs-pauth-authentication-oracles.s +++ b/bolt/test/binary-analysis/AArch64/gs-pauth-authentication-oracles.s @@ -491,10 +491,6 @@ good_address_arith_multi_bb: ret .size good_address_arith_multi_bb, .-good_address_arith_multi_bb -// FIXME: Most *_nocfg test cases contain paciasp+autiasp instructions even if -// LR is not spilled - this is a workaround for RET instructions being -// reported as non-protected, because LR state is reset at every label. - .globl good_ret_nocfg .type good_ret_nocfg,@function good_ret_nocfg: @@ -541,14 +537,12 @@ good_branch_nocfg: .type good_load_other_reg_nocfg,@function good_load_other_reg_nocfg: // CHECK-NOT: good_load_other_reg_nocfg - paciasp adr x2, 1f br x2 1: autia x0, x1 ldr x2, [x0] - autiasp ret .size good_load_other_reg_nocfg, .-good_load_other_reg_nocfg @@ -556,14 +550,12 @@ good_load_other_reg_nocfg: .type good_load_same_reg_nocfg,@function good_load_same_reg_nocfg: // CHECK-NOT: good_load_same_reg_nocfg - paciasp adr x2, 1f br x2 1: autia x0, x1 ldr x0, [x0] - autiasp ret .size good_load_same_reg_nocfg, .-good_load_same_reg_nocfg @@ -575,13 +567,11 @@ bad_unchecked_nocfg: // CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_unchecked_nocfg, at address // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1 // CHECK-NEXT: The 0 instructions that leak the affected registers are: - paciasp adr x2, 1f br x2 1: autia x0, x1 - autiasp ret .size bad_unchecked_nocfg, .-bad_unchecked_nocfg @@ -615,7 +605,6 @@ bad_unknown_usage_read_nocfg: // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1 // CHECK-NEXT: The 1 instructions that leak the affected registers are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: mul x3, x0, x1 - paciasp adr x2, 1f br x2 1: @@ -623,7 +612,6 @@ bad_unknown_usage_read_nocfg: mul x3, x0, x1 ldr x2, [x0] - autiasp ret .size bad_unknown_usage_read_nocfg, .-bad_unknown_usage_read_nocfg @@ -634,7 +622,6 @@ bad_unknown_usage_subreg_read_nocfg: // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1 // CHECK-NEXT: The 1 instructions that leak the affected registers are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: mul w3, w0, w1 - paciasp adr x2, 1f br x2 1: @@ -642,7 +629,6 @@ bad_unknown_usage_subreg_read_nocfg: mul w3, w0, w1 ldr x2, [x0] - autiasp ret .size bad_unknown_usage_subreg_read_nocfg, .-bad_unknown_usage_subreg_read_nocfg @@ -653,7 +639,6 @@ bad_unknown_usage_update_nocfg: // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1 // CHECK-NEXT: The 1 instructions that leak the affected registers are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: movk x0, #0x2a, lsl #16 - paciasp adr x2, 1f br x2 1: @@ -661,7 +646,6 @@ bad_unknown_usage_update_nocfg: movk x0, #42, lsl #16 // does not overwrite x0 completely ldr x2, [x0] - autiasp ret .size bad_unknown_usage_update_nocfg, .-bad_unknown_usage_update_nocfg @@ -669,14 +653,12 @@ bad_unknown_usage_update_nocfg: .type good_overwrite_with_constant_nocfg,@function good_overwrite_with_constant_nocfg: // CHECK-NOT: good_overwrite_with_constant_nocfg - paciasp adr x2, 1f br x2 1: autia x0, x1 mov x0, #42 - autiasp ret .size good_overwrite_with_constant_nocfg, .-good_overwrite_with_constant_nocfg @@ -684,7 +666,6 @@ good_overwrite_with_constant_nocfg: .type good_address_arith_nocfg,@function good_address_arith_nocfg: // CHECK-NOT: good_address_arith_nocfg - paciasp adr x2, 1f br x2 1: @@ -698,7 +679,6 @@ good_address_arith_nocfg: mov x1, #0 mov x2, #0 - autiasp ret .size good_address_arith_nocfg, .-good_address_arith_nocfg diff --git a/bolt/test/binary-analysis/AArch64/gs-pauth-calls.s b/bolt/test/binary-analysis/AArch64/gs-pauth-calls.s index c79c5926a05c..fb0bc7cff237 100644 --- a/bolt/test/binary-analysis/AArch64/gs-pauth-calls.s +++ b/bolt/test/binary-analysis/AArch64/gs-pauth-calls.s @@ -1428,6 +1428,90 @@ printed_instrs_nocfg: br x0 .size printed_instrs_nocfg, .-printed_instrs_nocfg +// Test handling of unreachable basic blocks. +// +// Basic blocks without any predecessors were observed in real-world optimized +// code. At least sometimes they were actually reachable via jump table, which +// was not detected, but the function was processed as if its CFG was +// reconstructed successfully. +// +// As a more predictable model example, let's use really unreachable code +// for testing. + + .globl bad_unreachable_call + .type bad_unreachable_call,@function +bad_unreachable_call: +// CHECK-LABEL: GS-PAUTH: Warning: possibly imprecise CFG, the analysis quality may be degraded in this function. According to BOLT, unreachable code is found in function bad_unreachable_call, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: blr x0 +// CHECK-NOT: instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: non-protected call found in function bad_unreachable_call, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: blr x0 +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: + paciasp + stp x29, x30, [sp, #-16]! + mov x29, sp + + b 1f + // unreachable basic block: + blr x0 + +1: // reachable basic block: + ldp x29, x30, [sp], #16 + autiasp + ret + .size bad_unreachable_call, .-bad_unreachable_call + + .globl good_unreachable_call + .type good_unreachable_call,@function +good_unreachable_call: +// CHECK-NOT: non-protected call{{.*}}good_unreachable_call +// CHECK-LABEL: GS-PAUTH: Warning: possibly imprecise CFG, the analysis quality may be degraded in this function. According to BOLT, unreachable code is found in function good_unreachable_call, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1 +// CHECK-NOT: instructions that write to the affected registers after any authentication are: +// CHECK-NOT: non-protected call{{.*}}good_unreachable_call + paciasp + stp x29, x30, [sp, #-16]! + mov x29, sp + + b 1f + // unreachable basic block: + autia x0, x1 + blr x0 // <-- this call is definitely protected provided at least + // basic block boundaries are detected correctly + +1: // reachable basic block: + ldp x29, x30, [sp], #16 + autiasp + ret + .size good_unreachable_call, .-good_unreachable_call + + .globl unreachable_loop_of_bbs + .type unreachable_loop_of_bbs,@function +unreachable_loop_of_bbs: +// CHECK-NOT: unreachable basic blocks{{.*}}unreachable_loop_of_bbs +// CHECK-NOT: non-protected call{{.*}}unreachable_loop_of_bbs +// CHECK-LABEL: GS-PAUTH: Warning: possibly imprecise CFG, the analysis quality may be degraded in this function. According to BOLT, unreachable code is found in function unreachable_loop_of_bbs, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: blr x0 +// CHECK-NOT: unreachable basic blocks{{.*}}unreachable_loop_of_bbs +// CHECK-NOT: non-protected call{{.*}}unreachable_loop_of_bbs + paciasp + stp x29, x30, [sp, #-16]! + mov x29, sp + b .Lreachable_epilogue_bb + +.Lfirst_unreachable_bb: + blr x0 // <-- this call is not analyzed + b .Lsecond_unreachable_bb +.Lsecond_unreachable_bb: + blr x1 // <-- this call is not analyzed + b .Lfirst_unreachable_bb + +.Lreachable_epilogue_bb: + ldp x29, x30, [sp], #16 + autiasp + ret + .size unreachable_loop_of_bbs, .-unreachable_loop_of_bbs + .globl main .type main,@function main: diff --git a/bolt/test/binary-analysis/AArch64/gs-pauth-debug-output.s b/bolt/test/binary-analysis/AArch64/gs-pauth-debug-output.s index fbb96a63d41e..b1cec7f92ad0 100644 --- a/bolt/test/binary-analysis/AArch64/gs-pauth-debug-output.s +++ b/bolt/test/binary-analysis/AArch64/gs-pauth-debug-output.s @@ -199,8 +199,8 @@ nocfg: // CHECK-NEXT: SrcSafetyAnalysis::ComputeNext( br x0, src-state) // CHECK-NEXT: .. result: (src-state) // CHECK-NEXT: Due to label, resetting the state before: 00000000: ret # Offset: 8 -// CHECK-NEXT: SrcSafetyAnalysis::ComputeNext( ret x30, src-state) -// CHECK-NEXT: .. result: (src-state) +// CHECK-NEXT: SrcSafetyAnalysis::ComputeNext( ret x30, src-state) +// CHECK-NEXT: .. result: (src-state) // CHECK-NEXT: After src register safety analysis: // CHECK-NEXT: Binary Function "nocfg" { // CHECK-NEXT: Number : 3 @@ -223,33 +223,7 @@ nocfg: // PAUTH-NEXT: SafeToDerefRegs: LR W0 W30 X0 W0_HI W30_HI{{[ \t]*$}} // CHECK-NEXT: Found RET inst: 00000000: ret # Offset: 8 # CFGUnawareSrcSafetyAnalysis: src-state // CHECK-NEXT: RetReg: LR -// CHECK-NEXT: SafeToDerefRegs:{{[ \t]*$}} -// CHECK-EMPTY: -// CHECK-NEXT: Running detailed src register safety analysis... -// CHECK-NEXT: SrcSafetyAnalysis::ComputeNext( adr x0, __ENTRY_nocfg@0x[[ENTRY_ADDR]], src-state) -// CHECK-NEXT: .. result: (src-state) -// CHECK-NEXT: SrcSafetyAnalysis::ComputeNext( br x0, src-state) -// CHECK-NEXT: .. result: (src-state) -// CHECK-NEXT: Due to label, resetting the state before: 00000000: ret # Offset: 8 -// CHECK-NEXT: SrcSafetyAnalysis::ComputeNext( ret x30, src-state) -// CHECK-NEXT: .. result: (src-state) -// CHECK-NEXT: After detailed src register safety analysis: -// CHECK-NEXT: Binary Function "nocfg" { -// CHECK-NEXT: Number : 3 -// ... -// CHECK: Secondary Entry Points : __ENTRY_nocfg@0x[[ENTRY_ADDR]] -// CHECK-NEXT: } -// CHECK-NEXT: .{{[A-Za-z0-9]+}}: -// CHECK-NEXT: 00000000: adr x0, __ENTRY_nocfg@0x[[ENTRY_ADDR]] # CFGUnawareSrcSafetyAnalysis: src-state -// CHECK-NEXT: 00000004: br x0 # UNKNOWN CONTROL FLOW # Offset: 4 # CFGUnawareSrcSafetyAnalysis: src-state -// CHECK-NEXT: __ENTRY_nocfg@0x[[ENTRY_ADDR]] (Entry Point): -// CHECK-NEXT: .{{[A-Za-z0-9]+}}: -// CHECK-NEXT: 00000008: ret # Offset: 8 # CFGUnawareSrcSafetyAnalysis: src-state -// CHECK-NEXT: DWARF CFI Instructions: -// CHECK-NEXT: -// CHECK-NEXT: End of Function "nocfg" -// CHECK-EMPTY: -// CHECK-NEXT: Attaching clobbering info to: 00000000: ret # Offset: 8 # CFGUnawareSrcSafetyAnalysis: src-state +// CHECK-NEXT: SafeToDerefRegs: LR W30 W30_HI{{[ \t]*$}} .globl auth_oracle .type auth_oracle,@function diff --git a/bolt/test/binary-analysis/AArch64/gs-pauth-signing-oracles.s b/bolt/test/binary-analysis/AArch64/gs-pauth-signing-oracles.s index 334a4108d8ab..3a4d383ec5bc 100644 --- a/bolt/test/binary-analysis/AArch64/gs-pauth-signing-oracles.s +++ b/bolt/test/binary-analysis/AArch64/gs-pauth-signing-oracles.s @@ -505,21 +505,16 @@ bad_one_auted_one_checked_multi_bb: // * untrusted: not even s-t-d - from arg and from memory // * untrusted: subreg clobbered - between address materialization and use, between auth and check, between check and use // * untrusted: first checked then auted, auted then auted, checked then checked -// -// Note that it is important to sign and authenticate LR, as it is not kept -// safe-to-dereference across unconditional branches. .globl good_sign_addr_mat_nocfg .type good_sign_addr_mat_nocfg,@function good_sign_addr_mat_nocfg: // CHECK-NOT: good_sign_addr_mat_nocfg - paciasp adr x3, 1f br x3 1: adr x0, sym pacda x0, x1 - autiasp ret .size good_sign_addr_mat_nocfg, .-good_sign_addr_mat_nocfg @@ -527,14 +522,12 @@ good_sign_addr_mat_nocfg: .type good_sign_auted_checked_ldr_nocfg,@function good_sign_auted_checked_ldr_nocfg: // CHECK-NOT: good_sign_auted_checked_ldr_nocfg - paciasp adr x3, 1f br x3 1: autda x0, x2 ldr x2, [x0] pacda x0, x1 - autiasp ret .size good_sign_auted_checked_ldr_nocfg, .-good_sign_auted_checked_ldr_nocfg @@ -544,13 +537,11 @@ bad_sign_authed_unchecked_nocfg: // CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_sign_authed_unchecked_nocfg, at address // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: - paciasp adr x3, 1f br x3 1: autda x0, x2 pacda x0, x1 - autiasp ret .size bad_sign_authed_unchecked_nocfg, .-bad_sign_authed_unchecked_nocfg @@ -560,13 +551,11 @@ bad_sign_checked_not_auted_nocfg: // CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_sign_checked_not_auted_nocfg, at address // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: - paciasp adr x3, 1f br x3 1: ldr x2, [x0] pacda x0, x1 - autiasp ret .size bad_sign_checked_not_auted_nocfg, .-bad_sign_checked_not_auted_nocfg @@ -576,12 +565,10 @@ bad_sign_plain_arg_nocfg: // CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_sign_plain_arg_nocfg, at address // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: - paciasp adr x3, 1f br x3 1: pacda x0, x1 - autiasp ret .size bad_sign_plain_arg_nocfg, .-bad_sign_plain_arg_nocfg @@ -592,13 +579,11 @@ bad_sign_plain_mem_nocfg: // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: ldr x0, [x1] - paciasp adr x3, 1f br x3 1: ldr x0, [x1] pacda x0, x1 - autiasp ret .size bad_sign_plain_mem_nocfg, .-bad_sign_plain_mem_nocfg @@ -609,14 +594,12 @@ bad_clobber_between_addr_mat_and_use_nocfg: // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w0, w4 - paciasp adr x3, 1f br x3 1: adr x0, sym mov w0, w4 pacda x0, x1 - autiasp ret .size bad_clobber_between_addr_mat_and_use_nocfg, .-bad_clobber_between_addr_mat_and_use_nocfg @@ -627,7 +610,6 @@ bad_clobber_between_auted_and_checked_nocfg: // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w0, w4 - paciasp adr x3, 1f br x3 1: @@ -635,7 +617,6 @@ bad_clobber_between_auted_and_checked_nocfg: mov w0, w4 ldr x2, [x0] pacda x0, x1 - autiasp ret .size bad_clobber_between_auted_and_checked_nocfg, .-bad_clobber_between_auted_and_checked_nocfg @@ -646,7 +627,6 @@ bad_clobber_between_checked_and_used_nocfg: // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: // CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w0, w4 - paciasp adr x3, 1f br x3 1: @@ -654,7 +634,6 @@ bad_clobber_between_checked_and_used_nocfg: ldr x2, [x0] mov w0, w4 pacda x0, x1 - autiasp ret .size bad_clobber_between_checked_and_used_nocfg, .-bad_clobber_between_checked_and_used_nocfg @@ -664,14 +643,12 @@ bad_transition_check_then_auth_nocfg: // CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_transition_check_then_auth_nocfg, at address // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: - paciasp adr x3, 1f br x3 1: ldr x2, [x0] autda x0, x2 pacda x0, x1 - autiasp ret .size bad_transition_check_then_auth_nocfg, .-bad_transition_check_then_auth_nocfg @@ -681,14 +658,12 @@ bad_transition_auth_then_auth_nocfg: // CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_transition_auth_then_auth_nocfg, at address // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: - paciasp adr x3, 1f br x3 1: autda x0, x2 autda x0, x2 pacda x0, x1 - autiasp ret .size bad_transition_auth_then_auth_nocfg, .-bad_transition_auth_then_auth_nocfg @@ -698,14 +673,12 @@ bad_transition_check_then_check_nocfg: // CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_transition_check_then_check_nocfg, at address // CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1 // CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: - paciasp adr x3, 1f br x3 1: ldr x2, [x0] ldr x2, [x0] pacda x0, x1 - autiasp ret .size bad_transition_check_then_check_nocfg, .-bad_transition_check_then_check_nocfg diff --git a/bolt/test/binary-analysis/AArch64/gs-pauth-tail-calls.s b/bolt/test/binary-analysis/AArch64/gs-pauth-tail-calls.s new file mode 100644 index 000000000000..2d3c2f1a632c --- /dev/null +++ b/bolt/test/binary-analysis/AArch64/gs-pauth-tail-calls.s @@ -0,0 +1,597 @@ +// RUN: %clang %cflags -Wl,--entry=_custom_start -march=armv8.3-a %s -o %t.exe +// RUN: llvm-bolt-binary-analysis --scanners=pacret %t.exe 2>&1 | FileCheck -check-prefix=PACRET %s +// RUN: llvm-bolt-binary-analysis --scanners=pauth %t.exe 2>&1 | FileCheck %s + +// PACRET-NOT: untrusted link register found before tail call + + .text + + .globl callee + .type callee,@function +callee: + ret + .size callee, .-callee + + .globl good_direct_tailcall_no_clobber + .type good_direct_tailcall_no_clobber,@function +good_direct_tailcall_no_clobber: +// CHECK-NOT: good_direct_tailcall_no_clobber + b callee + .size good_direct_tailcall_no_clobber, .-good_direct_tailcall_no_clobber + + .globl good_plt_tailcall_no_clobber + .type good_plt_tailcall_no_clobber,@function +good_plt_tailcall_no_clobber: +// CHECK-NOT: good_plt_tailcall_no_clobber + b callee_ext + .size good_plt_tailcall_no_clobber, .-good_plt_tailcall_no_clobber + + .globl good_indirect_tailcall_no_clobber + .type good_indirect_tailcall_no_clobber,@function +good_indirect_tailcall_no_clobber: +// CHECK-NOT: good_indirect_tailcall_no_clobber + autia x0, x1 + br x0 + .size good_indirect_tailcall_no_clobber, .-good_indirect_tailcall_no_clobber + + .globl bad_direct_tailcall_not_auted + .type bad_direct_tailcall_not_auted,@function +bad_direct_tailcall_not_auted: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_direct_tailcall_not_auted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b callee # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: b callee # TAILCALL + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + b callee + .size bad_direct_tailcall_not_auted, .-bad_direct_tailcall_not_auted + + .globl bad_plt_tailcall_not_auted + .type bad_plt_tailcall_not_auted,@function +bad_plt_tailcall_not_auted: +// FIXME: Calls via PLT are disassembled incorrectly. Nevertheless, they are +// still detected as tail calls. +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_plt_tailcall_not_auted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b bad_indirect_tailcall_not_auted # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: b bad_indirect_tailcall_not_auted # TAILCALL + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + b callee_ext + .size bad_plt_tailcall_not_auted, .-bad_plt_tailcall_not_auted + + .globl bad_indirect_tailcall_not_auted + .type bad_indirect_tailcall_not_auted,@function +bad_indirect_tailcall_not_auted: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_indirect_tailcall_not_auted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: br x0 # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: autia x0, x1 +// CHECK-NEXT: {{[0-9a-f]+}}: br x0 # TAILCALL + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autia x0, x1 + br x0 + .size bad_indirect_tailcall_not_auted, .-bad_indirect_tailcall_not_auted + + .globl bad_direct_tailcall_untrusted + .type bad_direct_tailcall_untrusted,@function +bad_direct_tailcall_untrusted: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_direct_tailcall_untrusted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b callee # TAILCALL +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_direct_tailcall_untrusted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 1 instructions that leak the affected registers are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: b callee # TAILCALL +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: {{[0-9a-f]+}}: b callee # TAILCALL + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + b callee + .size bad_direct_tailcall_untrusted, .-bad_direct_tailcall_untrusted + + .globl bad_plt_tailcall_untrusted + .type bad_plt_tailcall_untrusted,@function +bad_plt_tailcall_untrusted: +// FIXME: Calls via PLT are disassembled incorrectly. Nevertheless, they are +// still detected as tail calls. +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_plt_tailcall_untrusted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b bad_indirect_tailcall_untrusted # TAILCALL +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_plt_tailcall_untrusted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 1 instructions that leak the affected registers are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: b bad_indirect_tailcall_untrusted # TAILCALL +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: {{[0-9a-f]+}}: b bad_indirect_tailcall_untrusted # TAILCALL + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + b callee_ext + .size bad_plt_tailcall_untrusted, .-bad_plt_tailcall_untrusted + + .globl bad_indirect_tailcall_untrusted + .type bad_indirect_tailcall_untrusted,@function +bad_indirect_tailcall_untrusted: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_indirect_tailcall_untrusted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: br x0 # TAILCALL +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_indirect_tailcall_untrusted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 1 instructions that leak the affected registers are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: br x0 # TAILCALL +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: {{[0-9a-f]+}}: autia x0, x1 +// CHECK-NEXT: {{[0-9a-f]+}}: br x0 # TAILCALL + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + autia x0, x1 + br x0 + .size bad_indirect_tailcall_untrusted, .-bad_indirect_tailcall_untrusted + + .globl good_direct_tailcall_trusted + .type good_direct_tailcall_trusted,@function +good_direct_tailcall_trusted: +// CHECK-NOT: good_direct_tailcall_trusted + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + ldr w2, [x30] + b callee + .size good_direct_tailcall_trusted, .-good_direct_tailcall_trusted + + .globl good_plt_tailcall_trusted + .type good_plt_tailcall_trusted,@function +good_plt_tailcall_trusted: +// CHECK-NOT: good_plt_tailcall_trusted + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + ldr w2, [x30] + b callee_ext + .size good_plt_tailcall_trusted, .-good_plt_tailcall_trusted + + .globl good_indirect_tailcall_trusted + .type good_indirect_tailcall_trusted,@function +good_indirect_tailcall_trusted: +// CHECK-NOT: good_indirect_tailcall_trusted + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + ldr w2, [x30] + autia x0, x1 + br x0 + .size good_indirect_tailcall_trusted, .-good_indirect_tailcall_trusted + + .globl good_direct_tailcall_no_clobber_multi_bb + .type good_direct_tailcall_no_clobber_multi_bb,@function +good_direct_tailcall_no_clobber_multi_bb: +// CHECK-NOT: good_direct_tailcall_no_clobber_multi_bb + b 1f +1: + b callee + .size good_direct_tailcall_no_clobber_multi_bb, .-good_direct_tailcall_no_clobber_multi_bb + + .globl good_indirect_tailcall_no_clobber_multi_bb + .type good_indirect_tailcall_no_clobber_multi_bb,@function +good_indirect_tailcall_no_clobber_multi_bb: +// CHECK-NOT: good_indirect_tailcall_no_clobber_multi_bb + autia x0, x1 + b 1f +1: + br x0 + .size good_indirect_tailcall_no_clobber_multi_bb_multi_bb, .-good_indirect_tailcall_no_clobber_multi_bb_multi_bb + + .globl bad_direct_tailcall_not_auted_multi_bb + .type bad_direct_tailcall_not_auted_multi_bb,@function +bad_direct_tailcall_not_auted_multi_bb: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_direct_tailcall_not_auted_multi_bb, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b callee # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + cbz x3, 1f + autiasp + ldr w2, [x30] +1: + b callee + .size bad_direct_tailcall_not_auted_multi_bb, .-bad_direct_tailcall_not_auted_multi_bb + + .globl bad_indirect_tailcall_not_auted_multi_bb + .type bad_indirect_tailcall_not_auted_multi_bb,@function +bad_indirect_tailcall_not_auted_multi_bb: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_indirect_tailcall_not_auted_multi_bb, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: br x0 # UNKNOWN CONTROL FLOW +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + cbz x3, 1f + autiasp + ldr w2, [x30] +1: + autia x0, x1 + br x0 + .size bad_indirect_tailcall_not_auted_multi_bb, .-bad_indirect_tailcall_not_auted_multi_bb + + .globl bad_direct_tailcall_untrusted_multi_bb + .type bad_direct_tailcall_untrusted_multi_bb,@function +bad_direct_tailcall_untrusted_multi_bb: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_direct_tailcall_untrusted_multi_bb, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b callee # TAILCALL +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_direct_tailcall_untrusted_multi_bb, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 1 instructions that leak the affected registers are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: b callee # TAILCALL + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + cbz x3, 1f + ldr w2, [x30] +1: + b callee + .size bad_direct_tailcall_untrusted_multi_bb, .-bad_direct_tailcall_untrusted_multi_bb + + .globl bad_indirect_tailcall_untrusted_multi_bb + .type bad_indirect_tailcall_untrusted_multi_bb,@function +bad_indirect_tailcall_untrusted_multi_bb: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_indirect_tailcall_untrusted_multi_bb, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: br x0 # UNKNOWN CONTROL FLOW +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_indirect_tailcall_untrusted_multi_bb, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 0 instructions that leak the affected registers are: + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + cbz x3, 1f + ldr w2, [x30] +1: + autia x0, x1 + br x0 + .size bad_indirect_tailcall_untrusted_multi_bb, .-bad_indirect_tailcall_untrusted_multi_bb + + .globl good_direct_tailcall_trusted_multi_bb + .type good_direct_tailcall_trusted_multi_bb,@function +good_direct_tailcall_trusted_multi_bb: +// CHECK-NOT: good_direct_tailcall_trusted_multi_bb + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + ldr w2, [x30] + b 1f +1: + b callee + .size good_direct_tailcall_trusted_multi_bb, .-good_direct_tailcall_trusted_multi_bb + + .globl good_indirect_tailcall_trusted_multi_bb + .type good_indirect_tailcall_trusted_multi_bb,@function +good_indirect_tailcall_trusted_multi_bb: +// CHECK-NOT: good_indirect_tailcall_trusted_multi_bb + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + ldr w2, [x30] + b 1f +1: + autia x0, x1 + br x0 + .size good_indirect_tailcall_trusted_multi_bb, .-good_indirect_tailcall_trusted_multi_bb + + .globl good_direct_tailcall_no_clobber_nocfg + .type good_direct_tailcall_no_clobber_nocfg,@function +good_direct_tailcall_no_clobber_nocfg: +// CHECK-NOT: good_direct_tailcall_no_clobber_nocfg + adr x3, 1f + br x3 +1: + b callee + .size good_direct_tailcall_no_clobber_nocfg, .-good_direct_tailcall_no_clobber_nocfg + + .globl good_plt_tailcall_no_clobber_nocfg + .type good_plt_tailcall_no_clobber_nocfg,@function +good_plt_tailcall_no_clobber_nocfg: +// CHECK-NOT: good_plt_tailcall_no_clobber_nocfg + adr x3, 1f + br x3 +1: + b callee_ext + .size good_plt_tailcall_no_clobber_nocfg, .-good_plt_tailcall_no_clobber_nocfg + + .globl good_indirect_tailcall_no_clobber_nocfg + .type good_indirect_tailcall_no_clobber_nocfg,@function +good_indirect_tailcall_no_clobber_nocfg: +// CHECK-NOT: good_indirect_tailcall_no_clobber_nocfg + adr x3, 1f + br x3 +1: + autia x0, x1 + br x0 + .size good_indirect_tailcall_no_clobber_nocfg, .-good_indirect_tailcall_no_clobber_nocfg + + .globl bad_direct_tailcall_not_auted_nocfg + .type bad_direct_tailcall_not_auted_nocfg,@function +bad_direct_tailcall_not_auted_nocfg: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_direct_tailcall_not_auted_nocfg, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b callee # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + b callee + .size bad_direct_tailcall_not_auted_nocfg, .-bad_direct_tailcall_not_auted_nocfg + + .globl bad_plt_tailcall_not_auted_nocfg + .type bad_plt_tailcall_not_auted_nocfg,@function +bad_plt_tailcall_not_auted_nocfg: +// FIXME: Calls via PLT are disassembled incorrectly. Nevertheless, they are +// still detected as tail calls. +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_plt_tailcall_not_auted_nocfg, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b bad_indirect_tailcall_not_auted_nocfg # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + b callee_ext + .size bad_plt_tailcall_not_auted_nocfg, .-bad_plt_tailcall_not_auted_nocfg + + .globl bad_indirect_tailcall_not_auted_nocfg + .type bad_indirect_tailcall_not_auted_nocfg,@function +bad_indirect_tailcall_not_auted_nocfg: +// Known false positive: ignoring UNKNOWN CONTROL FLOW without CFG. +// CHECK-NOT: bad_indirect_tailcall_not_auted_nocfg + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + autia x0, x1 + br x0 + .size bad_indirect_tailcall_not_auted_nocfg, .-bad_indirect_tailcall_not_auted_nocfg + + .globl bad_direct_tailcall_untrusted_nocfg + .type bad_direct_tailcall_untrusted_nocfg,@function +bad_direct_tailcall_untrusted_nocfg: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_direct_tailcall_untrusted_nocfg, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b callee # TAILCALL +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_direct_tailcall_untrusted_nocfg, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 1 instructions that leak the affected registers are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: b callee # TAILCALL + paciasp + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + autiasp + b callee + .size bad_direct_tailcall_untrusted_nocfg, .-bad_direct_tailcall_untrusted_nocfg + + .globl bad_plt_tailcall_untrusted_nocfg + .type bad_plt_tailcall_untrusted_nocfg,@function +bad_plt_tailcall_untrusted_nocfg: +// FIXME: Calls via PLT are disassembled incorrectly. Nevertheless, they are +// still detected as tail calls. +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_plt_tailcall_untrusted_nocfg, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b bad_indirect_tailcall_untrusted_nocfg # TAILCALL +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_plt_tailcall_untrusted_nocfg, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 1 instructions that leak the affected registers are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: b bad_indirect_tailcall_untrusted_nocfg # TAILCALL + paciasp + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + autiasp + b callee_ext + .size bad_plt_tailcall_untrusted_nocfg, .-bad_plt_tailcall_untrusted_nocfg + + .globl bad_indirect_tailcall_untrusted_nocfg + .type bad_indirect_tailcall_untrusted_nocfg,@function +bad_indirect_tailcall_untrusted_nocfg: +// Known false negative: ignoring UNKNOWN CONTROL FLOW without CFG. +// Authentication oracle is found by a generic checker, though. +// CHECK-NOT: untrusted link register{{.*}}bad_indirect_tailcall_untrusted_nocfg +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_indirect_tailcall_untrusted_nocfg, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 0 instructions that leak the affected registers are: +// CHECK-NOT: untrusted link register{{.*}}bad_indirect_tailcall_untrusted_nocfg + paciasp + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + autiasp + autia x0, x1 + br x0 + .size bad_indirect_tailcall_untrusted_nocfg, .-bad_indirect_tailcall_untrusted_nocfg + + .globl good_direct_tailcall_trusted_nocfg + .type good_direct_tailcall_trusted_nocfg,@function +good_direct_tailcall_trusted_nocfg: +// CHECK-NOT: good_direct_tailcall_trusted_nocfg + paciasp + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + autiasp + ldr w2, [x30] + b callee + .size good_direct_tailcall_trusted_nocfg, .-good_direct_tailcall_trusted_nocfg + + .globl good_plt_tailcall_trusted_nocfg + .type good_plt_tailcall_trusted_nocfg,@function +good_plt_tailcall_trusted_nocfg: +// CHECK-NOT: good_plt_tailcall_trusted_nocfg + paciasp + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + autiasp + ldr w2, [x30] + b callee_ext + .size good_plt_tailcall_trusted_nocfg, .-good_plt_tailcall_trusted_nocfg + + .globl good_indirect_tailcall_trusted_nocfg + .type good_indirect_tailcall_trusted_nocfg,@function +good_indirect_tailcall_trusted_nocfg: +// CHECK-NOT: good_indirect_tailcall_trusted_nocfg + paciasp + stp x29, x30, [sp, #-0x10]! + adr x3, 1f + br x3 +1: + ldp x29, x30, [sp], #0x10 + autiasp + ldr w2, [x30] + autia x0, x1 + br x0 + .size good_indirect_tailcall_trusted_nocfg, .-good_indirect_tailcall_trusted_nocfg + +// Check Armv8.3-a fused auth+branch instructions. + + .globl good_indirect_tailcall_no_clobber_v83 + .type good_indirect_tailcall_no_clobber_v83,@function +good_indirect_tailcall_no_clobber_v83: +// CHECK-NOT: good_indirect_tailcall_no_clobber_v83 + braa x0, x1 + .size good_indirect_tailcall_no_clobber_v83, .-good_indirect_tailcall_no_clobber_v83 + + .globl bad_indirect_tailcall_untrusted_v83 + .type bad_indirect_tailcall_untrusted_v83,@function +bad_indirect_tailcall_untrusted_v83: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_indirect_tailcall_untrusted_v83, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: braa x0, x1 # TAILCALL +// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are: +// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_indirect_tailcall_untrusted_v83, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: The 1 instructions that leak the affected registers are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: braa x0, x1 # TAILCALL +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: paciasp +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: autiasp +// CHECK-NEXT: {{[0-9a-f]+}}: braa x0, x1 # TAILCALL + paciasp + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + autiasp + braa x0, x1 + .size bad_indirect_tailcall_untrusted_v83, .-bad_indirect_tailcall_untrusted_v83 + +// Make sure ELF entry function does not generate false positive reports. +// Additionally, check that the correct entry point is read from ELF header. + + .globl _start + .type _start,@function +_start: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function _start, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: b callee # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x30, #0x0 +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: mov x30, #0x0 +// CHECK-NEXT: {{[0-9a-f]+}}: b callee # TAILCALL + mov x30, #0 + b callee + .size _start, .-_start + + .globl _custom_start + .type _custom_start,@function +_custom_start: +// CHECK-NOT: _custom_start + mov x30, #0 + b callee + .size _custom_start, .-_custom_start + +// Test two issues being reported for the same instruction. + + .globl bad_non_protected_indirect_tailcall_not_auted + .type bad_non_protected_indirect_tailcall_not_auted,@function +bad_non_protected_indirect_tailcall_not_auted: +// CHECK-LABEL: GS-PAUTH: untrusted link register found before tail call in function bad_non_protected_indirect_tailcall_not_auted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: br x0 # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: ldr x0, [x1] +// CHECK-NEXT: {{[0-9a-f]+}}: br x0 # TAILCALL +// CHECK-LABEL: GS-PAUTH: non-protected call found in function bad_non_protected_indirect_tailcall_not_auted, basic block {{[^,]+}}, at address +// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: br x0 # TAILCALL +// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are: +// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldr x0, [x1] +// CHECK-NEXT: This happens in the following basic block: +// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]! +// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10 +// CHECK-NEXT: {{[0-9a-f]+}}: ldr x0, [x1] +// CHECK-NEXT: {{[0-9a-f]+}}: br x0 # TAILCALL + stp x29, x30, [sp, #-0x10]! + ldp x29, x30, [sp], #0x10 + ldr x0, [x1] + br x0 + .size bad_non_protected_indirect_tailcall_not_auted, .-bad_non_protected_indirect_tailcall_not_auted + + .globl main + .type main,@function +main: + mov x0, 0 + ret + .size main, .-main diff --git a/bolt/test/code-at-high-address.c b/bolt/test/code-at-high-address.c new file mode 100644 index 000000000000..fa33c1eb342d --- /dev/null +++ b/bolt/test/code-at-high-address.c @@ -0,0 +1,24 @@ +// Check that llvm-bolt pushes code to higher addresses under +// --hot-functions-at-end when rewriting code in-place. + +// REQUIRES: system-linux + +// RUN: %clang %cflags -O0 %s -o %t -no-pie -Wl,-q -falign-functions=64 \ +// RUN: -nostartfiles -nostdlib -ffreestanding +// RUN: llvm-bolt %t -o %t.bolt --use-old-text --align-functions=1 \ +// RUN: --no-huge-pages --align-text=1 --use-gnu-stack --hot-functions-at-end \ +// RUN: | FileCheck %s --check-prefix=CHECK-BOLT +// RUN: llvm-readelf --sections %t.bolt | FileCheck %s + +// CHECK-BOLT: using original .text for new code with 0x1 alignment at {{.*}} + +// As .text is pushed higher, preceding .bolt.org.text should have non-zero +// size. +// CHECK: .bolt.org.text PROGBITS +// CHECK-NOT: {{ 000000 }} +// CHECK-SAME: AX +// CHECK-NEXT: .text PROGBITS + +int foo() { return 0; } + +int main() { return foo(); } diff --git a/bolt/test/perf2bolt/X86/perf2bolt-spe.test b/bolt/test/perf2bolt/X86/perf2bolt-spe.test index 101bd3789a18..e981aef553b3 100644 --- a/bolt/test/perf2bolt/X86/perf2bolt-spe.test +++ b/bolt/test/perf2bolt/X86/perf2bolt-spe.test @@ -6,4 +6,4 @@ RUN: %clang %cflags %p/../../Inputs/asm_foo.s %p/../../Inputs/asm_main.c -o %t.e RUN: touch %t.empty.perf.data RUN: not perf2bolt -p %t.empty.perf.data -o %t.perf.boltdata --spe --pa %t.exe 2>&1 | FileCheck %s -CHECK: perf2bolt{{.*}} -spe is available only on AArch64. +CHECK: -spe is available only on AArch64. diff --git a/bolt/test/program-header.test b/bolt/test/program-header.test new file mode 100644 index 000000000000..f5490394eb6d --- /dev/null +++ b/bolt/test/program-header.test @@ -0,0 +1,14 @@ +# Check that llvm-bolt does not add new segments when writing code in-place. + +REQUIRES: system-linux + +RUN: %clang %cflags %p/Inputs/hello.c -o %t -no-pie -Wl,-q -nostartfiles \ +RUN: -nostdlib -ffreestanding +RUN: llvm-bolt %t -o %t.bolt --use-old-text --align-functions=1 \ +RUN: --no-huge-pages --align-text=1 --use-gnu-stack \ +RUN: | FileCheck %s --check-prefix=CHECK-BOLT +RUN: llvm-readelf -WS %t.bolt | FileCheck %s + +CHECK-BOLT: not adding new segments + +CHECK-NOT: .bolt.org.eh_frame_hdr diff --git a/bolt/unittests/Core/BinaryContext.cpp b/bolt/unittests/Core/BinaryContext.cpp index 3fa0851d01e5..d7374b323c91 100644 --- a/bolt/unittests/Core/BinaryContext.cpp +++ b/bolt/unittests/Core/BinaryContext.cpp @@ -199,13 +199,13 @@ TEST_P(BinaryContextTester, BaseAddress) { // Check that base address calculation is correct for a binary with the // following segment layout: BC->SegmentMapInfo[0] = - SegmentInfo{0, 0x10e8c2b4, 0, 0x10e8c2b4, 0x1000, true}; - BC->SegmentMapInfo[0x10e8d2b4] = - SegmentInfo{0x10e8d2b4, 0x3952faec, 0x10e8c2b4, 0x3952faec, 0x1000, true}; - BC->SegmentMapInfo[0x4a3bddc0] = - SegmentInfo{0x4a3bddc0, 0x148e828, 0x4a3bbdc0, 0x148e828, 0x1000, true}; - BC->SegmentMapInfo[0x4b84d5e8] = - SegmentInfo{0x4b84d5e8, 0x294f830, 0x4b84a5e8, 0x3d3820, 0x1000, true}; + SegmentInfo{0, 0x10e8c2b4, 0, 0x10e8c2b4, 0x1000, true, false}; + BC->SegmentMapInfo[0x10e8d2b4] = SegmentInfo{ + 0x10e8d2b4, 0x3952faec, 0x10e8c2b4, 0x3952faec, 0x1000, true, false}; + BC->SegmentMapInfo[0x4a3bddc0] = SegmentInfo{ + 0x4a3bddc0, 0x148e828, 0x4a3bbdc0, 0x148e828, 0x1000, true, false}; + BC->SegmentMapInfo[0x4b84d5e8] = SegmentInfo{ + 0x4b84d5e8, 0x294f830, 0x4b84a5e8, 0x3d3820, 0x1000, true, false}; std::optional BaseAddress = BC->getBaseAddressForMapping(0x7f13f5556000, 0x10e8c000); @@ -220,13 +220,14 @@ TEST_P(BinaryContextTester, BaseAddress2) { // Check that base address calculation is correct for a binary if the // alignment in ELF file are different from pagesize. // The segment layout is as follows: - BC->SegmentMapInfo[0] = SegmentInfo{0, 0x2177c, 0, 0x2177c, 0x10000, true}; + BC->SegmentMapInfo[0] = + SegmentInfo{0, 0x2177c, 0, 0x2177c, 0x10000, true, false}; BC->SegmentMapInfo[0x31860] = - SegmentInfo{0x31860, 0x370, 0x21860, 0x370, 0x10000, true}; + SegmentInfo{0x31860, 0x370, 0x21860, 0x370, 0x10000, true, false}; BC->SegmentMapInfo[0x41c20] = - SegmentInfo{0x41c20, 0x1f8, 0x21c20, 0x1f8, 0x10000, true}; + SegmentInfo{0x41c20, 0x1f8, 0x21c20, 0x1f8, 0x10000, true, false}; BC->SegmentMapInfo[0x54e18] = - SegmentInfo{0x54e18, 0x51, 0x24e18, 0x51, 0x10000, true}; + SegmentInfo{0x54e18, 0x51, 0x24e18, 0x51, 0x10000, true, false}; std::optional BaseAddress = BC->getBaseAddressForMapping(0xaaaaea444000, 0x21000); @@ -242,13 +243,14 @@ TEST_P(BinaryContextTester, BaseAddressSegmentsSmallerThanAlignment) { // when multiple segments are close together in the ELF file (closer // than the required alignment in the process space). // See https://github.com/llvm/llvm-project/issues/109384 - BC->SegmentMapInfo[0] = SegmentInfo{0, 0x1d1c, 0, 0x1d1c, 0x10000, false}; + BC->SegmentMapInfo[0] = + SegmentInfo{0, 0x1d1c, 0, 0x1d1c, 0x10000, false, false}; BC->SegmentMapInfo[0x11d40] = - SegmentInfo{0x11d40, 0x11e0, 0x1d40, 0x11e0, 0x10000, true}; + SegmentInfo{0x11d40, 0x11e0, 0x1d40, 0x11e0, 0x10000, true, false}; BC->SegmentMapInfo[0x22f20] = - SegmentInfo{0x22f20, 0x10e0, 0x2f20, 0x1f0, 0x10000, false}; + SegmentInfo{0x22f20, 0x10e0, 0x2f20, 0x1f0, 0x10000, false, false}; BC->SegmentMapInfo[0x33110] = - SegmentInfo{0x33110, 0x89, 0x3110, 0x88, 0x10000, false}; + SegmentInfo{0x33110, 0x89, 0x3110, 0x88, 0x10000, false, false}; std::optional BaseAddress = BC->getBaseAddressForMapping(0xaaaaaaab1000, 0x1000); diff --git a/bolt/unittests/Core/MemoryMaps.cpp b/bolt/unittests/Core/MemoryMaps.cpp index b0cab5431bdd..8eb8f8ae529b 100644 --- a/bolt/unittests/Core/MemoryMaps.cpp +++ b/bolt/unittests/Core/MemoryMaps.cpp @@ -100,10 +100,10 @@ TEST_P(MemoryMapsTester, ParseMultipleSegments) { "[0xabc2000000(0x8000000) @ 0x31d0000 103:01 1573523 0]: r-xp {1}\n", Pid, Filename); - BC->SegmentMapInfo[0x11da000] = - SegmentInfo{0x11da000, 0x10da000, 0x11ca000, 0x10da000, 0x10000, true}; - BC->SegmentMapInfo[0x31d0000] = - SegmentInfo{0x31d0000, 0x51ac82c, 0x31d0000, 0x3000000, 0x200000, true}; + BC->SegmentMapInfo[0x11da000] = SegmentInfo{ + 0x11da000, 0x10da000, 0x11ca000, 0x10da000, 0x10000, true, false}; + BC->SegmentMapInfo[0x31d0000] = SegmentInfo{ + 0x31d0000, 0x51ac82c, 0x31d0000, 0x3000000, 0x200000, true, false}; DataAggregator DA(""); BC->setFilename(Filename); @@ -131,12 +131,12 @@ TEST_P(MemoryMapsTester, MultipleSegmentsMismatchedBaseAddress) { "[0xabc2000000(0x8000000) @ 0x31d0000 103:01 1573523 0]: r-xp {1}\n", Pid, Filename); - BC->SegmentMapInfo[0x11da000] = - SegmentInfo{0x11da000, 0x10da000, 0x11ca000, 0x10da000, 0x10000, true}; + BC->SegmentMapInfo[0x11da000] = SegmentInfo{ + 0x11da000, 0x10da000, 0x11ca000, 0x10da000, 0x10000, true, false}; // Using '0x31d0fff' FileOffset which triggers a different base address // for this second text segment. - BC->SegmentMapInfo[0x31d0000] = - SegmentInfo{0x31d0000, 0x51ac82c, 0x31d0fff, 0x3000000, 0x200000, true}; + BC->SegmentMapInfo[0x31d0000] = SegmentInfo{ + 0x31d0000, 0x51ac82c, 0x31d0fff, 0x3000000, 0x200000, true, false}; DataAggregator DA(""); BC->setFilename(Filename); diff --git a/bolt/utils/llvm-bolt-wrapper.py b/bolt/utils/llvm-bolt-wrapper.py index b9d6fad825e7..b913394bce65 100755 --- a/bolt/utils/llvm-bolt-wrapper.py +++ b/bolt/utils/llvm-bolt-wrapper.py @@ -79,7 +79,7 @@ def get_cfg(key): # perf2bolt mode -PERF2BOLT_MODE = ["-aggregate-only", "-ignore-build-id"] +PERF2BOLT_MODE = ["-aggregate-only", "-ignore-build-id", "-show-density"] # boltdiff mode BOLTDIFF_MODE = ["-diff-only", "-o", "/dev/null"] diff --git a/bolt/utils/nfc-check-setup.py b/bolt/utils/nfc-check-setup.py index 710b18350585..275ac7b886d0 100755 --- a/bolt/utils/nfc-check-setup.py +++ b/bolt/utils/nfc-check-setup.py @@ -7,6 +7,29 @@ import sys import textwrap +def get_relevant_bolt_changes(dir: str) -> str: + # Return a list of bolt source changes that are relevant to testing. + all_changes = subprocess.run( + shlex.split("git show HEAD --name-only --pretty=''"), + cwd=dir, + text=True, + stdout=subprocess.PIPE, + ) + keep_bolt = subprocess.run( + shlex.split("grep '^bolt'"), + input=all_changes.stdout, + text=True, + stdout=subprocess.PIPE, + ) + keep_relevant = subprocess.run( + shlex.split( + "grep -v -e '^bolt/docs' -e '^bolt/utils/docker' -e '^bolt/utils/dot2html'" + ), + input=keep_bolt.stdout, + text=True, + stdout=subprocess.PIPE, + ) + return keep_relevant.stdout def get_git_ref_or_rev(dir: str) -> str: # Run 'git symbolic-ref -q --short HEAD || git rev-parse --short HEAD' @@ -36,6 +59,12 @@ def main(): default=os.getcwd(), help="Path to BOLT build directory, default is current " "directory", ) + parser.add_argument( + "--check-bolt-sources", + default=False, + action="store_true", + help="Create a marker file (.llvm-bolt.changes) if any relevant BOLT sources are modified", + ) parser.add_argument( "--switch-back", default=False, @@ -71,6 +100,16 @@ def main(): # memorize the old hash for logging old_ref = get_git_ref_or_rev(source_dir) + if args.check_bolt_sources: + marker = f"{args.build_dir}/.llvm-bolt.changes" + if os.path.exists(marker): + os.remove(marker) + file_changes = get_relevant_bolt_changes(source_dir) + # Create a marker file if any relevant BOLT source files changed. + if len(file_changes) > 0: + print(f"BOLT source changes were found:\n{file_changes}") + open(marker, "a").close() + # determine whether a stash is needed stash = subprocess.run( shlex.split("git status --porcelain"), diff --git a/clang-tools-extra/clang-doc/BitcodeReader.cpp b/clang-tools-extra/clang-doc/BitcodeReader.cpp index 66852931226b..f756ae6d897c 100644 --- a/clang-tools-extra/clang-doc/BitcodeReader.cpp +++ b/clang-tools-extra/clang-doc/BitcodeReader.cpp @@ -93,6 +93,8 @@ static llvm::Error decodeRecord(const Record &R, InfoType &Field, case InfoType::IT_enum: case InfoType::IT_typedef: case InfoType::IT_concept: + case InfoType::IT_variable: + case InfoType::IT_friend: Field = IT; return llvm::Error::success(); } @@ -110,6 +112,7 @@ static llvm::Error decodeRecord(const Record &R, FieldId &Field, case FieldId::F_child_namespace: case FieldId::F_child_record: case FieldId::F_concept: + case FieldId::F_friend: case FieldId::F_default: Field = F; return llvm::Error::success(); @@ -282,7 +285,15 @@ static llvm::Error parseRecord(const Record &R, unsigned ID, static llvm::Error parseRecord(const Record &R, unsigned ID, llvm::StringRef Blob, TypeInfo *I) { - return llvm::Error::success(); + switch (ID) { + case TYPE_IS_BUILTIN: + return decodeRecord(R, I->IsBuiltIn, Blob); + case TYPE_IS_TEMPLATE: + return decodeRecord(R, I->IsTemplate, Blob); + default: + return llvm::createStringError(llvm::inconvertibleErrorCode(), + "invalid field for TypeInfo"); + } } static llvm::Error parseRecord(const Record &R, unsigned ID, @@ -292,6 +303,10 @@ static llvm::Error parseRecord(const Record &R, unsigned ID, return decodeRecord(R, I->Name, Blob); case FIELD_DEFAULT_VALUE: return decodeRecord(R, I->DefaultValue, Blob); + case FIELD_TYPE_IS_BUILTIN: + return decodeRecord(R, I->IsBuiltIn, Blob); + case FIELD_TYPE_IS_TEMPLATE: + return decodeRecord(R, I->IsTemplate, Blob); default: return llvm::createStringError(llvm::inconvertibleErrorCode(), "invalid field for TypeInfo"); @@ -307,6 +322,10 @@ static llvm::Error parseRecord(const Record &R, unsigned ID, return decodeRecord(R, I->Access, Blob); case MEMBER_TYPE_IS_STATIC: return decodeRecord(R, I->IsStatic, Blob); + case MEMBER_TYPE_IS_BUILTIN: + return decodeRecord(R, I->IsBuiltIn, Blob); + case MEMBER_TYPE_IS_TEMPLATE: + return decodeRecord(R, I->IsTemplate, Blob); default: return llvm::createStringError(llvm::inconvertibleErrorCode(), "invalid field for MemberTypeInfo"); @@ -416,6 +435,32 @@ static llvm::Error parseRecord(const Record &R, unsigned ID, "invalid field for ConstraintInfo"); } +static llvm::Error parseRecord(const Record &R, unsigned ID, + llvm::StringRef Blob, VarInfo *I) { + switch (ID) { + case VAR_USR: + return decodeRecord(R, I->USR, Blob); + case VAR_NAME: + return decodeRecord(R, I->Name, Blob); + case VAR_DEFLOCATION: + return decodeRecord(R, I->DefLoc, Blob); + case VAR_IS_STATIC: + return decodeRecord(R, I->IsStatic, Blob); + default: + return llvm::createStringError(llvm::inconvertibleErrorCode(), + "invalid field for VarInfo"); + } +} + +static llvm::Error parseRecord(const Record &R, unsigned ID, StringRef Blob, + FriendInfo *F) { + if (ID == FRIEND_IS_CLASS) { + return decodeRecord(R, F->IsClass, Blob); + } + return llvm::createStringError(llvm::inconvertibleErrorCode(), + "invalid field for Friend"); +} + template static llvm::Expected getCommentInfo(T I) { return llvm::createStringError(llvm::inconvertibleErrorCode(), "invalid type cannot contain CommentInfo"); @@ -458,6 +503,10 @@ template <> llvm::Expected getCommentInfo(ConceptInfo *I) { return &I->Description.emplace_back(); } +template <> Expected getCommentInfo(VarInfo *I) { + return &I->Description.emplace_back(); +} + // When readSubBlock encounters a TypeInfo sub-block, it calls addTypeInfo on // the parent block to set it. The template specializations define what to do // for each supported parent block. @@ -487,6 +536,18 @@ template <> llvm::Error addTypeInfo(FunctionInfo *I, FieldTypeInfo &&T) { return llvm::Error::success(); } +template <> llvm::Error addTypeInfo(FriendInfo *I, FieldTypeInfo &&T) { + if (!I->Params) + I->Params.emplace(); + I->Params->emplace_back(std::move(T)); + return llvm::Error::success(); +} + +template <> llvm::Error addTypeInfo(FriendInfo *I, TypeInfo &&T) { + I->ReturnType.emplace(std::move(T)); + return llvm::Error::success(); +} + template <> llvm::Error addTypeInfo(EnumInfo *I, TypeInfo &&T) { I->BaseType = std::move(T); return llvm::Error::success(); @@ -497,12 +558,28 @@ template <> llvm::Error addTypeInfo(TypedefInfo *I, TypeInfo &&T) { return llvm::Error::success(); } +template <> llvm::Error addTypeInfo(VarInfo *I, TypeInfo &&T) { + I->Type = std::move(T); + return llvm::Error::success(); +} + template static llvm::Error addReference(T I, Reference &&R, FieldId F) { return llvm::createStringError(llvm::inconvertibleErrorCode(), "invalid type cannot contain Reference"); } +template <> llvm::Error addReference(VarInfo *I, Reference &&R, FieldId F) { + switch (F) { + case FieldId::F_namespace: + I->Namespace.emplace_back(std::move(R)); + return llvm::Error::success(); + default: + return llvm::createStringError(llvm::inconvertibleErrorCode(), + "VarInfo cannot contain this Reference"); + } +} + template <> llvm::Error addReference(TypeInfo *I, Reference &&R, FieldId F) { switch (F) { case FieldId::F_type: @@ -624,6 +701,16 @@ llvm::Error addReference(ConstraintInfo *I, Reference &&R, FieldId F) { "ConstraintInfo cannot contain this Reference"); } +template <> +llvm::Error addReference(FriendInfo *Friend, Reference &&R, FieldId F) { + if (F == FieldId::F_friend) { + Friend->Ref = std::move(R); + return llvm::Error::success(); + } + return llvm::createStringError(llvm::inconvertibleErrorCode(), + "Friend cannot contain this Reference"); +} + template static void addChild(T I, ChildInfoType &&R) { llvm::errs() << "invalid child type for info"; @@ -643,6 +730,9 @@ template <> void addChild(NamespaceInfo *I, TypedefInfo &&R) { template <> void addChild(NamespaceInfo *I, ConceptInfo &&R) { I->Children.Concepts.emplace_back(std::move(R)); } +template <> void addChild(NamespaceInfo *I, VarInfo &&R) { + I->Children.Variables.emplace_back(std::move(R)); +} // Record children: template <> void addChild(RecordInfo *I, FunctionInfo &&R) { @@ -654,6 +744,9 @@ template <> void addChild(RecordInfo *I, EnumInfo &&R) { template <> void addChild(RecordInfo *I, TypedefInfo &&R) { I->Children.Typedefs.emplace_back(std::move(R)); } +template <> void addChild(RecordInfo *I, FriendInfo &&R) { + I->Friends.emplace_back(std::move(R)); +} // Other types of children: template <> void addChild(EnumInfo *I, EnumValueInfo &&R) { @@ -695,6 +788,9 @@ template <> void addTemplate(FunctionInfo *I, TemplateInfo &&P) { template <> void addTemplate(ConceptInfo *I, TemplateInfo &&P) { I->Template = std::move(P); } +template <> void addTemplate(FriendInfo *I, TemplateInfo &&P) { + I->Template.emplace(std::move(P)); +} // Template specializations go only into template records. template @@ -770,11 +866,39 @@ llvm::Error ClangDocBitcodeReader::readBlock(unsigned ID, T I) { } } -// TODO: Create a helper that can receive a function to reduce repetition for -// most blocks. +// TODO: fix inconsistentent returning of errors in add callbacks. +// Once that's fixed, we only need one handleSubBlock. +template +llvm::Error ClangDocBitcodeReader::handleSubBlock(unsigned ID, T Parent, + Callback Function) { + InfoType Info; + if (auto Err = readBlock(ID, &Info)) + return Err; + Function(Parent, std::move(Info)); + return llvm::Error::success(); +} + +template +llvm::Error ClangDocBitcodeReader::handleTypeSubBlock(unsigned ID, T Parent, + Callback Function) { + InfoType Info; + if (auto Err = readBlock(ID, &Info)) + return Err; + if (auto Err = Function(Parent, std::move(Info))) + return Err; + return llvm::Error::success(); +} + template llvm::Error ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) { llvm::TimeTraceScope("Reducing infos", "readSubBlock"); + + static auto CreateAddFunc = [](auto AddFunc) { + return [AddFunc](auto Parent, auto Child) { + return AddFunc(Parent, std::move(Child)); + }; + }; + switch (ID) { // Blocks can only have certain types of sub blocks. case BI_COMMENT_BLOCK_ID: { @@ -786,28 +910,16 @@ llvm::Error ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) { return llvm::Error::success(); } case BI_TYPE_BLOCK_ID: { - TypeInfo TI; - if (auto Err = readBlock(ID, &TI)) - return Err; - if (auto Err = addTypeInfo(I, std::move(TI))) - return Err; - return llvm::Error::success(); + return handleTypeSubBlock( + ID, I, CreateAddFunc(addTypeInfo)); } case BI_FIELD_TYPE_BLOCK_ID: { - FieldTypeInfo TI; - if (auto Err = readBlock(ID, &TI)) - return Err; - if (auto Err = addTypeInfo(I, std::move(TI))) - return Err; - return llvm::Error::success(); + return handleTypeSubBlock( + ID, I, CreateAddFunc(addTypeInfo)); } case BI_MEMBER_TYPE_BLOCK_ID: { - MemberTypeInfo TI; - if (auto Err = readBlock(ID, &TI)) - return Err; - if (auto Err = addTypeInfo(I, std::move(TI))) - return Err; - return llvm::Error::success(); + return handleTypeSubBlock( + ID, I, CreateAddFunc(addTypeInfo)); } case BI_REFERENCE_BLOCK_ID: { Reference R; @@ -818,74 +930,50 @@ llvm::Error ClangDocBitcodeReader::readSubBlock(unsigned ID, T I) { return llvm::Error::success(); } case BI_FUNCTION_BLOCK_ID: { - FunctionInfo F; - if (auto Err = readBlock(ID, &F)) - return Err; - addChild(I, std::move(F)); - return llvm::Error::success(); + return handleSubBlock( + ID, I, CreateAddFunc(addChild)); } case BI_BASE_RECORD_BLOCK_ID: { - BaseRecordInfo BR; - if (auto Err = readBlock(ID, &BR)) - return Err; - addChild(I, std::move(BR)); - return llvm::Error::success(); + return handleSubBlock( + ID, I, CreateAddFunc(addChild)); } case BI_ENUM_BLOCK_ID: { - EnumInfo E; - if (auto Err = readBlock(ID, &E)) - return Err; - addChild(I, std::move(E)); - return llvm::Error::success(); + return handleSubBlock(ID, I, + CreateAddFunc(addChild)); } case BI_ENUM_VALUE_BLOCK_ID: { - EnumValueInfo EV; - if (auto Err = readBlock(ID, &EV)) - return Err; - addChild(I, std::move(EV)); - return llvm::Error::success(); + return handleSubBlock( + ID, I, CreateAddFunc(addChild)); } case BI_TEMPLATE_BLOCK_ID: { - TemplateInfo TI; - if (auto Err = readBlock(ID, &TI)) - return Err; - addTemplate(I, std::move(TI)); - return llvm::Error::success(); + return handleSubBlock(ID, I, CreateAddFunc(addTemplate)); } case BI_TEMPLATE_SPECIALIZATION_BLOCK_ID: { - TemplateSpecializationInfo TSI; - if (auto Err = readBlock(ID, &TSI)) - return Err; - addTemplateSpecialization(I, std::move(TSI)); - return llvm::Error::success(); + return handleSubBlock( + ID, I, CreateAddFunc(addTemplateSpecialization)); } case BI_TEMPLATE_PARAM_BLOCK_ID: { - TemplateParamInfo TPI; - if (auto Err = readBlock(ID, &TPI)) - return Err; - addTemplateParam(I, std::move(TPI)); - return llvm::Error::success(); + return handleSubBlock( + ID, I, CreateAddFunc(addTemplateParam)); } case BI_TYPEDEF_BLOCK_ID: { - TypedefInfo TI; - if (auto Err = readBlock(ID, &TI)) - return Err; - addChild(I, std::move(TI)); - return llvm::Error::success(); + return handleSubBlock(ID, I, + CreateAddFunc(addChild)); } case BI_CONSTRAINT_BLOCK_ID: { - ConstraintInfo CI; - if (auto Err = readBlock(ID, &CI)) - return Err; - addConstraint(I, std::move(CI)); - return llvm::Error::success(); + return handleSubBlock(ID, I, + CreateAddFunc(addConstraint)); } case BI_CONCEPT_BLOCK_ID: { - ConceptInfo CI; - if (auto Err = readBlock(ID, &CI)) - return Err; - addChild(I, std::move(CI)); - return llvm::Error::success(); + return handleSubBlock(ID, I, + CreateAddFunc(addChild)); + } + case BI_VAR_BLOCK_ID: { + return handleSubBlock(ID, I, CreateAddFunc(addChild)); + } + case BI_FRIEND_BLOCK_ID: { + return handleSubBlock(ID, I, + CreateAddFunc(addChild)); } default: return llvm::createStringError(llvm::inconvertibleErrorCode(), @@ -996,6 +1084,10 @@ ClangDocBitcodeReader::readBlockToInfo(unsigned ID) { return createInfo(ID); case BI_FUNCTION_BLOCK_ID: return createInfo(ID); + case BI_VAR_BLOCK_ID: + return createInfo(ID); + case BI_FRIEND_BLOCK_ID: + return createInfo(ID); default: return llvm::createStringError(llvm::inconvertibleErrorCode(), "cannot create info"); @@ -1035,6 +1127,8 @@ ClangDocBitcodeReader::readBitcode() { case BI_ENUM_BLOCK_ID: case BI_TYPEDEF_BLOCK_ID: case BI_CONCEPT_BLOCK_ID: + case BI_VAR_BLOCK_ID: + case BI_FRIEND_BLOCK_ID: case BI_FUNCTION_BLOCK_ID: { auto InfoOrErr = readBlockToInfo(ID); if (!InfoOrErr) diff --git a/clang-tools-extra/clang-doc/BitcodeReader.h b/clang-tools-extra/clang-doc/BitcodeReader.h index a046ee2f7a24..4947721f0a06 100644 --- a/clang-tools-extra/clang-doc/BitcodeReader.h +++ b/clang-tools-extra/clang-doc/BitcodeReader.h @@ -64,6 +64,13 @@ class ClangDocBitcodeReader { // Helper function to set up the appropriate type of Info. llvm::Expected> readBlockToInfo(unsigned ID); + template + llvm::Error handleSubBlock(unsigned ID, T Parent, CallbackFunction Function); + + template + llvm::Error handleTypeSubBlock(unsigned ID, T Parent, + CallbackFunction Function); + llvm::BitstreamCursor &Stream; std::optional BlockInfo; FieldId CurrentReferenceField; diff --git a/clang-tools-extra/clang-doc/BitcodeWriter.cpp b/clang-tools-extra/clang-doc/BitcodeWriter.cpp index b7308c012786..3cc0d4ad332f 100644 --- a/clang-tools-extra/clang-doc/BitcodeWriter.cpp +++ b/clang-tools-extra/clang-doc/BitcodeWriter.cpp @@ -130,7 +130,9 @@ static const llvm::IndexedMap {BI_TEMPLATE_SPECIALIZATION_BLOCK_ID, "TemplateSpecializationBlock"}, {BI_TEMPLATE_PARAM_BLOCK_ID, "TemplateParamBlock"}, {BI_CONSTRAINT_BLOCK_ID, "ConstraintBlock"}, - {BI_CONCEPT_BLOCK_ID, "ConceptBlock"}}; + {BI_CONCEPT_BLOCK_ID, "ConceptBlock"}, + {BI_VAR_BLOCK_ID, "VarBlock"}, + {BI_FRIEND_BLOCK_ID, "FriendBlock"}}; assert(Inits.size() == BlockIdCount); for (const auto &Init : Inits) BlockIdNameMap[Init.first] = Init.second; @@ -160,9 +162,15 @@ static const llvm::IndexedMap {COMMENT_ARG, {"Arg", &genStringAbbrev}}, {FIELD_TYPE_NAME, {"Name", &genStringAbbrev}}, {FIELD_DEFAULT_VALUE, {"DefaultValue", &genStringAbbrev}}, + {FIELD_TYPE_IS_BUILTIN, {"IsBuiltin", &genBoolAbbrev}}, + {FIELD_TYPE_IS_TEMPLATE, {"IsTemplate", &genBoolAbbrev}}, {MEMBER_TYPE_NAME, {"Name", &genStringAbbrev}}, {MEMBER_TYPE_ACCESS, {"Access", &genIntAbbrev}}, {MEMBER_TYPE_IS_STATIC, {"IsStatic", &genBoolAbbrev}}, + {MEMBER_TYPE_IS_BUILTIN, {"IsBuiltin", &genBoolAbbrev}}, + {MEMBER_TYPE_IS_TEMPLATE, {"IsTemplate", &genBoolAbbrev}}, + {TYPE_IS_BUILTIN, {"IsBuiltin", &genBoolAbbrev}}, + {TYPE_IS_TEMPLATE, {"IsTemplate", &genBoolAbbrev}}, {NAMESPACE_USR, {"USR", &genSymbolIdAbbrev}}, {NAMESPACE_NAME, {"Name", &genStringAbbrev}}, {NAMESPACE_PATH, {"Path", &genStringAbbrev}}, @@ -213,7 +221,13 @@ static const llvm::IndexedMap {CONCEPT_IS_TYPE, {"IsType", &genBoolAbbrev}}, {CONCEPT_CONSTRAINT_EXPRESSION, {"ConstraintExpression", &genStringAbbrev}}, - {CONSTRAINT_EXPRESSION, {"Expression", &genStringAbbrev}}}; + {CONSTRAINT_EXPRESSION, {"Expression", &genStringAbbrev}}, + {VAR_USR, {"USR", &genSymbolIdAbbrev}}, + {VAR_NAME, {"Name", &genStringAbbrev}}, + {VAR_DEFLOCATION, {"DefLocation", &genLocationAbbrev}}, + {VAR_IS_STATIC, {"IsStatic", &genBoolAbbrev}}, + {FRIEND_IS_CLASS, {"IsClass", &genBoolAbbrev}}}; + assert(Inits.size() == RecordIdCount); for (const auto &Init : Inits) { RecordIdNameMap[Init.first] = Init.second; @@ -233,12 +247,15 @@ static const std::vector>> COMMENT_PARAMNAME, COMMENT_CLOSENAME, COMMENT_SELFCLOSING, COMMENT_EXPLICIT, COMMENT_ATTRKEY, COMMENT_ATTRVAL, COMMENT_ARG}}, // Type Block - {BI_TYPE_BLOCK_ID, {}}, + {BI_TYPE_BLOCK_ID, {TYPE_IS_BUILTIN, TYPE_IS_TEMPLATE}}, // FieldType Block - {BI_FIELD_TYPE_BLOCK_ID, {FIELD_TYPE_NAME, FIELD_DEFAULT_VALUE}}, + {BI_FIELD_TYPE_BLOCK_ID, + {FIELD_TYPE_NAME, FIELD_DEFAULT_VALUE, FIELD_TYPE_IS_BUILTIN, + FIELD_TYPE_IS_TEMPLATE}}, // MemberType Block {BI_MEMBER_TYPE_BLOCK_ID, - {MEMBER_TYPE_NAME, MEMBER_TYPE_ACCESS, MEMBER_TYPE_IS_STATIC}}, + {MEMBER_TYPE_NAME, MEMBER_TYPE_ACCESS, MEMBER_TYPE_IS_STATIC, + MEMBER_TYPE_IS_BUILTIN, MEMBER_TYPE_IS_TEMPLATE}}, // Enum Block {BI_ENUM_BLOCK_ID, {ENUM_USR, ENUM_NAME, ENUM_DEFLOCATION, ENUM_LOCATION, ENUM_SCOPED}}, @@ -277,7 +294,9 @@ static const std::vector>> {CONCEPT_USR, CONCEPT_NAME, CONCEPT_IS_TYPE, CONCEPT_CONSTRAINT_EXPRESSION}}, // Constraint Block - {BI_CONSTRAINT_BLOCK_ID, {CONSTRAINT_EXPRESSION}}}; + {BI_CONSTRAINT_BLOCK_ID, {CONSTRAINT_EXPRESSION}}, + {BI_VAR_BLOCK_ID, {VAR_NAME, VAR_USR, VAR_DEFLOCATION, VAR_IS_STATIC}}, + {BI_FRIEND_BLOCK_ID, {FRIEND_IS_CLASS}}}; // AbbreviationMap @@ -460,9 +479,24 @@ void ClangDocBitcodeWriter::emitBlock(const Reference &R, FieldId Field) { emitRecord((unsigned)Field, REFERENCE_FIELD); } +void ClangDocBitcodeWriter::emitBlock(const FriendInfo &R) { + StreamSubBlockGuard Block(Stream, BI_FRIEND_BLOCK_ID); + emitBlock(R.Ref, FieldId::F_friend); + emitRecord(R.IsClass, FRIEND_IS_CLASS); + if (R.Template) + emitBlock(*R.Template); + if (R.Params) + for (const auto &P : *R.Params) + emitBlock(P); + if (R.ReturnType) + emitBlock(*R.ReturnType); +} + void ClangDocBitcodeWriter::emitBlock(const TypeInfo &T) { StreamSubBlockGuard Block(Stream, BI_TYPE_BLOCK_ID); emitBlock(T.Type, FieldId::F_type); + emitRecord(T.IsBuiltIn, TYPE_IS_BUILTIN); + emitRecord(T.IsTemplate, TYPE_IS_TEMPLATE); } void ClangDocBitcodeWriter::emitBlock(const TypedefInfo &T) { @@ -484,6 +518,8 @@ void ClangDocBitcodeWriter::emitBlock(const FieldTypeInfo &T) { emitBlock(T.Type, FieldId::F_type); emitRecord(T.Name, FIELD_TYPE_NAME); emitRecord(T.DefaultValue, FIELD_DEFAULT_VALUE); + emitRecord(T.IsBuiltIn, FIELD_TYPE_IS_BUILTIN); + emitRecord(T.IsTemplate, FIELD_TYPE_IS_TEMPLATE); } void ClangDocBitcodeWriter::emitBlock(const MemberTypeInfo &T) { @@ -492,6 +528,9 @@ void ClangDocBitcodeWriter::emitBlock(const MemberTypeInfo &T) { emitRecord(T.Name, MEMBER_TYPE_NAME); emitRecord(T.Access, MEMBER_TYPE_ACCESS); emitRecord(T.IsStatic, MEMBER_TYPE_IS_STATIC); + emitRecord(T.IsBuiltIn, MEMBER_TYPE_IS_BUILTIN); + emitRecord(T.IsTemplate, MEMBER_TYPE_IS_TEMPLATE); + emitRecord(T.IsTemplate, MEMBER_TYPE_IS_TEMPLATE); for (const auto &CI : T.Description) emitBlock(CI); } @@ -540,6 +579,8 @@ void ClangDocBitcodeWriter::emitBlock(const NamespaceInfo &I) { emitBlock(C); for (const auto &C : I.Children.Concepts) emitBlock(C); + for (const auto &C : I.Children.Variables) + emitBlock(C); } void ClangDocBitcodeWriter::emitBlock(const EnumInfo &I) { @@ -603,6 +644,8 @@ void ClangDocBitcodeWriter::emitBlock(const RecordInfo &I) { emitBlock(C); if (I.Template) emitBlock(*I.Template); + for (const auto &C : I.Friends) + emitBlock(C); } void ClangDocBitcodeWriter::emitBlock(const BaseRecordInfo &I) { @@ -682,6 +725,20 @@ void ClangDocBitcodeWriter::emitBlock(const ConstraintInfo &C) { emitBlock(C.ConceptRef, FieldId::F_concept); } +void ClangDocBitcodeWriter::emitBlock(const VarInfo &I) { + StreamSubBlockGuard Block(Stream, BI_VAR_BLOCK_ID); + emitRecord(I.USR, VAR_USR); + emitRecord(I.Name, VAR_NAME); + for (const auto &N : I.Namespace) + emitBlock(N, FieldId::F_namespace); + for (const auto &CI : I.Description) + emitBlock(CI); + if (I.DefLoc) + emitRecord(*I.DefLoc, VAR_DEFLOCATION); + emitRecord(I.IsStatic, VAR_IS_STATIC); + emitBlock(I.Type); +} + bool ClangDocBitcodeWriter::dispatchInfoForWrite(Info *I) { switch (I->IT) { case InfoType::IT_namespace: @@ -702,6 +759,12 @@ bool ClangDocBitcodeWriter::dispatchInfoForWrite(Info *I) { case InfoType::IT_concept: emitBlock(*static_cast(I)); break; + case InfoType::IT_variable: + emitBlock(*static_cast(I)); + break; + case InfoType::IT_friend: + emitBlock(*static_cast(I)); + break; case InfoType::IT_default: llvm::errs() << "Unexpected info, unable to write.\n"; return true; diff --git a/clang-tools-extra/clang-doc/BitcodeWriter.h b/clang-tools-extra/clang-doc/BitcodeWriter.h index 4d0c0c07805e..d09ec4ca3400 100644 --- a/clang-tools-extra/clang-doc/BitcodeWriter.h +++ b/clang-tools-extra/clang-doc/BitcodeWriter.h @@ -69,6 +69,8 @@ enum BlockId { BI_CONSTRAINT_BLOCK_ID, BI_TYPEDEF_BLOCK_ID, BI_CONCEPT_BLOCK_ID, + BI_VAR_BLOCK_ID, + BI_FRIEND_BLOCK_ID, BI_LAST, BI_FIRST = BI_VERSION_BLOCK_ID }; @@ -95,11 +97,17 @@ enum RecordId { COMMENT_ATTRKEY, COMMENT_ATTRVAL, COMMENT_ARG, + TYPE_IS_BUILTIN, + TYPE_IS_TEMPLATE, FIELD_TYPE_NAME, FIELD_DEFAULT_VALUE, + FIELD_TYPE_IS_BUILTIN, + FIELD_TYPE_IS_TEMPLATE, MEMBER_TYPE_NAME, MEMBER_TYPE_ACCESS, MEMBER_TYPE_IS_STATIC, + MEMBER_TYPE_IS_BUILTIN, + MEMBER_TYPE_IS_TEMPLATE, NAMESPACE_USR, NAMESPACE_NAME, NAMESPACE_PATH, @@ -142,6 +150,11 @@ enum RecordId { CONCEPT_IS_TYPE, CONCEPT_CONSTRAINT_EXPRESSION, CONSTRAINT_EXPRESSION, + VAR_USR, + VAR_NAME, + VAR_DEFLOCATION, + VAR_IS_STATIC, + FRIEND_IS_CLASS, RI_LAST, RI_FIRST = VERSION }; @@ -158,7 +171,8 @@ enum class FieldId { F_type, F_child_namespace, F_child_record, - F_concept + F_concept, + F_friend }; class ClangDocBitcodeWriter { @@ -190,6 +204,8 @@ class ClangDocBitcodeWriter { void emitBlock(const ConceptInfo &T); void emitBlock(const ConstraintInfo &T); void emitBlock(const Reference &B, FieldId F); + void emitBlock(const FriendInfo &R); + void emitBlock(const VarInfo &B); private: class AbbreviationMap { diff --git a/clang-tools-extra/clang-doc/HTMLGenerator.cpp b/clang-tools-extra/clang-doc/HTMLGenerator.cpp index 935bbfee7a9b..8294ff911855 100644 --- a/clang-tools-extra/clang-doc/HTMLGenerator.cpp +++ b/clang-tools-extra/clang-doc/HTMLGenerator.cpp @@ -986,6 +986,8 @@ llvm::Error HTMLGenerator::generateDocForInfo(Info *I, llvm::raw_ostream &OS, genHTML(*static_cast(I), CDCtx, InfoTitle); break; case InfoType::IT_concept: + case InfoType::IT_variable: + case InfoType::IT_friend: break; case InfoType::IT_default: return llvm::createStringError(llvm::inconvertibleErrorCode(), @@ -1015,6 +1017,10 @@ static std::string getRefType(InfoType IT) { return "typedef"; case InfoType::IT_concept: return "concept"; + case InfoType::IT_variable: + return "variable"; + case InfoType::IT_friend: + return "friend"; } llvm_unreachable("Unknown InfoType"); } diff --git a/clang-tools-extra/clang-doc/HTMLMustacheGenerator.cpp b/clang-tools-extra/clang-doc/HTMLMustacheGenerator.cpp index 81ba99c21e37..7aeaa1b7cf67 100644 --- a/clang-tools-extra/clang-doc/HTMLMustacheGenerator.cpp +++ b/clang-tools-extra/clang-doc/HTMLMustacheGenerator.cpp @@ -587,6 +587,9 @@ Error MustacheHTMLGenerator::generateDocForInfo(Info *I, raw_ostream &OS, break; case InfoType::IT_concept: break; + case InfoType::IT_variable: + case InfoType::IT_friend: + break; case InfoType::IT_default: return createStringError(inconvertibleErrorCode(), "unexpected InfoType"); } diff --git a/clang-tools-extra/clang-doc/JSONGenerator.cpp b/clang-tools-extra/clang-doc/JSONGenerator.cpp index 8a37621597c6..0e1a0cc347e4 100644 --- a/clang-tools-extra/clang-doc/JSONGenerator.cpp +++ b/clang-tools-extra/clang-doc/JSONGenerator.cpp @@ -22,22 +22,30 @@ class JSONGenerator : public Generator { const char *JSONGenerator::Format = "json"; -static void serializeInfo(const TypedefInfo &I, json::Object &Obj, - std::optional RepositoryUrl); -static void serializeInfo(const EnumInfo &I, json::Object &Obj, - std::optional RepositoryUrl); static void serializeInfo(const ConstraintInfo &I, Object &Obj); +static void serializeInfo(const RecordInfo &I, Object &Obj, + const std::optional &RepositoryUrl); + +static void serializeReference(const Reference &Ref, Object &ReferenceObj); + +template +static void serializeArray(const Container &Records, Object &Obj, + const std::string &Key, + SerializationFunc SerializeInfo); // Convenience lambda to pass to serializeArray. // If a serializeInfo needs a RepositoryUrl, create a local lambda that captures // the optional. -static auto SerializeInfoLambda = [](const ConstraintInfo &Info, - Object &Object) { +static auto SerializeInfoLambda = [](const auto &Info, Object &Object) { serializeInfo(Info, Object); }; +static auto SerializeReferenceLambda = [](const auto &Ref, Object &Object) { + serializeReference(Ref, Object); +}; -static json::Object serializeLocation(const Location &Loc, - std::optional RepositoryUrl) { +static json::Object +serializeLocation(const Location &Loc, + const std::optional &RepositoryUrl) { Object LocationObj = Object(); LocationObj["LineNumber"] = Loc.StartLineNumber; LocationObj["Filename"] = Loc.Filename; @@ -159,8 +167,9 @@ static json::Value serializeComment(const CommentInfo &I) { llvm_unreachable("Unknown comment kind encountered."); } -static void serializeCommonAttributes(const Info &I, json::Object &Obj, - std::optional RepositoryUrl) { +static void +serializeCommonAttributes(const Info &I, json::Object &Obj, + const std::optional &RepositoryUrl) { Obj["Name"] = I.Name; Obj["USR"] = toHex(toStringRef(I.USR)); @@ -198,67 +207,28 @@ static void serializeReference(const Reference &Ref, Object &ReferenceObj) { ReferenceObj["USR"] = toHex(toStringRef(Ref.USR)); } -static void serializeReference(const SmallVector &References, - Object &Obj, std::string Key) { - json::Value ReferencesArray = Array(); - json::Array &ReferencesArrayRef = *ReferencesArray.getAsArray(); - ReferencesArrayRef.reserve(References.size()); - for (const auto &Reference : References) { - json::Value ReferenceVal = Object(); - auto &ReferenceObj = *ReferenceVal.getAsObject(); - serializeReference(Reference, ReferenceObj); - ReferencesArrayRef.push_back(ReferenceVal); - } - Obj[Key] = ReferencesArray; -} - // Although namespaces and records both have ScopeChildren, they serialize them // differently. Only enums, records, and typedefs are handled here. -static void serializeCommonChildren(const ScopeChildren &Children, - json::Object &Obj, - std::optional RepositoryUrl) { - if (!Children.Enums.empty()) { - json::Value EnumsArray = Array(); - auto &EnumsArrayRef = *EnumsArray.getAsArray(); - EnumsArrayRef.reserve(Children.Enums.size()); - for (const auto &Enum : Children.Enums) { - json::Value EnumVal = Object(); - auto &EnumObj = *EnumVal.getAsObject(); - serializeInfo(Enum, EnumObj, RepositoryUrl); - EnumsArrayRef.push_back(EnumVal); - } - Obj["Enums"] = EnumsArray; - } +static void +serializeCommonChildren(const ScopeChildren &Children, json::Object &Obj, + const std::optional &RepositoryUrl) { + static auto SerializeInfo = [&RepositoryUrl](const auto &Info, + Object &Object) { + serializeInfo(Info, Object, RepositoryUrl); + }; - if (!Children.Typedefs.empty()) { - json::Value TypedefsArray = Array(); - auto &TypedefsArrayRef = *TypedefsArray.getAsArray(); - TypedefsArrayRef.reserve(Children.Typedefs.size()); - for (const auto &Typedef : Children.Typedefs) { - json::Value TypedefVal = Object(); - auto &TypedefObj = *TypedefVal.getAsObject(); - serializeInfo(Typedef, TypedefObj, RepositoryUrl); - TypedefsArrayRef.push_back(TypedefVal); - } - Obj["Typedefs"] = TypedefsArray; - } + if (!Children.Enums.empty()) + serializeArray(Children.Enums, Obj, "Enums", SerializeInfo); - if (!Children.Records.empty()) { - json::Value RecordsArray = Array(); - auto &RecordsArrayRef = *RecordsArray.getAsArray(); - RecordsArrayRef.reserve(Children.Records.size()); - for (const auto &Record : Children.Records) { - json::Value RecordVal = Object(); - auto &RecordObj = *RecordVal.getAsObject(); - serializeReference(Record, RecordObj); - RecordsArrayRef.push_back(RecordVal); - } - Obj["Records"] = RecordsArray; - } + if (!Children.Typedefs.empty()) + serializeArray(Children.Typedefs, Obj, "Typedefs", SerializeInfo); + + if (!Children.Records.empty()) + serializeArray(Children.Records, Obj, "Records", SerializeReferenceLambda); } -template -static void serializeArray(const std::vector &Records, Object &Obj, +template +static void serializeArray(const Container &Records, Object &Obj, const std::string &Key, SerializationFunc SerializeInfo) { json::Value RecordsArray = Array(); @@ -278,6 +248,16 @@ static void serializeInfo(const ConstraintInfo &I, Object &Obj) { Obj["Expression"] = I.ConstraintExpr; } +static void serializeInfo(const ArrayRef &Params, + Object &Obj) { + json::Value ParamsArray = Array(); + auto &ParamsArrayRef = *ParamsArray.getAsArray(); + ParamsArrayRef.reserve(Params.size()); + for (const auto &Param : Params) + ParamsArrayRef.push_back(Param.Contents); + Obj["Parameters"] = ParamsArray; +} + static void serializeInfo(const TemplateInfo &Template, Object &Obj) { json::Value TemplateVal = Object(); auto &TemplateObj = *TemplateVal.getAsObject(); @@ -287,25 +267,13 @@ static void serializeInfo(const TemplateInfo &Template, Object &Obj) { auto &TemplateSpecializationObj = *TemplateSpecializationVal.getAsObject(); TemplateSpecializationObj["SpecializationOf"] = toHex(toStringRef(Template.Specialization->SpecializationOf)); - if (!Template.Specialization->Params.empty()) { - json::Value ParamsArray = Array(); - auto &ParamsArrayRef = *ParamsArray.getAsArray(); - ParamsArrayRef.reserve(Template.Specialization->Params.size()); - for (const auto &Param : Template.Specialization->Params) - ParamsArrayRef.push_back(Param.Contents); - TemplateSpecializationObj["Parameters"] = ParamsArray; - } + if (!Template.Specialization->Params.empty()) + serializeInfo(Template.Specialization->Params, TemplateSpecializationObj); TemplateObj["Specialization"] = TemplateSpecializationVal; } - if (!Template.Params.empty()) { - json::Value ParamsArray = Array(); - auto &ParamsArrayRef = *ParamsArray.getAsArray(); - ParamsArrayRef.reserve(Template.Params.size()); - for (const auto &Param : Template.Params) - ParamsArrayRef.push_back(Param.Contents); - TemplateObj["Parameters"] = ParamsArray; - } + if (!Template.Params.empty()) + serializeInfo(Template.Params, TemplateObj); if (!Template.Constraints.empty()) serializeArray(Template.Constraints, TemplateObj, "Constraints", @@ -315,7 +283,7 @@ static void serializeInfo(const TemplateInfo &Template, Object &Obj) { } static void serializeInfo(const ConceptInfo &I, Object &Obj, - std::optional RepositoryUrl) { + const std::optional &RepositoryUrl) { serializeCommonAttributes(I, Obj, RepositoryUrl); Obj["IsType"] = I.IsType; Obj["ConstraintExpression"] = I.ConstraintExpression; @@ -330,8 +298,13 @@ static void serializeInfo(const TypeInfo &I, Object &Obj) { Obj["IsBuiltIn"] = I.IsBuiltIn; } +static void serializeInfo(const FieldTypeInfo &I, Object &Obj) { + Obj["Name"] = I.Name; + Obj["Type"] = I.Type.Name; +} + static void serializeInfo(const FunctionInfo &F, json::Object &Obj, - std::optional RepositoryURL) { + const std::optional &RepositoryURL) { serializeCommonAttributes(F, Obj, RepositoryURL); Obj["IsStatic"] = F.IsStatic; @@ -339,26 +312,23 @@ static void serializeInfo(const FunctionInfo &F, json::Object &Obj, serializeInfo(F.ReturnType, ReturnTypeObj); Obj["ReturnType"] = std::move(ReturnTypeObj); - if (!F.Params.empty()) { - json::Value ParamsArray = json::Array(); - auto &ParamsArrayRef = *ParamsArray.getAsArray(); - ParamsArrayRef.reserve(F.Params.size()); - for (const auto &Param : F.Params) { - json::Value ParamVal = Object(); - auto &ParamObj = *ParamVal.getAsObject(); - ParamObj["Name"] = Param.Name; - ParamObj["Type"] = Param.Type.Name; - ParamsArrayRef.push_back(ParamVal); - } - Obj["Params"] = ParamsArray; - } + if (!F.Params.empty()) + serializeArray(F.Params, Obj, "Params", SerializeInfoLambda); if (F.Template) serializeInfo(F.Template.value(), Obj); } +static void serializeInfo(const EnumValueInfo &I, Object &Obj) { + Obj["Name"] = I.Name; + if (!I.ValueExpr.empty()) + Obj["ValueExpr"] = I.ValueExpr; + else + Obj["Value"] = I.Value; +} + static void serializeInfo(const EnumInfo &I, json::Object &Obj, - std::optional RepositoryUrl) { + const std::optional &RepositoryUrl) { serializeCommonAttributes(I, Obj, RepositoryUrl); Obj["Scoped"] = I.Scoped; @@ -371,26 +341,12 @@ static void serializeInfo(const EnumInfo &I, json::Object &Obj, Obj["BaseType"] = BaseTypeVal; } - if (!I.Members.empty()) { - json::Value MembersArray = Array(); - auto &MembersArrayRef = *MembersArray.getAsArray(); - MembersArrayRef.reserve(I.Members.size()); - for (const auto &Member : I.Members) { - json::Value MemberVal = Object(); - auto &MemberObj = *MemberVal.getAsObject(); - MemberObj["Name"] = Member.Name; - if (!Member.ValueExpr.empty()) - MemberObj["ValueExpr"] = Member.ValueExpr; - else - MemberObj["Value"] = Member.Value; - MembersArrayRef.push_back(MemberVal); - } - Obj["Members"] = MembersArray; - } + if (!I.Members.empty()) + serializeArray(I.Members, Obj, "Members", SerializeInfoLambda); } static void serializeInfo(const TypedefInfo &I, json::Object &Obj, - std::optional RepositoryUrl) { + const std::optional &RepositoryUrl) { serializeCommonAttributes(I, Obj, RepositoryUrl); Obj["TypeDeclaration"] = I.TypeDeclaration; Obj["IsUsing"] = I.IsUsing; @@ -400,8 +356,32 @@ static void serializeInfo(const TypedefInfo &I, json::Object &Obj, Obj["Underlying"] = TypeVal; } +static void serializeInfo(const BaseRecordInfo &I, Object &Obj, + const std::optional &RepositoryUrl) { + serializeInfo(static_cast(I), Obj, RepositoryUrl); + Obj["IsVirtual"] = I.IsVirtual; + Obj["Access"] = getAccessSpelling(I.Access); + Obj["IsParent"] = I.IsParent; +} + +static void serializeInfo(const FriendInfo &I, Object &Obj) { + auto FriendRef = Object(); + serializeReference(I.Ref, FriendRef); + Obj["Reference"] = std::move(FriendRef); + Obj["IsClass"] = I.IsClass; + if (I.Template) + serializeInfo(I.Template.value(), Obj); + if (I.Params) + serializeArray(I.Params.value(), Obj, "Params", SerializeInfoLambda); + if (I.ReturnType) { + auto ReturnTypeObj = Object(); + serializeInfo(I.ReturnType.value(), ReturnTypeObj); + Obj["ReturnType"] = std::move(ReturnTypeObj); + } +} + static void serializeInfo(const RecordInfo &I, json::Object &Obj, - std::optional RepositoryUrl) { + const std::optional &RepositoryUrl) { serializeCommonAttributes(I, Obj, RepositoryUrl); Obj["FullName"] = I.FullName; Obj["TagType"] = getTagType(I.TagType); @@ -454,71 +434,60 @@ static void serializeInfo(const RecordInfo &I, json::Object &Obj, Obj["ProtectedMembers"] = ProtectedMembersArray; } - if (!I.Bases.empty()) { - json::Value BasesArray = Array(); - json::Array &BasesArrayRef = *BasesArray.getAsArray(); - BasesArrayRef.reserve(I.Bases.size()); - for (const auto &BaseInfo : I.Bases) { - json::Value BaseInfoVal = Object(); - auto &BaseInfoObj = *BaseInfoVal.getAsObject(); - serializeInfo(BaseInfo, BaseInfoObj, RepositoryUrl); - BaseInfoObj["IsVirtual"] = BaseInfo.IsVirtual; - BaseInfoObj["Access"] = getAccessSpelling(BaseInfo.Access); - BaseInfoObj["IsParent"] = BaseInfo.IsParent; - BasesArrayRef.push_back(BaseInfoVal); - } - Obj["Bases"] = BasesArray; - } + if (!I.Bases.empty()) + serializeArray( + I.Bases, Obj, "Bases", + [&RepositoryUrl](const BaseRecordInfo &Base, Object &BaseObj) { + serializeInfo(Base, BaseObj, RepositoryUrl); + }); if (!I.Parents.empty()) - serializeReference(I.Parents, Obj, "Parents"); + serializeArray(I.Parents, Obj, "Parents", SerializeReferenceLambda); if (!I.VirtualParents.empty()) - serializeReference(I.VirtualParents, Obj, "VirtualParents"); + serializeArray(I.VirtualParents, Obj, "VirtualParents", + SerializeReferenceLambda); if (I.Template) serializeInfo(I.Template.value(), Obj); + if (!I.Friends.empty()) + serializeArray(I.Friends, Obj, "Friends", SerializeInfoLambda); + serializeCommonChildren(I.Children, Obj, RepositoryUrl); } +static void serializeInfo(const VarInfo &I, json::Object &Obj, + const std::optional &RepositoryUrl) { + serializeCommonAttributes(I, Obj, RepositoryUrl); + Obj["IsStatic"] = I.IsStatic; + auto TypeObj = Object(); + serializeInfo(I.Type, TypeObj); + Obj["Type"] = std::move(TypeObj); +} + static void serializeInfo(const NamespaceInfo &I, json::Object &Obj, - std::optional RepositoryUrl) { + const std::optional &RepositoryUrl) { serializeCommonAttributes(I, Obj, RepositoryUrl); - if (!I.Children.Namespaces.empty()) { - json::Value NamespacesArray = Array(); - auto &NamespacesArrayRef = *NamespacesArray.getAsArray(); - NamespacesArrayRef.reserve(I.Children.Namespaces.size()); - for (auto &Namespace : I.Children.Namespaces) { - json::Value NamespaceVal = Object(); - auto &NamespaceObj = *NamespaceVal.getAsObject(); - serializeReference(Namespace, NamespaceObj); - NamespacesArrayRef.push_back(NamespaceVal); - } - Obj["Namespaces"] = NamespacesArray; - } + if (!I.Children.Namespaces.empty()) + serializeArray(I.Children.Namespaces, Obj, "Namespaces", + SerializeReferenceLambda); - auto SerializeInfo = [RepositoryUrl](const auto &Info, Object &Object) { + static auto SerializeInfo = [&RepositoryUrl](const auto &Info, + Object &Object) { serializeInfo(Info, Object, RepositoryUrl); }; - if (!I.Children.Functions.empty()) { - json::Value FunctionsArray = Array(); - auto &FunctionsArrayRef = *FunctionsArray.getAsArray(); - FunctionsArrayRef.reserve(I.Children.Functions.size()); - for (const auto &Function : I.Children.Functions) { - json::Value FunctionVal = Object(); - auto &FunctionObj = *FunctionVal.getAsObject(); - serializeInfo(Function, FunctionObj, RepositoryUrl); - FunctionsArrayRef.push_back(FunctionVal); - } - Obj["Functions"] = FunctionsArray; - } + if (!I.Children.Functions.empty()) + serializeArray(I.Children.Functions, Obj, "Functions", SerializeInfo); if (!I.Children.Concepts.empty()) serializeArray(I.Children.Concepts, Obj, "Concepts", SerializeInfo); + if (!I.Children.Variables.empty()) + serializeArray(I.Children.Variables, Obj, "Variables", SerializeInfo); + serializeCommonChildren(I.Children, Obj, RepositoryUrl); } @@ -573,6 +542,8 @@ Error JSONGenerator::generateDocForInfo(Info *I, raw_ostream &OS, case InfoType::IT_enum: case InfoType::IT_function: case InfoType::IT_typedef: + case InfoType::IT_variable: + case InfoType::IT_friend: break; case InfoType::IT_default: return createStringError(inconvertibleErrorCode(), "unexpected info type"); diff --git a/clang-tools-extra/clang-doc/MDGenerator.cpp b/clang-tools-extra/clang-doc/MDGenerator.cpp index 6e68e09cfa2a..6f16f5bd2f52 100644 --- a/clang-tools-extra/clang-doc/MDGenerator.cpp +++ b/clang-tools-extra/clang-doc/MDGenerator.cpp @@ -375,6 +375,12 @@ static llvm::Error genIndex(ClangDocContext &CDCtx) { case InfoType::IT_concept: Type = "Concept"; break; + case InfoType::IT_variable: + Type = "Variable"; + break; + case InfoType::IT_friend: + Type = "Friend"; + break; case InfoType::IT_default: Type = "Other"; } @@ -468,6 +474,8 @@ llvm::Error MDGenerator::generateDocForInfo(Info *I, llvm::raw_ostream &OS, genMarkdown(CDCtx, *static_cast(I), OS); break; case InfoType::IT_concept: + case InfoType::IT_variable: + case InfoType::IT_friend: break; case InfoType::IT_default: return createStringError(llvm::inconvertibleErrorCode(), diff --git a/clang-tools-extra/clang-doc/Mapper.cpp b/clang-tools-extra/clang-doc/Mapper.cpp index 6021e17b4696..497b80cf9746 100644 --- a/clang-tools-extra/clang-doc/Mapper.cpp +++ b/clang-tools-extra/clang-doc/Mapper.cpp @@ -138,6 +138,12 @@ bool MapASTVisitor::VisitConceptDecl(const ConceptDecl *D) { return mapDecl(D, true); } +bool MapASTVisitor::VisitVarDecl(const VarDecl *D) { + if (D->isCXXClassMember()) + return true; + return mapDecl(D, D->isThisDeclarationADefinition()); +} + comments::FullComment * MapASTVisitor::getComment(const NamedDecl *D, const ASTContext &Context) const { RawComment *Comment = Context.getRawCommentForDeclNoCache(D); diff --git a/clang-tools-extra/clang-doc/Mapper.h b/clang-tools-extra/clang-doc/Mapper.h index 04dc5450c8ba..322df6d594b3 100644 --- a/clang-tools-extra/clang-doc/Mapper.h +++ b/clang-tools-extra/clang-doc/Mapper.h @@ -42,6 +42,7 @@ class MapASTVisitor : public clang::RecursiveASTVisitor, bool VisitTypedefDecl(const TypedefDecl *D); bool VisitTypeAliasDecl(const TypeAliasDecl *D); bool VisitConceptDecl(const ConceptDecl *D); + bool VisitVarDecl(const VarDecl *D); private: template bool mapDecl(const T *D, bool IsDefinition); diff --git a/clang-tools-extra/clang-doc/Representation.cpp b/clang-tools-extra/clang-doc/Representation.cpp index 286aeeea1001..422a76d99e5b 100644 --- a/clang-tools-extra/clang-doc/Representation.cpp +++ b/clang-tools-extra/clang-doc/Representation.cpp @@ -145,6 +145,10 @@ mergeInfos(std::vector> &Values) { return reduce(Values); case InfoType::IT_concept: return reduce(Values); + case InfoType::IT_variable: + return reduce(Values); + case InfoType::IT_friend: + return reduce(Values); case InfoType::IT_default: return llvm::createStringError(llvm::inconvertibleErrorCode(), "unexpected info type"); @@ -245,6 +249,15 @@ void Reference::merge(Reference &&Other) { Path = Other.Path; } +bool FriendInfo::mergeable(const FriendInfo &Other) { + return Ref.USR == Other.Ref.USR && Ref.Name == Other.Ref.Name; +} + +void FriendInfo::merge(FriendInfo &&Other) { + assert(mergeable(Other)); + Ref.merge(std::move(Other.Ref)); +} + void Info::mergeBase(Info &&Other) { assert(mergeable(Other)); if (USR == EmptySID) @@ -291,6 +304,7 @@ void NamespaceInfo::merge(NamespaceInfo &&Other) { reduceChildren(Children.Enums, std::move(Other.Children.Enums)); reduceChildren(Children.Typedefs, std::move(Other.Children.Typedefs)); reduceChildren(Children.Concepts, std::move(Other.Children.Concepts)); + reduceChildren(Children.Variables, std::move(Other.Children.Variables)); mergeBase(std::move(Other)); } @@ -310,6 +324,8 @@ void RecordInfo::merge(RecordInfo &&Other) { Parents = std::move(Other.Parents); if (VirtualParents.empty()) VirtualParents = std::move(Other.VirtualParents); + if (Friends.empty()) + Friends = std::move(Other.Friends); // Reduce children if necessary. reduceChildren(Children.Records, std::move(Other.Children.Records)); reduceChildren(Children.Functions, std::move(Other.Children.Functions)); @@ -368,6 +384,15 @@ void ConceptInfo::merge(ConceptInfo &&Other) { SymbolInfo::merge(std::move(Other)); } +void VarInfo::merge(VarInfo &&Other) { + assert(mergeable(Other)); + if (!IsStatic) + IsStatic = Other.IsStatic; + if (Type.Type.USR == EmptySID && Type.Type.Name == "") + Type = std::move(Other.Type); + SymbolInfo::merge(std::move(Other)); +} + BaseRecordInfo::BaseRecordInfo() : RecordInfo() {} BaseRecordInfo::BaseRecordInfo(SymbolID USR, StringRef Name, StringRef Path, @@ -407,6 +432,12 @@ llvm::SmallString<16> Info::extractName() const { case InfoType::IT_concept: return llvm::SmallString<16>("@nonymous_concept_" + toHex(llvm::toStringRef(USR))); + case InfoType::IT_variable: + return llvm::SmallString<16>("@nonymous_variable_" + + toHex(llvm::toStringRef(USR))); + case InfoType::IT_friend: + return llvm::SmallString<16>("@nonymous_friend_" + + toHex(llvm::toStringRef(USR))); case InfoType::IT_default: return llvm::SmallString<16>("@nonymous_" + toHex(llvm::toStringRef(USR))); } @@ -473,6 +504,7 @@ void ScopeChildren::sort() { llvm::sort(Enums.begin(), Enums.end()); llvm::sort(Typedefs.begin(), Typedefs.end()); llvm::sort(Concepts.begin(), Concepts.end()); + llvm::sort(Variables.begin(), Variables.end()); } } // namespace doc } // namespace clang diff --git a/clang-tools-extra/clang-doc/Representation.h b/clang-tools-extra/clang-doc/Representation.h index b23069f2bd32..fe5cc48069d5 100644 --- a/clang-tools-extra/clang-doc/Representation.h +++ b/clang-tools-extra/clang-doc/Representation.h @@ -36,6 +36,7 @@ struct FunctionInfo; struct Info; struct TypedefInfo; struct ConceptInfo; +struct VarInfo; enum class InfoType { IT_default, @@ -44,7 +45,9 @@ enum class InfoType { IT_function, IT_enum, IT_typedef, - IT_concept + IT_concept, + IT_variable, + IT_friend }; enum class CommentKind { @@ -169,6 +172,7 @@ struct ScopeChildren { std::vector Enums; std::vector Typedefs; std::vector Concepts; + std::vector Variables; void sort(); }; @@ -376,6 +380,31 @@ struct SymbolInfo : public Info { bool IsStatic = false; }; +struct FriendInfo : SymbolInfo { + FriendInfo() : SymbolInfo(InfoType::IT_friend) {} + FriendInfo(SymbolID USR) : SymbolInfo(InfoType::IT_friend, USR) {} + FriendInfo(const InfoType IT, const SymbolID &USR, + const StringRef Name = StringRef()) + : SymbolInfo(IT, USR, Name) {} + bool mergeable(const FriendInfo &Other); + void merge(FriendInfo &&Other); + + Reference Ref; + std::optional Template; + std::optional ReturnType; + std::optional> Params; + bool IsClass = false; +}; + +struct VarInfo : SymbolInfo { + VarInfo() : SymbolInfo(InfoType::IT_variable) {} + explicit VarInfo(SymbolID USR) : SymbolInfo(InfoType::IT_variable, USR) {} + + void merge(VarInfo &&I); + + TypeInfo Type; +}; + // TODO: Expand to allow for documenting templating and default args. // Info for functions. struct FunctionInfo : public SymbolInfo { @@ -442,6 +471,8 @@ struct RecordInfo : public SymbolInfo { Bases; // List of base/parent records; this includes inherited methods and // attributes + std::vector Friends; + ScopeChildren Children; }; diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp index 5f3e5c37fa34..6cc372ce98a6 100644 --- a/clang-tools-extra/clang-doc/Serialize.cpp +++ b/clang-tools-extra/clang-doc/Serialize.cpp @@ -8,8 +8,10 @@ #include "Serialize.h" #include "BitcodeWriter.h" + #include "clang/AST/Attr.h" #include "clang/AST/Comment.h" +#include "clang/AST/DeclFriend.h" #include "clang/Index/USRGeneration.h" #include "clang/Lex/Lexer.h" #include "llvm/ADT/StringExtras.h" @@ -401,6 +403,9 @@ std::string serialize(std::unique_ptr &I) { return serialize(*static_cast(I.get())); case InfoType::IT_concept: return serialize(*static_cast(I.get())); + case InfoType::IT_variable: + return serialize(*static_cast(I.get())); + case InfoType::IT_friend: case InfoType::IT_typedef: case InfoType::IT_default: return ""; @@ -508,6 +513,10 @@ static void InsertChild(ScopeChildren &Scope, ConceptInfo Info) { Scope.Concepts.push_back(std::move(Info)); } +static void InsertChild(ScopeChildren &Scope, VarInfo Info) { + Scope.Variables.push_back(std::move(Info)); +} + // Creates a parent of the correct type for the given child and inserts it into // that parent. // @@ -549,6 +558,8 @@ static std::unique_ptr makeAndInsertIntoParent(ChildType Child) { case InfoType::IT_function: case InfoType::IT_typedef: case InfoType::IT_concept: + case InfoType::IT_variable: + case InfoType::IT_friend: break; } llvm_unreachable("Invalid reference type for parent namespace"); @@ -940,6 +951,55 @@ emitInfo(const NamespaceDecl *D, const FullComment *FC, Location Loc, return {std::move(NSI), makeAndInsertIntoParent(*NSI)}; } +static void parseFriends(RecordInfo &RI, const CXXRecordDecl *D) { + if (!D->hasDefinition() || !D->hasFriends()) + return; + + for (const FriendDecl *FD : D->friends()) { + if (FD->isUnsupportedFriend()) + continue; + + FriendInfo F(InfoType::IT_friend, getUSRForDecl(FD)); + const auto *ActualDecl = FD->getFriendDecl(); + if (!ActualDecl) { + const auto *FriendTypeInfo = FD->getFriendType(); + if (!FriendTypeInfo) + continue; + ActualDecl = FriendTypeInfo->getType()->getAsCXXRecordDecl(); + + if (!ActualDecl) + continue; + F.IsClass = true; + } + + if (const auto *ActualTD = dyn_cast_or_null(ActualDecl)) { + if (isa(ActualTD->getTemplatedDecl())) + F.IsClass = true; + F.Template.emplace(); + for (const auto *Param : ActualTD->getTemplateParameters()->asArray()) + F.Template->Params.emplace_back( + getSourceCode(Param, Param->getSourceRange())); + ActualDecl = ActualTD->getTemplatedDecl(); + } + + if (auto *FuncDecl = dyn_cast_or_null(ActualDecl)) { + FunctionInfo TempInfo; + parseParameters(TempInfo, FuncDecl); + F.Params.emplace(); + F.Params = std::move(TempInfo.Params); + F.ReturnType = getTypeInfoForType(FuncDecl->getReturnType(), + FuncDecl->getLangOpts()); + } + + F.Ref = + Reference(getUSRForDecl(ActualDecl), ActualDecl->getNameAsString(), + InfoType::IT_default, ActualDecl->getQualifiedNameAsString(), + getInfoRelativePath(ActualDecl)); + + RI.Friends.push_back(std::move(F)); + } +} + std::pair, std::unique_ptr> emitInfo(const RecordDecl *D, const FullComment *FC, Location Loc, bool PublicOnly) { @@ -963,6 +1023,7 @@ emitInfo(const RecordDecl *D, const FullComment *FC, Location Loc, // TODO: remove first call to parseBases, that function should be deleted parseBases(*RI, C); parseBases(*RI, C, /*IsFileInRootDir=*/true, PublicOnly, /*IsParent=*/true); + parseFriends(*RI, C); } RI->Path = getInfoRelativePath(RI->Namespace); @@ -1164,6 +1225,26 @@ emitInfo(const ConceptDecl *D, const FullComment *FC, const Location &Loc, return {nullptr, makeAndInsertIntoParent(std::move(Concept))}; } +std::pair, std::unique_ptr> +emitInfo(const VarDecl *D, const FullComment *FC, const Location &Loc, + bool PublicOnly) { + VarInfo Var; + bool IsInAnonymousNamespace = false; + populateSymbolInfo(Var, D, FC, Loc, IsInAnonymousNamespace); + if (!shouldSerializeInfo(PublicOnly, IsInAnonymousNamespace, D)) + return {}; + + if (D->getStorageClass() == StorageClass::SC_Static) + Var.IsStatic = true; + Var.Type = + getTypeInfoForType(D->getType(), D->getASTContext().getPrintingPolicy()); + + if (!shouldSerializeInfo(PublicOnly, IsInAnonymousNamespace, D)) + return {}; + + return {nullptr, makeAndInsertIntoParent(std::move(Var))}; +} + } // namespace serialize } // namespace doc } // namespace clang diff --git a/clang-tools-extra/clang-doc/Serialize.h b/clang-tools-extra/clang-doc/Serialize.h index 497b09bb339f..06c4d64c5149 100644 --- a/clang-tools-extra/clang-doc/Serialize.h +++ b/clang-tools-extra/clang-doc/Serialize.h @@ -72,6 +72,10 @@ std::pair, std::unique_ptr> emitInfo(const ConceptDecl *D, const FullComment *FC, const Location &Loc, bool PublicOnly); +std::pair, std::unique_ptr> +emitInfo(const VarDecl *D, const FullComment *FC, const Location &Loc, + bool PublicOnly); + // Function to hash a given USR value for storage. // As USRs (Unified Symbol Resolution) could be large, especially for functions // with long type arguments, we use 160-bits SHA1(USR) values to diff --git a/clang-tools-extra/clang-doc/YAMLGenerator.cpp b/clang-tools-extra/clang-doc/YAMLGenerator.cpp index f95887104698..eeccdd804b66 100644 --- a/clang-tools-extra/clang-doc/YAMLGenerator.cpp +++ b/clang-tools-extra/clang-doc/YAMLGenerator.cpp @@ -409,6 +409,8 @@ llvm::Error YAMLGenerator::generateDocForInfo(Info *I, llvm::raw_ostream &OS, InfoYAML << *static_cast(I); break; case InfoType::IT_concept: + case InfoType::IT_variable: + case InfoType::IT_friend: break; case InfoType::IT_default: return llvm::createStringError(llvm::inconvertibleErrorCode(), diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp index a71813a103df..c35f0b941c60 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp @@ -358,8 +358,27 @@ getFixIt(const tooling::Diagnostic &Diagnostic, bool AnyFix) { } // namespace clang::tidy +void ClangTidyDiagnosticConsumer::BeginSourceFile(const LangOptions &LangOpts, + const Preprocessor *PP) { + DiagnosticConsumer::BeginSourceFile(LangOpts, PP); + + assert(!InSourceFile); + InSourceFile = true; +} + +void ClangTidyDiagnosticConsumer::EndSourceFile() { + assert(InSourceFile); + InSourceFile = false; + + DiagnosticConsumer::EndSourceFile(); +} + void ClangTidyDiagnosticConsumer::HandleDiagnostic( DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) { + // A diagnostic should not be reported outside of a + // BeginSourceFile()/EndSourceFile() pair if it has a source location. + assert(InSourceFile || Info.getLocation().isInvalid()); + if (LastErrorWasIgnored && DiagLevel == DiagnosticsEngine::Note) return; diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h index a8851e794f24..6e7cb7bb10e5 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h +++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h @@ -292,6 +292,11 @@ class ClangTidyDiagnosticConsumer : public DiagnosticConsumer { void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override; + void BeginSourceFile(const LangOptions &LangOpts, + const Preprocessor *PP = nullptr) override; + + void EndSourceFile() override; + // Retrieve the diagnostics that were captured. std::vector take(); @@ -326,6 +331,11 @@ class ClangTidyDiagnosticConsumer : public DiagnosticConsumer { bool LastErrorRelatesToUserCode = false; bool LastErrorPassesLineFilter = false; bool LastErrorWasIgnored = false; + /// Tracks whether we're currently inside a + /// `BeginSourceFile()/EndSourceFile()` pair. Outside of a source file, we + /// should only receive diagnostics that have to source location, such as + /// command-line warnings. + bool InSourceFile = false; }; } // end namespace tidy diff --git a/clang-tools-extra/clang-tidy/bugprone/MisleadingSetterOfReferenceCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MisleadingSetterOfReferenceCheck.cpp index 4aba5831e677..23de8d971898 100644 --- a/clang-tools-extra/clang-tidy/bugprone/MisleadingSetterOfReferenceCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/MisleadingSetterOfReferenceCheck.cpp @@ -50,6 +50,8 @@ void MisleadingSetterOfReferenceCheck::check( const MatchFinder::MatchResult &Result) { const auto *Found = Result.Nodes.getNodeAs("bad-set-function"); const auto *Member = Result.Nodes.getNodeAs("member"); + assert(Found != nullptr); + assert(Member != nullptr); diag(Found->getBeginLoc(), "function '%0' can be mistakenly used in order to change the " diff --git a/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp index 9eeba867f521..88d2f2c388d0 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp @@ -72,7 +72,9 @@ SizeofExpressionCheck::SizeofExpressionCheck(StringRef Name, Options.get("WarnOnSizeOfPointerToAggregate", true)), WarnOnSizeOfPointer(Options.get("WarnOnSizeOfPointer", false)), WarnOnOffsetDividedBySizeOf( - Options.get("WarnOnOffsetDividedBySizeOf", true)) {} + Options.get("WarnOnOffsetDividedBySizeOf", true)), + WarnOnSizeOfInLoopTermination( + Options.get("WarnOnSizeOfInLoopTermination", true)) {} void SizeofExpressionCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "WarnOnSizeOfConstant", WarnOnSizeOfConstant); @@ -86,6 +88,8 @@ void SizeofExpressionCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { Options.store(Opts, "WarnOnSizeOfPointer", WarnOnSizeOfPointer); Options.store(Opts, "WarnOnOffsetDividedBySizeOf", WarnOnOffsetDividedBySizeOf); + Options.store(Opts, "WarnOnSizeOfInLoopTermination", + WarnOnSizeOfInLoopTermination); } void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { @@ -93,6 +97,13 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { // Some of the checks should not match in template code to avoid false // positives if sizeof is applied on template argument. + auto LoopCondExpr = + [](const ast_matchers::internal::Matcher &InnerMatcher) { + return stmt(anyOf(forStmt(hasCondition(InnerMatcher)), + whileStmt(hasCondition(InnerMatcher)), + doStmt(hasCondition(InnerMatcher)))); + }; + const auto IntegerExpr = ignoringParenImpCasts(integerLiteral()); const auto ConstantExpr = ignoringParenImpCasts( anyOf(integerLiteral(), unaryOperator(hasUnaryOperand(IntegerExpr)), @@ -130,6 +141,14 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) { this); } + if (WarnOnSizeOfInLoopTermination) { + auto CondExpr = binaryOperator( + allOf(has(SizeOfExpr.bind("sizeof-expr")), isComparisonOperator())); + Finder->addMatcher(LoopCondExpr(anyOf(CondExpr, hasDescendant(CondExpr))) + .bind("loop-expr"), + this); + } + // Detect sizeof(kPtr) where kPtr is 'const char* kPtr = "abc"'; const auto CharPtrType = pointerType(pointee(isAnyCharacter())); const auto ConstStrLiteralDecl = @@ -349,6 +368,23 @@ void SizeofExpressionCheck::check(const MatchFinder::MatchResult &Result) { diag(E->getBeginLoc(), "suspicious usage of 'sizeof(char*)'; do you mean 'strlen'?") << E->getSourceRange(); + } else if (Result.Nodes.getNodeAs("loop-expr")) { + auto *SizeofArgTy = Result.Nodes.getNodeAs("sizeof-arg-type"); + if (const auto member = dyn_cast(SizeofArgTy)) + SizeofArgTy = member->getPointeeType().getTypePtr(); + + const auto *SzOfExpr = Result.Nodes.getNodeAs("sizeof-expr"); + + if (const auto type = dyn_cast(SizeofArgTy)) { + // check if the array element size is larger than one. If true, + // the size of the array is higher than the number of elements + CharUnits sSize = Ctx.getTypeSizeInChars(type->getElementType()); + if (!sSize.isOne()) { + diag(SzOfExpr->getBeginLoc(), + "suspicious usage of 'sizeof' in the loop") + << SzOfExpr->getSourceRange(); + } + } } else if (const auto *E = Result.Nodes.getNodeAs("sizeof-pointer")) { diag(E->getBeginLoc(), "suspicious usage of 'sizeof()' on an expression " "of pointer type") diff --git a/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.h b/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.h index fbd62cb80fb2..e979b4723cf2 100644 --- a/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.h +++ b/clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.h @@ -32,6 +32,7 @@ class SizeofExpressionCheck : public ClangTidyCheck { const bool WarnOnSizeOfPointerToAggregate; const bool WarnOnSizeOfPointer; const bool WarnOnOffsetDividedBySizeOf; + const bool WarnOnSizeOfInLoopTermination; }; } // namespace clang::tidy::bugprone diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.cpp index cf299609e646..268b51f76a2c 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.cpp @@ -120,7 +120,7 @@ void MissingStdForwardCheck::registerMatchers(MatchFinder *Finder) { equalsBoundNode("param"), equalsBoundNode("var")))))), CapturedInLambda)), callee(unresolvedLookupExpr(hasAnyDeclaration( - namedDecl(hasUnderlyingDecl(hasName("::std::forward")))))), + namedDecl(hasUnderlyingDecl(hasName(ForwardFunction)))))), unless(anyOf(hasAncestor(typeLoc()), hasAncestor(expr(hasUnevaluatedContext()))))); @@ -149,4 +149,13 @@ void MissingStdForwardCheck::check(const MatchFinder::MatchResult &Result) { << Param; } +MissingStdForwardCheck::MissingStdForwardCheck(StringRef Name, + ClangTidyContext *Context) + : ClangTidyCheck(Name, Context), + ForwardFunction(Options.get("ForwardFunction", "::std::forward")) {} + +void MissingStdForwardCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { + Options.store(Opts, "ForwardFunction", ForwardFunction); +} + } // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.h index 5995ad588855..f833b8031f8a 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/MissingStdForwardCheck.h @@ -21,8 +21,7 @@ namespace clang::tidy::cppcoreguidelines { /// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/missing-std-forward.html class MissingStdForwardCheck : public ClangTidyCheck { public: - MissingStdForwardCheck(StringRef Name, ClangTidyContext *Context) - : ClangTidyCheck(Name, Context) {} + MissingStdForwardCheck(StringRef Name, ClangTidyContext *Context); void registerMatchers(ast_matchers::MatchFinder *Finder) override; void check(const ast_matchers::MatchFinder::MatchResult &Result) override; bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { @@ -31,6 +30,10 @@ class MissingStdForwardCheck : public ClangTidyCheck { std::optional getCheckTraversalKind() const override { return TK_IgnoreUnlessSpelledInSource; } + void storeOptions(ClangTidyOptions::OptionMap &Opts) override; + +private: + const StringRef ForwardFunction; }; } // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp index a1494a095f5b..9ac7b9e057e3 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp @@ -15,16 +15,13 @@ using namespace clang::ast_matchers; namespace clang::tidy::cppcoreguidelines { void ProBoundsPointerArithmeticCheck::registerMatchers(MatchFinder *Finder) { - if (!getLangOpts().CPlusPlus) - return; - const auto AllPointerTypes = - anyOf(hasType(pointerType()), + anyOf(hasType(hasUnqualifiedDesugaredType(pointerType())), hasType(autoType( hasDeducedType(hasUnqualifiedDesugaredType(pointerType())))), hasType(decltypeType(hasUnderlyingType(pointerType())))); - // Flag all operators +, -, +=, -=, ++, -- that result in a pointer + // Flag all operators +, -, +=, -= that result in a pointer Finder->addMatcher( binaryOperator( hasAnyOperatorName("+", "-", "+=", "-="), AllPointerTypes, @@ -32,8 +29,12 @@ void ProBoundsPointerArithmeticCheck::registerMatchers(MatchFinder *Finder) { .bind("expr"), this); + // Flag all operators ++, -- that result in a pointer Finder->addMatcher( - unaryOperator(hasAnyOperatorName("++", "--"), hasType(pointerType())) + unaryOperator(hasAnyOperatorName("++", "--"), + hasType(hasUnqualifiedDesugaredType(pointerType())), + unless(hasUnaryOperand( + ignoringImpCasts(declRefExpr(to(isImplicit())))))) .bind("expr"), this); @@ -42,7 +43,8 @@ void ProBoundsPointerArithmeticCheck::registerMatchers(MatchFinder *Finder) { arraySubscriptExpr( hasBase(ignoringImpCasts( anyOf(AllPointerTypes, - hasType(decayedType(hasDecayedType(pointerType()))))))) + hasType(decayedType(hasDecayedType(pointerType())))))), + hasIndex(hasType(isInteger()))) .bind("expr"), this); } diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h index 67f7d1bf9dd6..3466c72a769e 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.h @@ -23,6 +23,9 @@ class ProBoundsPointerArithmeticCheck : public ClangTidyCheck { public: ProBoundsPointerArithmeticCheck(StringRef Name, ClangTidyContext *Context) : ClangTidyCheck(Name, Context) {} + bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { + return LangOpts.CPlusPlus; + } void registerMatchers(ast_matchers::MatchFinder *Finder) override; void check(const ast_matchers::MatchFinder::MatchResult &Result) override; }; diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp index 8c386d5bc794..272152644d7d 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.cpp @@ -42,9 +42,9 @@ void RvalueReferenceParamNotMovedCheck::registerMatchers(MatchFinder *Finder) { StatementMatcher MoveCallMatcher = callExpr( argumentCountIs(1), - anyOf(callee(functionDecl(hasName("::std::move"))), + anyOf(callee(functionDecl(hasName(MoveFunction))), callee(unresolvedLookupExpr(hasAnyDeclaration( - namedDecl(hasUnderlyingDecl(hasName("::std::move"))))))), + namedDecl(hasUnderlyingDecl(hasName(MoveFunction))))))), hasArgument( 0, argumentOf( AllowPartialMove, @@ -122,7 +122,8 @@ RvalueReferenceParamNotMovedCheck::RvalueReferenceParamNotMovedCheck( AllowPartialMove(Options.get("AllowPartialMove", false)), IgnoreUnnamedParams(Options.get("IgnoreUnnamedParams", false)), IgnoreNonDeducedTemplateTypes( - Options.get("IgnoreNonDeducedTemplateTypes", false)) {} + Options.get("IgnoreNonDeducedTemplateTypes", false)), + MoveFunction(Options.get("MoveFunction", "::std::move")) {} void RvalueReferenceParamNotMovedCheck::storeOptions( ClangTidyOptions::OptionMap &Opts) { @@ -130,6 +131,7 @@ void RvalueReferenceParamNotMovedCheck::storeOptions( Options.store(Opts, "IgnoreUnnamedParams", IgnoreUnnamedParams); Options.store(Opts, "IgnoreNonDeducedTemplateTypes", IgnoreNonDeducedTemplateTypes); + Options.store(Opts, "MoveFunction", MoveFunction); } } // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.h index d8c3d2bd4ba0..950c0206745d 100644 --- a/clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.h +++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/RvalueReferenceParamNotMovedCheck.h @@ -32,6 +32,7 @@ class RvalueReferenceParamNotMovedCheck : public ClangTidyCheck { const bool AllowPartialMove; const bool IgnoreUnnamedParams; const bool IgnoreNonDeducedTemplateTypes; + const StringRef MoveFunction; }; } // namespace clang::tidy::cppcoreguidelines diff --git a/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp b/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp index 763947698052..79ae5ee98182 100644 --- a/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp @@ -1,5 +1,4 @@ -//===--- ConfusableIdentifierCheck.cpp - -// clang-tidy--------------------------===// +//===--- ConfusableIdentifierCheck.cpp - clang-tidy -----------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -9,6 +8,7 @@ #include "ConfusableIdentifierCheck.h" +#include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Lex/Preprocessor.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/ConvertUTF.h" @@ -88,99 +88,98 @@ static llvm::SmallString<64U> skeleton(StringRef Name) { return Skeleton; } -static bool mayShadowImpl(const DeclContext *DC0, const DeclContext *DC1) { - return DC0 && DC0 == DC1; -} - -static bool mayShadowImpl(const NamedDecl *ND0, const NamedDecl *ND1) { - return isa(ND0) || isa(ND1); -} - -static bool isMemberOf(const ConfusableIdentifierCheck::ContextInfo *DC0, - const ConfusableIdentifierCheck::ContextInfo *DC1) { - return llvm::is_contained(DC1->Bases, DC0->PrimaryContext); -} - -static bool enclosesContext(const ConfusableIdentifierCheck::ContextInfo *DC0, - const ConfusableIdentifierCheck::ContextInfo *DC1) { - if (DC0->PrimaryContext == DC1->PrimaryContext) - return true; - - return llvm::is_contained(DC0->PrimaryContexts, DC1->PrimaryContext) || - llvm::is_contained(DC1->PrimaryContexts, DC0->PrimaryContext); -} - -static bool mayShadow(const NamedDecl *ND0, - const ConfusableIdentifierCheck::ContextInfo *DC0, - const NamedDecl *ND1, - const ConfusableIdentifierCheck::ContextInfo *DC1) { - - if (!DC0->Bases.empty() && !DC1->Bases.empty()) { - // if any of the declaration is a non-private member of the other - // declaration, it's shadowed by the former - - if (ND1->getAccess() != AS_private && isMemberOf(DC1, DC0)) - return true; +namespace { +struct Entry { + const NamedDecl *ND; + const Decl *Parent; + bool FromDerivedClass; +}; +} // namespace - if (ND0->getAccess() != AS_private && isMemberOf(DC0, DC1)) +// Map from a context to the declarations in that context with the current +// skeleton. At most one entry per distinct identifier is tracked. The +// context is usually a `DeclContext`, but can also be a template declaration +// that has no corresponding context, such as an alias template or variable +// template. +using DeclsWithinContextMap = + llvm::DenseMap>; + +static bool addToContext(DeclsWithinContextMap &DeclsWithinContext, + const Decl *Context, Entry E) { + auto &Decls = DeclsWithinContext[Context]; + if (!Decls.empty() && + Decls.back().ND->getIdentifier() == E.ND->getIdentifier()) { + // Already have a declaration with this identifier in this context. Don't + // track another one. This means that if an outer name is confusable with an + // inner name, we'll only diagnose the outer name once, pointing at the + // first inner declaration with that name. + if (Decls.back().FromDerivedClass && !E.FromDerivedClass) { + // Prefer the declaration that's not from the derived class, because that + // conflicts with more declarations. + Decls.back() = E; return true; - } - - if (!mayShadowImpl(DC0->NonTransparentContext, DC1->NonTransparentContext) && - !mayShadowImpl(ND0, ND1)) + } return false; - - return enclosesContext(DC0, DC1); + } + Decls.push_back(E); + return true; } -const ConfusableIdentifierCheck::ContextInfo * -ConfusableIdentifierCheck::getContextInfo(const DeclContext *DC) { - const DeclContext *PrimaryContext = DC->getPrimaryContext(); - auto [It, Inserted] = ContextInfos.try_emplace(PrimaryContext); - if (!Inserted) - return &It->second; - - ContextInfo &Info = It->second; - Info.PrimaryContext = PrimaryContext; - Info.NonTransparentContext = PrimaryContext; +static void addToEnclosingContexts(DeclsWithinContextMap &DeclsWithinContext, + const Decl *Parent, const NamedDecl *ND) { + const Decl *Outer = Parent; + while (Outer) { + if (const auto *NS = dyn_cast(Outer)) + Outer = NS->getCanonicalDecl(); + + if (!addToContext(DeclsWithinContext, Outer, {ND, Parent, false})) + return; + + if (const auto *RD = dyn_cast(Outer)) { + RD = RD->getDefinition(); + if (RD) { + RD->forallBases([&](const CXXRecordDecl *Base) { + addToContext(DeclsWithinContext, Base, {ND, Parent, true}); + return true; + }); + } + } - while (Info.NonTransparentContext->isTransparentContext()) { - Info.NonTransparentContext = Info.NonTransparentContext->getParent(); - if (!Info.NonTransparentContext) + auto *OuterDC = Outer->getDeclContext(); + if (!OuterDC) break; + Outer = cast_or_null(OuterDC->getNonTransparentContext()); } +} + +void ConfusableIdentifierCheck::check( + const ast_matchers::MatchFinder::MatchResult &Result) { + const auto *ND = Result.Nodes.getNodeAs("nameddecl"); + if (!ND) + return; - if (Info.NonTransparentContext) - Info.NonTransparentContext = - Info.NonTransparentContext->getPrimaryContext(); + addDeclToCheck(ND, + cast(ND->getDeclContext()->getNonTransparentContext())); - while (DC) { - if (!isa(DC) && !isa(DC)) - Info.PrimaryContexts.push_back(DC->getPrimaryContext()); - DC = DC->getParent(); + // Associate template parameters with this declaration of this template. + if (const auto *TD = dyn_cast(ND)) { + for (const NamedDecl *Param : *TD->getTemplateParameters()) + addDeclToCheck(Param, TD->getTemplatedDecl()); } - if (const auto *RD = dyn_cast(PrimaryContext)) { - RD = RD->getDefinition(); - if (RD) { - Info.Bases.push_back(RD); - RD->forallBases([&](const CXXRecordDecl *Base) { - Info.Bases.push_back(Base); - return false; - }); - } + // Associate function parameters with this declaration of this function. + if (const auto *FD = dyn_cast(ND)) { + for (const NamedDecl *Param : FD->parameters()) + addDeclToCheck(Param, ND); } - - return &Info; } -void ConfusableIdentifierCheck::check( - const ast_matchers::MatchFinder::MatchResult &Result) { - const auto *ND = Result.Nodes.getNodeAs("nameddecl"); - if (!ND) +void ConfusableIdentifierCheck::addDeclToCheck(const NamedDecl *ND, + const Decl *Parent) { + if (!ND || !Parent) return; - IdentifierInfo *NDII = ND->getIdentifier(); + const IdentifierInfo *NDII = ND->getIdentifier(); if (!NDII) return; @@ -188,34 +187,78 @@ void ConfusableIdentifierCheck::check( if (NDName.empty()) return; - const ContextInfo *Info = getContextInfo(ND->getDeclContext()); + NameToDecls[NDII].push_back({ND, Parent}); +} + +void ConfusableIdentifierCheck::onEndOfTranslationUnit() { + llvm::StringMap> SkeletonToNames; + // Compute the skeleton for each identifier. + for (auto &[Ident, Decls] : NameToDecls) { + SkeletonToNames[skeleton(Ident->getName())].push_back(Ident); + } - llvm::SmallVector &Mapped = Mapper[skeleton(NDName)]; - for (const Entry &E : Mapped) { - if (!mayShadow(ND, Info, E.Declaration, E.Info)) + // Visit each skeleton with more than one identifier. + for (auto &[Skel, Idents] : SkeletonToNames) { + if (Idents.size() < 2) { continue; + } - const IdentifierInfo *ONDII = E.Declaration->getIdentifier(); - StringRef ONDName = ONDII->getName(); - if (ONDName == NDName) - continue; + // Find the declaration contexts that transitively contain each identifier. + DeclsWithinContextMap DeclsWithinContext; + for (const IdentifierInfo *II : Idents) { + for (auto [ND, Parent] : NameToDecls[II]) { + addToEnclosingContexts(DeclsWithinContext, Parent, ND); + } + } - diag(ND->getLocation(), "%0 is confusable with %1") << ND << E.Declaration; - diag(E.Declaration->getLocation(), "other declaration found here", - DiagnosticIDs::Note); + // Check to see if any declaration is declared in a context that + // transitively contains another declaration with a different identifier but + // the same skeleton. + for (const IdentifierInfo *II : Idents) { + for (auto [OuterND, OuterParent] : NameToDecls[II]) { + for (Entry Inner : DeclsWithinContext[OuterParent]) { + // Don't complain if the identifiers are the same. + if (OuterND->getIdentifier() == Inner.ND->getIdentifier()) + continue; + + // Don't complain about a derived-class name shadowing a base class + // private member. + if (OuterND->getAccess() == AS_private && Inner.FromDerivedClass) + continue; + + // If the declarations are in the same context, only diagnose the + // later one. + if (OuterParent == Inner.Parent && + Inner.ND->getASTContext() + .getSourceManager() + .isBeforeInTranslationUnit(Inner.ND->getLocation(), + OuterND->getLocation())) + continue; + + diag(Inner.ND->getLocation(), "%0 is confusable with %1") + << Inner.ND << OuterND; + diag(OuterND->getLocation(), "other declaration found here", + DiagnosticIDs::Note); + } + } + } } - Mapped.push_back({ND, Info}); -} - -void ConfusableIdentifierCheck::onEndOfTranslationUnit() { - Mapper.clear(); - ContextInfos.clear(); + NameToDecls.clear(); } void ConfusableIdentifierCheck::registerMatchers( ast_matchers::MatchFinder *Finder) { - Finder->addMatcher(ast_matchers::namedDecl().bind("nameddecl"), this); + // Parameter declarations sometimes use the translation unit or some outer + // enclosing context as their `DeclContext`, instead of their parent, so + // we handle them specially in `check`. + auto AnyParamDecl = ast_matchers::anyOf( + ast_matchers::parmVarDecl(), ast_matchers::templateTypeParmDecl(), + ast_matchers::nonTypeTemplateParmDecl(), + ast_matchers::templateTemplateParmDecl()); + Finder->addMatcher(ast_matchers::namedDecl(ast_matchers::unless(AnyParamDecl)) + .bind("nameddecl"), + this); } } // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.h b/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.h index f3b0c8ed0030..9cce6cce6768 100644 --- a/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.h +++ b/clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.h @@ -1,5 +1,4 @@ -//===--- ConfusableIdentifierCheck.h - clang-tidy -//-------------------------------*- C++ -*-===// +//===--- ConfusableIdentifierCheck.h - clang-tidy ---------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -11,7 +10,7 @@ #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_CONFUSABLE_IDENTIFIER_CHECK_H #include "../ClangTidyCheck.h" -#include +#include "llvm/ADT/DenseMap.h" namespace clang::tidy::misc { @@ -31,23 +30,13 @@ class ConfusableIdentifierCheck : public ClangTidyCheck { return TK_IgnoreUnlessSpelledInSource; } - struct ContextInfo { - const DeclContext *PrimaryContext; - const DeclContext *NonTransparentContext; - llvm::SmallVector PrimaryContexts; - llvm::SmallVector Bases; - }; - private: - struct Entry { - const NamedDecl *Declaration; - const ContextInfo *Info; - }; - - const ContextInfo *getContextInfo(const DeclContext *DC); + void addDeclToCheck(const NamedDecl *ND, const Decl *Parent); - llvm::StringMap> Mapper; - std::unordered_map ContextInfos; + llvm::DenseMap< + const IdentifierInfo *, + llvm::SmallVector, 1>> + NameToDecls; }; } // namespace clang::tidy::misc diff --git a/clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp b/clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp index afc4897eeb2a..3fdaf9239f6a 100644 --- a/clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp @@ -66,8 +66,11 @@ void UnconventionalAssignOperatorCheck::registerMatchers( hasArgument(0, cxxThisExpr())), cxxOperatorCallExpr( hasOverloadedOperatorName("="), - hasArgument( - 0, unaryOperator(hasOperatorName("*"), + hasArgument(0, unaryOperator(hasOperatorName("*"), + hasUnaryOperand(cxxThisExpr())))), + binaryOperator( + hasOperatorName("="), + hasLHS(unaryOperator(hasOperatorName("*"), hasUnaryOperand(cxxThisExpr()))))))))); const auto IsGoodAssign = cxxMethodDecl(IsAssign, HasGoodReturnType); diff --git a/clang-tools-extra/clang-tidy/modernize/CMakeLists.txt b/clang-tools-extra/clang-tidy/modernize/CMakeLists.txt index bab1167fb15f..619a27b2f9bb 100644 --- a/clang-tools-extra/clang-tidy/modernize/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/modernize/CMakeLists.txt @@ -42,6 +42,7 @@ add_clang_library(clangTidyModernizeModule STATIC UseNullptrCheck.cpp UseOverrideCheck.cpp UseRangesCheck.cpp + UseScopedLockCheck.cpp UseStartsEndsWithCheck.cpp UseStdFormatCheck.cpp UseStdNumbersCheck.cpp diff --git a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp index 0cf59b6e0216..fdf38bc4b630 100644 --- a/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp +++ b/clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp @@ -43,6 +43,7 @@ #include "UseNullptrCheck.h" #include "UseOverrideCheck.h" #include "UseRangesCheck.h" +#include "UseScopedLockCheck.h" #include "UseStartsEndsWithCheck.h" #include "UseStdFormatCheck.h" #include "UseStdNumbersCheck.h" @@ -80,6 +81,8 @@ class ModernizeModule : public ClangTidyModule { CheckFactories.registerCheck( "modernize-use-integer-sign-comparison"); CheckFactories.registerCheck("modernize-use-ranges"); + CheckFactories.registerCheck( + "modernize-use-scoped-lock"); CheckFactories.registerCheck( "modernize-use-starts-ends-with"); CheckFactories.registerCheck("modernize-use-std-format"); diff --git a/clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.cpp new file mode 100644 index 000000000000..9c2fc9e06fb4 --- /dev/null +++ b/clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.cpp @@ -0,0 +1,311 @@ +//===--- UseScopedLockCheck.cpp - clang-tidy ------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "UseScopedLockCheck.h" +#include "clang/AST/ASTContext.h" +#include "clang/AST/Decl.h" +#include "clang/AST/Stmt.h" +#include "clang/AST/Type.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Basic/SourceLocation.h" +#include "clang/Lex/Lexer.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/Twine.h" + +using namespace clang::ast_matchers; + +namespace clang::tidy::modernize { + +static bool isLockGuardDecl(const NamedDecl *Decl) { + return Decl->getDeclName().isIdentifier() && + Decl->getName() == "lock_guard" && Decl->isInStdNamespace(); +} + +static bool isLockGuard(const QualType &Type) { + if (const auto *Record = Type->getAs()) + if (const RecordDecl *Decl = Record->getDecl()) + return isLockGuardDecl(Decl); + + if (const auto *TemplateSpecType = Type->getAs()) + if (const TemplateDecl *Decl = + TemplateSpecType->getTemplateName().getAsTemplateDecl()) + return isLockGuardDecl(Decl); + + return false; +} + +static llvm::SmallVector +getLockGuardsFromDecl(const DeclStmt *DS) { + llvm::SmallVector LockGuards; + + for (const Decl *Decl : DS->decls()) { + if (const auto *VD = dyn_cast(Decl)) { + const QualType Type = + VD->getType().getCanonicalType().getUnqualifiedType(); + if (isLockGuard(Type)) + LockGuards.push_back(VD); + } + } + + return LockGuards; +} + +// Scans through the statements in a block and groups consecutive +// 'std::lock_guard' variable declarations together. +static llvm::SmallVector> +findLocksInCompoundStmt(const CompoundStmt *Block, + const ast_matchers::MatchFinder::MatchResult &Result) { + // store groups of consecutive 'std::lock_guard' declarations + llvm::SmallVector> LockGuardGroups; + llvm::SmallVector CurrentLockGuardGroup; + + auto AddAndClearCurrentGroup = [&]() { + if (!CurrentLockGuardGroup.empty()) { + LockGuardGroups.push_back(CurrentLockGuardGroup); + CurrentLockGuardGroup.clear(); + } + }; + + for (const Stmt *Stmt : Block->body()) { + if (const auto *DS = dyn_cast(Stmt)) { + llvm::SmallVector LockGuards = getLockGuardsFromDecl(DS); + + if (!LockGuards.empty()) { + CurrentLockGuardGroup.append(LockGuards); + continue; + } + } + AddAndClearCurrentGroup(); + } + + AddAndClearCurrentGroup(); + + return LockGuardGroups; +} + +static TemplateSpecializationTypeLoc +getTemplateLockGuardTypeLoc(const TypeSourceInfo *SourceInfo) { + const TypeLoc Loc = SourceInfo->getTypeLoc(); + + const auto ElaboratedLoc = Loc.getAs(); + if (!ElaboratedLoc) + return {}; + + return ElaboratedLoc.getNamedTypeLoc().getAs(); +} + +// Find the exact source range of the 'lock_guard' token +static SourceRange getLockGuardRange(const TypeSourceInfo *SourceInfo) { + const TypeLoc LockGuardTypeLoc = SourceInfo->getTypeLoc(); + + return SourceRange(LockGuardTypeLoc.getBeginLoc(), + LockGuardTypeLoc.getEndLoc()); +} + +// Find the exact source range of the 'lock_guard' name token +static SourceRange getLockGuardNameRange(const TypeSourceInfo *SourceInfo) { + const TemplateSpecializationTypeLoc TemplateLoc = + getTemplateLockGuardTypeLoc(SourceInfo); + if (!TemplateLoc) + return {}; + + return SourceRange(TemplateLoc.getTemplateNameLoc(), + TemplateLoc.getLAngleLoc().getLocWithOffset(-1)); +} + +const static StringRef UseScopedLockMessage = + "use 'std::scoped_lock' instead of 'std::lock_guard'"; + +UseScopedLockCheck::UseScopedLockCheck(StringRef Name, + ClangTidyContext *Context) + : ClangTidyCheck(Name, Context), + WarnOnSingleLocks(Options.get("WarnOnSingleLocks", true)), + WarnOnUsingAndTypedef(Options.get("WarnOnUsingAndTypedef", true)) {} + +void UseScopedLockCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { + Options.store(Opts, "WarnOnSingleLocks", WarnOnSingleLocks); + Options.store(Opts, "WarnOnUsingAndTypedef", WarnOnUsingAndTypedef); +} + +void UseScopedLockCheck::registerMatchers(MatchFinder *Finder) { + const auto LockGuardClassDecl = + namedDecl(hasName("lock_guard"), isInStdNamespace()); + + const auto LockGuardType = qualType(anyOf( + hasUnqualifiedDesugaredType( + recordType(hasDeclaration(LockGuardClassDecl))), + elaboratedType(namesType(hasUnqualifiedDesugaredType( + templateSpecializationType(hasDeclaration(LockGuardClassDecl))))))); + + const auto LockVarDecl = varDecl(hasType(LockGuardType)); + + if (WarnOnSingleLocks) { + Finder->addMatcher( + compoundStmt( + unless(isExpansionInSystemHeader()), + has(declStmt(has(LockVarDecl)).bind("lock-decl-single")), + unless(has(declStmt(unless(equalsBoundNode("lock-decl-single")), + has(LockVarDecl))))), + this); + } + + Finder->addMatcher( + compoundStmt(unless(isExpansionInSystemHeader()), + has(declStmt(has(LockVarDecl)).bind("lock-decl-multiple")), + has(declStmt(unless(equalsBoundNode("lock-decl-multiple")), + has(LockVarDecl)))) + .bind("block-multiple"), + this); + + if (WarnOnUsingAndTypedef) { + // Match 'typedef std::lock_guard Lock' + Finder->addMatcher(typedefDecl(unless(isExpansionInSystemHeader()), + hasUnderlyingType(LockGuardType)) + .bind("lock-guard-typedef"), + this); + + // Match 'using Lock = std::lock_guard' + Finder->addMatcher( + typeAliasDecl( + unless(isExpansionInSystemHeader()), + hasType(elaboratedType(namesType(templateSpecializationType( + hasDeclaration(LockGuardClassDecl)))))) + .bind("lock-guard-using-alias"), + this); + + // Match 'using std::lock_guard' + Finder->addMatcher( + usingDecl(unless(isExpansionInSystemHeader()), + hasAnyUsingShadowDecl(hasTargetDecl(LockGuardClassDecl))) + .bind("lock-guard-using-decl"), + this); + } +} + +void UseScopedLockCheck::check(const MatchFinder::MatchResult &Result) { + if (const auto *DS = Result.Nodes.getNodeAs("lock-decl-single")) { + llvm::SmallVector Decls = getLockGuardsFromDecl(DS); + diagOnMultipleLocks({Decls}, Result); + return; + } + + if (const auto *Compound = + Result.Nodes.getNodeAs("block-multiple")) { + diagOnMultipleLocks(findLocksInCompoundStmt(Compound, Result), Result); + return; + } + + if (const auto *Typedef = + Result.Nodes.getNodeAs("lock-guard-typedef")) { + diagOnSourceInfo(Typedef->getTypeSourceInfo(), Result); + return; + } + + if (const auto *UsingAlias = + Result.Nodes.getNodeAs("lock-guard-using-alias")) { + diagOnSourceInfo(UsingAlias->getTypeSourceInfo(), Result); + return; + } + + if (const auto *Using = + Result.Nodes.getNodeAs("lock-guard-using-decl")) { + diagOnUsingDecl(Using, Result); + } +} + +void UseScopedLockCheck::diagOnSingleLock( + const VarDecl *LockGuard, const MatchFinder::MatchResult &Result) { + auto Diag = diag(LockGuard->getBeginLoc(), UseScopedLockMessage); + + const SourceRange LockGuardTypeRange = + getLockGuardRange(LockGuard->getTypeSourceInfo()); + + if (LockGuardTypeRange.isInvalid()) + return; + + // Create Fix-its only if we can find the constructor call to properly handle + // 'std::lock_guard l(m, std::adopt_lock)' case. + const auto *CtorCall = dyn_cast(LockGuard->getInit()); + if (!CtorCall) + return; + + if (CtorCall->getNumArgs() == 1) { + Diag << FixItHint::CreateReplacement(LockGuardTypeRange, + "std::scoped_lock"); + return; + } + + if (CtorCall->getNumArgs() == 2) { + const Expr *const *CtorArgs = CtorCall->getArgs(); + + const Expr *MutexArg = CtorArgs[0]; + const Expr *AdoptLockArg = CtorArgs[1]; + + const StringRef MutexSourceText = Lexer::getSourceText( + CharSourceRange::getTokenRange(MutexArg->getSourceRange()), + *Result.SourceManager, Result.Context->getLangOpts()); + const StringRef AdoptLockSourceText = Lexer::getSourceText( + CharSourceRange::getTokenRange(AdoptLockArg->getSourceRange()), + *Result.SourceManager, Result.Context->getLangOpts()); + + Diag << FixItHint::CreateReplacement(LockGuardTypeRange, "std::scoped_lock") + << FixItHint::CreateReplacement( + SourceRange(MutexArg->getBeginLoc(), AdoptLockArg->getEndLoc()), + (llvm::Twine(AdoptLockSourceText) + ", " + MutexSourceText) + .str()); + return; + } + + llvm_unreachable("Invalid argument number of std::lock_guard constructor"); +} + +void UseScopedLockCheck::diagOnMultipleLocks( + const llvm::SmallVector> &LockGroups, + const ast_matchers::MatchFinder::MatchResult &Result) { + for (const llvm::SmallVector &Group : LockGroups) { + if (Group.size() == 1) { + if (WarnOnSingleLocks) + diagOnSingleLock(Group[0], Result); + } else { + diag(Group[0]->getBeginLoc(), + "use single 'std::scoped_lock' instead of multiple " + "'std::lock_guard'"); + + for (const VarDecl *Lock : llvm::drop_begin(Group)) + diag(Lock->getLocation(), "additional 'std::lock_guard' declared here", + DiagnosticIDs::Note); + } + } +} + +void UseScopedLockCheck::diagOnSourceInfo( + const TypeSourceInfo *LockGuardSourceInfo, + const ast_matchers::MatchFinder::MatchResult &Result) { + const TypeLoc TL = LockGuardSourceInfo->getTypeLoc(); + + if (const auto ElaboratedTL = TL.getAs()) { + auto Diag = diag(ElaboratedTL.getBeginLoc(), UseScopedLockMessage); + + const SourceRange LockGuardRange = + getLockGuardNameRange(LockGuardSourceInfo); + if (LockGuardRange.isInvalid()) + return; + + Diag << FixItHint::CreateReplacement(LockGuardRange, "scoped_lock"); + } +} + +void UseScopedLockCheck::diagOnUsingDecl( + const UsingDecl *UsingDecl, + const ast_matchers::MatchFinder::MatchResult &Result) { + diag(UsingDecl->getLocation(), UseScopedLockMessage) + << FixItHint::CreateReplacement(UsingDecl->getLocation(), "scoped_lock"); +} + +} // namespace clang::tidy::modernize diff --git a/clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.h b/clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.h new file mode 100644 index 000000000000..a5697805c15c --- /dev/null +++ b/clang-tools-extra/clang-tidy/modernize/UseScopedLockCheck.h @@ -0,0 +1,54 @@ +//===--- UseScopedLockCheck.h - clang-tidy ----------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USESCOPEDLOCKCHECK_H +#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USESCOPEDLOCKCHECK_H + +#include "../ClangTidyCheck.h" +#include "clang/AST/ASTTypeTraits.h" +#include "clang/AST/Stmt.h" +#include + +namespace clang::tidy::modernize { + +/// Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's +/// alternative ``std::scoped_lock``. +/// +/// For the user-facing documentation see: +/// http://clang.llvm.org/extra/clang-tidy/checks/modernize/use-scoped-lock.html +class UseScopedLockCheck : public ClangTidyCheck { +public: + UseScopedLockCheck(StringRef Name, ClangTidyContext *Context); + void registerMatchers(ast_matchers::MatchFinder *Finder) override; + void storeOptions(ClangTidyOptions::OptionMap &Opts) override; + void check(const ast_matchers::MatchFinder::MatchResult &Result) override; + bool isLanguageVersionSupported(const LangOptions &LangOpts) const override { + return LangOpts.CPlusPlus17; + } + std::optional getCheckTraversalKind() const override { + return TK_IgnoreUnlessSpelledInSource; + } + +private: + void diagOnSingleLock(const VarDecl *LockGuard, + const ast_matchers::MatchFinder::MatchResult &Result); + void diagOnMultipleLocks( + const llvm::SmallVector> &LockGroups, + const ast_matchers::MatchFinder::MatchResult &Result); + void diagOnSourceInfo(const TypeSourceInfo *LockGuardSourceInfo, + const ast_matchers::MatchFinder::MatchResult &Result); + void diagOnUsingDecl(const UsingDecl *UsingDecl, + const ast_matchers::MatchFinder::MatchResult &Result); + + const bool WarnOnSingleLocks; + const bool WarnOnUsingAndTypedef; +}; + +} // namespace clang::tidy::modernize + +#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MODERNIZE_USESCOPEDLOCKCHECK_H diff --git a/clang-tools-extra/clang-tidy/readability/RedundantInlineSpecifierCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantInlineSpecifierCheck.cpp index 969bf2d1add6..7f1882c775c5 100644 --- a/clang-tools-extra/clang-tidy/readability/RedundantInlineSpecifierCheck.cpp +++ b/clang-tools-extra/clang-tidy/readability/RedundantInlineSpecifierCheck.cpp @@ -72,11 +72,13 @@ static SourceLocation getInlineTokenLocation(SourceRange RangeLocation, } void RedundantInlineSpecifierCheck::registerMatchers(MatchFinder *Finder) { + const auto IsPartOfRecordDecl = hasAncestor(recordDecl()); Finder->addMatcher( functionDecl(isInlineSpecified(), - anyOf(isConstexpr(), isDeleted(), isDefaulted(), + anyOf(isConstexpr(), isDeleted(), + allOf(isDefaulted(), IsPartOfRecordDecl), isInternalLinkage(StrictMode), - allOf(isDefinition(), hasAncestor(recordDecl())))) + allOf(isDefinition(), IsPartOfRecordDecl))) .bind("fun_decl"), this); @@ -88,7 +90,6 @@ void RedundantInlineSpecifierCheck::registerMatchers(MatchFinder *Finder) { this); if (getLangOpts().CPlusPlus17) { - const auto IsPartOfRecordDecl = hasAncestor(recordDecl()); Finder->addMatcher( varDecl( isInlineSpecified(), diff --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp index 3b991e5e9013..e27423652781 100644 --- a/clang-tools-extra/clangd/AST.cpp +++ b/clang-tools-extra/clangd/AST.cpp @@ -440,7 +440,7 @@ QualType declaredType(const TypeDecl *D) { if (const auto *Args = CTSD->getTemplateArgsAsWritten()) return Context.getTemplateSpecializationType( TemplateName(CTSD->getSpecializedTemplate()), Args->arguments(), - /*CanonicalArgs=*/std::nullopt); + /*CanonicalArgs=*/{}); return Context.getTypeDeclType(D); } diff --git a/clang-tools-extra/clangd/InlayHints.cpp b/clang-tools-extra/clangd/InlayHints.cpp index 20a238612a7e..197c62c40dcf 100644 --- a/clang-tools-extra/clangd/InlayHints.cpp +++ b/clang-tools-extra/clangd/InlayHints.cpp @@ -33,7 +33,6 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" -#include "llvm/ADT/identity.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormatVariadic.h" @@ -339,53 +338,6 @@ QualType maybeDesugar(ASTContext &AST, QualType QT) { return QT; } -// Given a callee expression `Fn`, if the call is through a function pointer, -// try to find the declaration of the corresponding function pointer type, -// so that we can recover argument names from it. -// FIXME: This function is mostly duplicated in SemaCodeComplete.cpp; unify. -static FunctionProtoTypeLoc getPrototypeLoc(Expr *Fn) { - TypeLoc Target; - Expr *NakedFn = Fn->IgnoreParenCasts(); - if (const auto *T = NakedFn->getType().getTypePtr()->getAs()) { - Target = T->getDecl()->getTypeSourceInfo()->getTypeLoc(); - } else if (const auto *DR = dyn_cast(NakedFn)) { - const auto *D = DR->getDecl(); - if (const auto *const VD = dyn_cast(D)) { - Target = VD->getTypeSourceInfo()->getTypeLoc(); - } - } - - if (!Target) - return {}; - - // Unwrap types that may be wrapping the function type - while (true) { - if (auto P = Target.getAs()) { - Target = P.getPointeeLoc(); - continue; - } - if (auto A = Target.getAs()) { - Target = A.getModifiedLoc(); - continue; - } - if (auto P = Target.getAs()) { - Target = P.getInnerLoc(); - continue; - } - break; - } - - if (auto F = Target.getAs()) { - // In some edge cases the AST can contain a "trivial" FunctionProtoTypeLoc - // which has null parameters. Avoid these as they don't contain useful - // information. - if (llvm::all_of(F.getParams(), llvm::identity())) - return F; - } - - return {}; -} - ArrayRef maybeDropCxxExplicitObjectParameters(ArrayRef Params) { if (!Params.empty() && Params.front()->isExplicitObjectParameter()) @@ -514,7 +466,8 @@ class InlayHintVisitor : public RecursiveASTVisitor { Callee.Decl = FD; else if (const auto *FTD = dyn_cast(CalleeDecls[0])) Callee.Decl = FTD->getTemplatedDecl(); - else if (FunctionProtoTypeLoc Loc = getPrototypeLoc(E->getCallee())) + else if (FunctionProtoTypeLoc Loc = + Resolver->getFunctionProtoTypeLoc(E->getCallee())) Callee.Loc = Loc; else return true; diff --git a/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp b/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp index d6556bba1472..c9704492bf1c 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp @@ -341,7 +341,7 @@ const FunctionDecl *findTarget(const FunctionDecl *FD) { // Returns the beginning location for a FunctionDecl. Returns location of // template keyword for templated functions. -const SourceLocation getBeginLoc(const FunctionDecl *FD) { +SourceLocation getBeginLoc(const FunctionDecl *FD) { // Include template parameter list. if (auto *FTD = FD->getDescribedFunctionTemplate()) return FTD->getBeginLoc(); diff --git a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp index 90dac3b76c64..c74250ccbe9e 100644 --- a/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp +++ b/clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp @@ -359,9 +359,9 @@ struct ParsedBinaryOperator { // + c <- End // / \ // a b <- Start -const SourceRange getBinaryOperatorRange(const SelectionTree::Node &N, - const SourceManager &SM, - const LangOptions &LangOpts) { +SourceRange getBinaryOperatorRange(const SelectionTree::Node &N, + const SourceManager &SM, + const LangOptions &LangOpts) { // If N is not a suitable binary operator, bail out. ParsedBinaryOperator Op; if (!Op.parse(N.ignoreImplicit()) || !Op.associative() || diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp index b11d194da04d..f287439f10ca 100644 --- a/clang-tools-extra/clangd/tool/ClangdMain.cpp +++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp @@ -668,7 +668,6 @@ class FlagsConfigProvider : public config::Provider { std::optional IndexSpec; std::optional BGPolicy; std::optional ArgumentLists; - std::optional HeaderInsertionPolicy; // If --compile-commands-dir arg was invoked, check value and override // default path. @@ -713,11 +712,6 @@ class FlagsConfigProvider : public config::Provider { BGPolicy = Config::BackgroundPolicy::Skip; } - // If CLI has set never, use that regardless of what the config files have - if (HeaderInsertion == Config::HeaderInsertionPolicy::NeverInsert) { - HeaderInsertionPolicy = Config::HeaderInsertionPolicy::NeverInsert; - } - if (std::optional Enable = shouldEnableFunctionArgSnippets()) { ArgumentLists = *Enable ? Config::ArgumentListsPolicy::FullPlaceholders : Config::ArgumentListsPolicy::Delimiters; @@ -732,8 +726,8 @@ class FlagsConfigProvider : public config::Provider { C.Index.Background = *BGPolicy; if (ArgumentLists) C.Completion.ArgumentLists = *ArgumentLists; - if (HeaderInsertionPolicy) - C.Completion.HeaderInsertion = *HeaderInsertionPolicy; + if (HeaderInsertion.getNumOccurrences()) + C.Completion.HeaderInsertion = HeaderInsertion; if (AllScopesCompletion.getNumOccurrences()) C.Completion.AllScopes = AllScopesCompletion; diff --git a/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp b/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp index 311f0d98904a..b7c64c7a0674 100644 --- a/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp +++ b/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp @@ -4363,6 +4363,36 @@ TEST(CompletionTest, PreambleFromDifferentTarget) { EXPECT_THAT(Result.Completions, Not(testing::IsEmpty())); EXPECT_THAT(Signatures.signatures, Not(testing::IsEmpty())); } + +TEST(CompletionTest, SkipExplicitObjectParameter) { + Annotations Code(R"cpp( + struct A { + void foo(this auto&& self, int arg); + }; + + int main() { + A a {}; + a.^ + } + )cpp"); + + auto TU = TestTU::withCode(Code.code()); + TU.ExtraArgs = {"-std=c++23"}; + + auto Preamble = TU.preamble(); + ASSERT_TRUE(Preamble); + + CodeCompleteOptions Opts{}; + + MockFS FS; + auto Inputs = TU.inputs(FS); + auto Result = codeComplete(testPath(TU.Filename), Code.point(), + Preamble.get(), Inputs, Opts); + + EXPECT_THAT(Result.Completions, + ElementsAre(AllOf(named("foo"), signature("(int arg)"), + snippetSuffix("(${1:int arg})")))); +} } // namespace } // namespace clangd } // namespace clang diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index fc51f3c9329a..e021d6350694 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -142,6 +142,12 @@ New checks Finds unscoped (non-class) ``enum`` declarations and suggests using ``enum class`` instead. +- New :doc:`modernize-use-scoped-lock + ` check. + + Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's + alternative ``std::scoped_lock``. + - New :doc:`portability-avoid-pragma-once ` check. @@ -173,6 +179,11 @@ Changes in existing checks ` check to detect conversion in argument of ``std::make_optional``. +- Improved :doc: `bugprone-sizeof-expression + ` check by adding + `WarnOnSizeOfInLoopTermination` option to detect misuses of ``sizeof`` + expression in loop conditions. + - Improved :doc:`bugprone-string-constructor ` check to find suspicious calls of ``std::string`` constructor with char pointer, start position and @@ -201,6 +212,21 @@ Changes in existing checks ` check by adding the option `IgnoreMacros` to ignore ``goto`` labels defined in macros. +- Improved :doc:`cppcoreguidelines-missing-std-forward + ` check by adding a + flag to specify the function used for forwarding instead of ``std::forward``. + +- Improved :doc:`cppcoreguidelines-pro-bounds-pointer-arithmetic + ` check by + fixing false positives when calling indexing operators that do not perform + pointer arithmetic in template, for example ``std::map::operator[]`` and + when pointer arithmetic was used through type aliases. + +- Improved :doc:`cppcoreguidelines-rvalue-reference-param-not-moved + ` check + by adding a flag to specify the function used for moving instead of + ``std::move``. + - Improved :doc:`cppcoreguidelines-special-member-functions ` check by adding the option `IgnoreMacros` to ignore classes defined in macros. @@ -240,6 +266,11 @@ Changes in existing checks ` check by providing additional examples and fixing some macro related false positives. +- Improved :doc:`misc-unconventional-assign-operator + ` check by fixing + false positives when copy assignment operator function in a template class + returns the result of another assignment to ``*this`` (``return *this=...``). + - Improved :doc:`misc-unused-using-decls ` check by fixing false positives on ``operator""`` with template parameters. @@ -308,6 +339,10 @@ Changes in existing checks ` check by adding the option `AllowedTypes`, that excludes specified types from adding qualifiers. +- Improved :doc:`readability-redundant-inline-specifier + ` check by fixing + false positives on out-of-line explicitly defaulted functions. + - Improved :doc:`readability-redundant-smartptr-get ` check by fixing some false positives involving smart pointers to arrays. diff --git a/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst b/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst index 29edb26ed7aa..04824cc1fe0e 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/bugprone/sizeof-expression.rst @@ -316,3 +316,12 @@ Options When `true`, the check will warn on pointer arithmetic where the element count is obtained from a division with ``sizeof(...)``, e.g., ``Ptr + Bytes / sizeof(*T)``. Default is `true`. + +.. option:: WarnOnSizeOfInLoopTermination + + When `true`, the check will warn about incorrect use of sizeof expression + in loop termination condition. The warning triggers if the ``sizeof`` + expression appears to be incorrectly used to determine the number of + array/buffer elements. + e.g, ``long arr[10]; for(int i = 0; i < sizeof(arr); i++) { ... }``. Default + is `true`. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/missing-std-forward.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/missing-std-forward.rst index 0c311b59a5d5..62e38fcd3b9d 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/missing-std-forward.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/missing-std-forward.rst @@ -35,6 +35,13 @@ Example: f(1, 2); // Incorrect - may not invoke the desired qualified function operator } +Options +------- + +.. option:: ForwardFunction + + Specify the function used for forwarding. Default is `::std::forward`. + This check implements `F.19 `_ from the C++ Core Guidelines. diff --git a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/rvalue-reference-param-not-moved.rst b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/rvalue-reference-param-not-moved.rst index ffa3a9d61e48..2fea9f16b3bb 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/rvalue-reference-param-not-moved.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines/rvalue-reference-param-not-moved.rst @@ -79,6 +79,10 @@ Options T other = std::forward(t); } +.. option:: MoveFunction + + Specify the function used for moving. Default is `::std::move`. + This check implements `F.18 `_ from the C++ Core Guidelines. diff --git a/clang-tools-extra/docs/clang-tidy/checks/list.rst b/clang-tools-extra/docs/clang-tidy/checks/list.rst index ccb78ee45e9c..5098582d0c42 100644 --- a/clang-tools-extra/docs/clang-tidy/checks/list.rst +++ b/clang-tools-extra/docs/clang-tidy/checks/list.rst @@ -312,6 +312,7 @@ Clang-Tidy Checks :doc:`modernize-use-nullptr `, "Yes" :doc:`modernize-use-override `, "Yes" :doc:`modernize-use-ranges `, "Yes" + :doc:`modernize-use-scoped-lock `, "Yes" :doc:`modernize-use-starts-ends-with `, "Yes" :doc:`modernize-use-std-format `, "Yes" :doc:`modernize-use-std-numbers `, "Yes" diff --git a/clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst new file mode 100644 index 000000000000..d184f1aefd80 --- /dev/null +++ b/clang-tools-extra/docs/clang-tidy/checks/modernize/use-scoped-lock.rst @@ -0,0 +1,101 @@ +.. title:: clang-tidy - modernize-use-scoped-lock + +modernize-use-scoped-lock +========================= + +Finds uses of ``std::lock_guard`` and suggests replacing them with C++17's +alternative ``std::scoped_lock``. + +Fix-its are provided for single declarations of ``std::lock_guard`` and warning +is emitted for multiple declarations of ``std::lock_guard`` that can be +replaced with a single declaration of ``std::scoped_lock``. + +Examples +-------- + +Single ``std::lock_guard`` declaration: + +.. code-block:: c++ + + std::mutex M; + std::lock_guard L(M); + + +Transforms to: + +.. code-block:: c++ + + std::mutex M; + std::scoped_lock L(M); + +Single ``std::lock_guard`` declaration with ``std::adopt_lock``: + +.. code-block:: c++ + + std::mutex M; + std::lock(M); + std::lock_guard L(M, std::adopt_lock); + + +Transforms to: + +.. code-block:: c++ + + std::mutex M; + std::lock(M); + std::scoped_lock L(std::adopt_lock, M); + +Multiple ``std::lock_guard`` declarations only emit warnings: + +.. code-block:: c++ + + std::mutex M1, M2; + std::lock(M1, M2); + std::lock_guard Lock1(M, std::adopt_lock); // warning: use single 'std::scoped_lock' instead of multiple 'std::lock_guard' + std::lock_guard Lock2(M, std::adopt_lock); // note: additional 'std::lock_guard' declared here + + +Limitations +----------- + +The check will not emit warnings if ``std::lock_guard`` is used implicitly via +``template`` parameter: + +.. code-block:: c++ + + template