LLVM/project 91ccd1bclang/lib/CodeGen ItaniumCXXABI.cpp, clang/test/CodeGenCXX dynamic-cast-exact-address-space.cpp

[Clang] Make exact dynamic_cast optimization AS aware (#213927)

PR https://github.com/llvm/llvm-project/pull/213253 exposed a problem in
AMDGPU where exact dynamic_cast optimization would generate compare
operands for the compare instruction that live in different address
spaces.
The culprit appears to have been the introduction of the `final` keyword
in the derived struct definition.

This patch uses CGF.GetVTablePtr and uses CGM.GlobalsInt8PtrTy in the
code for emitExactDynamicCast, following the pattern that is used in
EmitTypeid.

A test case that was reduced from the above PR is added as test.
AI-assisted
DeltaFile
+26-0clang/test/CodeGenCXX/dynamic-cast-exact-address-space.cpp
+2-2clang/lib/CodeGen/ItaniumCXXABI.cpp
+28-22 files

LLVM/project 3217105llvm/lib/Target/AMDGPU AMDGPUReserveWWMRegs.cpp SILowerSGPRSpills.cpp

[NFC][AMDGPU] Rename some variable names to follow convention better (#213827)

This is a follow-up of #213491.
DeltaFile
+5-5llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+5-5llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
+4-5llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
+2-2llvm/lib/Target/AMDGPU/AMDGPUReserveWWMRegs.cpp
+16-174 files

LLVM/project 0eefd51llvm/lib/Target/AMDGPU SIISelLowering.h SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU bf16.ll fcanonicalize-elimination.bf16.ll

[AMDGPU] Canonicalize scalar bf16 more efficiently (#213789)

Canonicalize bf16 more efficiently. Use `v_pk_mul_vf16 <DST>, 1.0, ...`
rather than converting to/from f32 and using v_max.

---------

Signed-off-by: John Lu <John.Lu at amd.com>
DeltaFile
+81-198llvm/test/CodeGen/AMDGPU/fcanonicalize.bf16.ll
+25-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+4-10llvm/test/CodeGen/AMDGPU/fcanonicalize-elimination.bf16.ll
+1-4llvm/test/CodeGen/AMDGPU/bf16.ll
+1-0llvm/lib/Target/AMDGPU/SIISelLowering.h
+112-2135 files

LLVM/project 17d308ellvm/lib/Target/AMDGPU SIInstructions.td SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-basic.ll

Declare M0 on the VGPR-memory pseudos only where the expansion writes it
DeltaFile
+39-28llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+23-0llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-basic.ll
+7-9llvm/lib/Target/AMDGPU/SIInstructions.td
+69-373 files

LLVM/project 50f1e69llvm/lib/Target/AArch64 AArch64CondBrTuning.cpp, llvm/test/CodeGen/AArch64 cmp-frameindex.ll large-stack-cmp.ll

[AArch64][CodeGen] Don't try to compute stack addresses in xzr (#213009)

Conditional branch tuning can replace an ADD + CBZ with an ADDS + Bcc.
This patch disables that transformation in the case where the ADD
instruction has a frame offset operand, because in that situation, it
can later be expanded into multiple instructions.

Fixes #212528, which had a case of this in which the destination
register of the ADDS was rewritten to XZR, because the value was
calculated _only_ to compare against zero. When the ADDS was expanded
into multiple instructions, the output instructions were not even
legal with XZR as the destination.

However we disable this transformation even when not rewriting the
destination register, because some of the instructions involved in
computing a frame offset have no flag-setting variant. (E.g. ADDVL, if
there are SVE variable-sized vectors on the stack.)
DeltaFile
+153-0llvm/test/CodeGen/AArch64/condbr-stack-slot-flag-setting.mir
+21-7llvm/lib/Target/AArch64/AArch64CondBrTuning.cpp
+3-3llvm/test/CodeGen/AArch64/large-stack-cmp.ll
+2-2llvm/test/CodeGen/AArch64/cmp-frameindex.ll
+179-124 files

LLVM/project 62c5edellvm/include/llvm/IR BasicBlock.h, llvm/lib/IR BasicBlock.cpp

[IR] Remove deprecated BasicBlock::getFirstNonPHI (#213926)

All in-tree callers already migrated to getFirstNonPHIIt(), which
preserves debug-info placement. No remaining users of the deprecated
overloads exist in the codebase.

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+0-15llvm/include/llvm/IR/BasicBlock.h
+0-14llvm/lib/IR/BasicBlock.cpp
+0-292 files

LLVM/project 962d16flibc/src/__support/CPP simd.h, libc/src/__support/mathvec CMakeLists.txt expf.h

[libc][mathvec] Vectorise exp2f and exp10f (#211365)

Replaces exp2f and exp10f with fully vectorised implementations.

Includes refactoring of expf polynomial evalulation into expf_utils.h
DeltaFile
+41-5libc/src/__support/mathvec/exp10f.h
+37-5libc/src/__support/mathvec/exp2f.h
+34-1libc/src/__support/mathvec/expf_utils.h
+6-28libc/src/__support/mathvec/expf.h
+17-3libc/src/__support/CPP/simd.h
+7-3libc/src/__support/mathvec/CMakeLists.txt
+142-451 files not shown
+143-457 files

LLVM/project fa70bdd.github/workflows/require-team-membership action.yml

workflows/require-team-membership: Fix typo (#212686)

(cherry picked from commit e423bace201fd04fd594e7fcd666d559ca12fda3)
DeltaFile
+1-1.github/workflows/require-team-membership/action.yml
+1-11 files

LLVM/project d28193flibcxx/test/std/depr/depr.c.headers math_h.pass.cpp

[libc++][test] Add `void` cast to a discarded call to `remquo` (#213849)

For calls to `remquo`, the return values are generally expected to be
used, while it is rare to only use the value written via the pointer
parameter. Moreover, some implementors already planned to apply
`[[nodiscard]]` to `remquo`, see also https://llvm.org/PR171763. As a
result, it is perhaps better to add `void` cast to the discarded call to
`remquo` in the test file.
DeltaFile
+1-1libcxx/test/std/depr/depr.c.headers/math_h.pass.cpp
+1-11 files

LLVM/project 55b38aellvm/lib/Target/SPIRV SPIRVInstrInfo.cpp SPIRVCallLowering.cpp, llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_float_controls2 fp-fast-math-mode-function-call.ll

[SPIRV] Emit FPFastMathMode for Call (#211879)

`SPV_KHR_float_controls2` makes `FPFastMathMode` valid for all core
instructions, so this patch enables translation of fast math flags for
`OpFunctionCall`.
DeltaFile
+41-0llvm/test/CodeGen/SPIRV/extensions/SPV_KHR_float_controls2/fp-fast-math-mode-function-call.ll
+4-1llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
+1-0llvm/lib/Target/SPIRV/SPIRVInstrInfo.cpp
+46-13 files

LLVM/project 330dfca.github CODEOWNERS

[runtimes] Drop reviewers-libcxx from reviews touching runtimes/ (#213736)

Since runtimes/ has been picked up by other subprojects, it doesn't make
sense anymore for reviewers-libcxx to watch all changes to it.
DeltaFile
+0-1.github/CODEOWNERS
+0-11 files

LLVM/project ab8b037libcxx/test/libcxx/diagnostics unused_variables.verify.cpp unused_variables.compile.pass.cpp, libcxx/test/std/containers/sequences/vector.bool ctor_exceptions.pass.cpp

[libc++] Diagnose unused variables of container types (#203084)

This adds `[[gnu::warn_unused]]` to all container types currently
implemented. In the future new containers should be added to the list,
as well as other value types in the library.

Clang has `-Wunused`, which is a suite of warnings about unused
variables. However, that doesn't warn for a lot of class types,
especially non-trivial ones. That is done to avoid false-positives for
RAII-style types like `lock_guard`. `[[gnu::warn_unused]]` exists to
tell Clang that a given class is a value type.
DeltaFile
+87-0libcxx/test/libcxx/diagnostics/unused_variables.compile.pass.cpp
+70-0libcxx/test/libcxx/diagnostics/unused_variables.verify.cpp
+18-0libcxx/test/std/containers/sequences/vector/vector.cons/exceptions.pass.cpp
+13-0libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
+6-6libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
+9-0libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
+203-6106 files not shown
+385-102112 files

LLVM/project adba9dallvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPCompatibilityAnalysis.cpp SLPCompatibilityAnalysis.h

[SLP]Support copyable fadds in fmuladd, modeled as fmuladd(1.0, a, b)

A copyable single-use fadd a, b is modeled as fmuladd(1.0, a, b), which
equals fadd a, b (the multiply by 1.0 is exact and preserves signed
zeros), so the add dies instead of being computed and gathered. The
addend/multiplicand assignment per lane matches the majority operand
kinds of the non-copyable lanes. Same all-or-nothing and tie-break
rules as for absorbed fmuls.

Reviewers: hiraditya, bababuck, RKSimon

Pull Request: https://github.com/llvm/llvm-project/pull/213786
DeltaFile
+61-72llvm/test/Transforms/SLPVectorizer/X86/fmuladd-copyable-fadd.ll
+65-44llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+22-13llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.h
+26-6llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.cpp
+174-1354 files

LLVM/project 7e15ae5clang-tools-extra/clang-tidy/altera IdDependentBackwardBranchCheck.cpp, clang-tools-extra/clang-tidy/bugprone BranchCloneCheck.cpp NondeterministicPointerIterationOrderCheck.cpp

[clang-tidy][NFC] Apply readability-redundant-parentheses (#213848)
DeltaFile
+2-2clang-tools-extra/clang-tidy/cppcoreguidelines/NoMallocCheck.cpp
+2-2clang-tools-extra/clang-tidy/bugprone/NondeterministicPointerIterationOrderCheck.cpp
+2-2clang-tools-extra/clang-tidy/altera/IdDependentBackwardBranchCheck.cpp
+1-1clang-tools-extra/clang-tidy/modernize/AvoidBindCheck.cpp
+1-1clang-tools-extra/clang-tidy/misc/StaticInitializationCycleCheck.cpp
+1-1clang-tools-extra/clang-tidy/bugprone/BranchCloneCheck.cpp
+9-96 files not shown
+15-1512 files

LLVM/project 61ccfbfclang-tools-extra/clang-tidy/performance TypePromotionInMathFnCheck.cpp MoveConstArgCheck.cpp, clang-tools-extra/clang-tidy/readability SuspiciousCallArgumentCheck.cpp SimplifyBooleanExprCheck.cpp

[clang-tidy][NFC] Apply const-correctness for auto 6/N (#213844)
DeltaFile
+14-13clang-tools-extra/clang-tidy/performance/MoveConstArgCheck.cpp
+14-11clang-tools-extra/clang-tidy/readability/ImplicitBoolConversionCheck.cpp
+11-10clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
+10-10clang-tools-extra/clang-tidy/readability/IdentifierNamingCheck.cpp
+10-9clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
+9-9clang-tools-extra/clang-tidy/readability/SuspiciousCallArgumentCheck.cpp
+68-6242 files not shown
+186-16948 files

LLVM/project 0b71b1aclang-tools-extra/clang-tidy/modernize LoopConvertCheck.cpp UseEqualsDefaultCheck.cpp

[clang-tidy][NFC] Apply const-correctness for auto 5/N (#213843)
DeltaFile
+16-14clang-tools-extra/clang-tidy/modernize/UseStructuredBindingCheck.cpp
+15-12clang-tools-extra/clang-tidy/modernize/TypeTraitsCheck.cpp
+11-10clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp
+10-10clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp
+11-9clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp
+10-9clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp
+73-6445 files not shown
+221-19951 files

LLVM/project 0bbee28clang-tools-extra/clang-tidy/cppcoreguidelines PreferMemberInitializerCheck.cpp MisleadingCaptureDefaultByValueCheck.cpp, clang-tools-extra/clang-tidy/objc SuperSelfCheck.cpp NSInvocationArgumentLifetimeCheck.cpp

[clang-tidy][NFC] Apply const-correctness for auto 4/N (#213842)
DeltaFile
+12-10clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsAvoidUncheckedContainerAccessCheck.cpp
+6-6clang-tools-extra/clang-tidy/performance/AvoidEndlCheck.cpp
+5-5clang-tools-extra/clang-tidy/cppcoreguidelines/MisleadingCaptureDefaultByValueCheck.cpp
+5-4clang-tools-extra/clang-tidy/objc/SuperSelfCheck.cpp
+5-4clang-tools-extra/clang-tidy/objc/NSInvocationArgumentLifetimeCheck.cpp
+5-4clang-tools-extra/clang-tidy/cppcoreguidelines/PreferMemberInitializerCheck.cpp
+38-3327 files not shown
+102-9333 files

LLVM/project ddc8e4bclang-tools-extra/clang-tidy/bugprone UseAfterMoveCheck.cpp MisleadingSetterOfReferenceCheck.cpp

[clang-tidy][NFC] Apply const-correctness for auto 3/N (#213841)
DeltaFile
+37-36clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp
+35-32clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
+14-14clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
+13-12clang-tools-extra/clang-tidy/bugprone/ImplicitWideningOfMultiplicationResultCheck.cpp
+11-11clang-tools-extra/clang-tidy/bugprone/MisleadingSetterOfReferenceCheck.cpp
+9-8clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp
+119-11351 files not shown
+260-23957 files

LLVM/project f5346a5llvm/lib/Target/AArch64 AArch64SVEInstrInfo.td, llvm/test/CodeGen/AArch64 vector-absolute-difference.ll

[LLVM][CodeGen][SVE] Add isel patterns for abs-diff partial reductions. (#212800)

For SVE2 we can use top/bottom [S/U]ABAL[T/B] instruction. SVE2p3 can
use just [S/U]ABAL.
DeltaFile
+106-25llvm/test/CodeGen/AArch64/vector-absolute-difference.ll
+28-0llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
+134-252 files

LLVM/project e36b2acclang-tools-extra/clang-tidy/abseil DurationComparisonCheck.cpp StringFindStrContainsCheck.cpp, clang-tools-extra/clang-tidy/custom QueryCheck.cpp

[clang-tidy][NFC] Apply const-correctness for auto 2/N (#213840)
DeltaFile
+6-6clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp
+6-6clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
+5-5clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
+5-4clang-tools-extra/clang-tidy/linuxkernel/MustCheckErrsCheck.cpp
+5-4clang-tools-extra/clang-tidy/custom/QueryCheck.cpp
+4-4clang-tools-extra/clang-tidy/abseil/DurationComparisonCheck.cpp
+31-2922 files not shown
+74-6728 files

LLVM/project d4c991dclang-tools-extra/clang-tidy ClangTidy.cpp ClangTidyOptions.cpp, clang-tools-extra/clang-tidy/utils RenamerClangTidyCheck.cpp DeclRefExprUtils.cpp

[clang-tidy][NFC] Apply const-correctness for auto 1/N (#213839)
DeltaFile
+13-12clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp
+10-7clang-tools-extra/clang-tidy/ClangTidyCheck.cpp
+7-6clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+5-5clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
+5-5clang-tools-extra/clang-tidy/ClangTidyOptions.cpp
+5-4clang-tools-extra/clang-tidy/ClangTidy.cpp
+45-3912 files not shown
+67-6118 files

LLVM/project f690eb5.github/workflows/upload-release-artifact action.yml

Fix indnetation
DeltaFile
+8-8.github/workflows/upload-release-artifact/action.yml
+8-81 files

LLVM/project 0d1ffee.github/workflows/upload-release-artifact action.yml

Move checkout and gate it on upload
DeltaFile
+11-10.github/workflows/upload-release-artifact/action.yml
+11-101 files

LLVM/project 94f8dc8.github/workflows/upload-release-artifact action.yml

workflows/upload-release-artifact: Make this action self-contained

The action now checks out its own files so calling worklfows don't need
to do this.  This helps prevent mistakes where the calling workflow
does not checkout the right files causing this action to fail.
DeltaFile
+19-9.github/workflows/upload-release-artifact/action.yml
+19-91 files

LLVM/project 9f4047ellvm/lib/Transforms/Instrumentation AddressSanitizer.cpp, llvm/test/Instrumentation/AddressSanitizer alloca-addrspace.ll

[ASan] Handle allocas in non-default address spaces (#213764)

Do addrspace cast for allocas that live in address space different from
the datalayout's alloca address space, otherwise ASan will crash during
use replacement
DeltaFile
+30-0llvm/test/Instrumentation/AddressSanitizer/alloca-addrspace.ll
+2-0llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+32-02 files

LLVM/project e3d847fllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 fmuladd-copyable-fmul.ll

[SLP]Fix scheduling of absorbed copyable fmuls, modeled as fmuladd(a, b, -0.0)

A copyable fmul absorbed into fmuladd(a, b, -0.0) does not appear in
the operand columns of its own node, so the operand scan never
released the schedule data of the copyable instruction itself and
scheduling ended with unscheduled bundles. Release it explicitly when
the copyable element shows up in no operand column.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/213937
DeltaFile
+64-0llvm/test/Transforms/SLPVectorizer/X86/fmuladd-copyable-fmul.ll
+14-0llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+78-02 files

LLVM/project 07a53bellvm/test/CodeGen/AMDGPU llvm.amdgcn.intersect_ray.ll, llvm/test/CodeGen/AMDGPU/GlobalISel orn2.ll legalize-extract.mir

[GlobalISel] Combine merge-unmerge with mixed scalar and vector types (#213086)

fixes: https://github.com/llvm/llvm-project/issues/177416
DeltaFile
+177-0llvm/test/CodeGen/AMDGPU/GlobalISel/artifact-combiner-unmerge-values.mir
+20-36llvm/test/CodeGen/AMDGPU/llvm.amdgcn.intersect_ray.ll
+18-34llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.intersect_ray.ll
+5-16llvm/test/CodeGen/AMDGPU/GlobalISel/andn2.ll
+8-12llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-extract.mir
+4-15llvm/test/CodeGen/AMDGPU/GlobalISel/orn2.ll
+232-1132 files not shown
+246-1248 files

LLVM/project 04c9cf4lldb/source/Plugins/Process/gdb-remote GDBRemoteCommunicationClient.cpp, lldb/test/API/functionalities/gdb_remote_client TestQSymbol.py

[LLDB] Serve unknown type symbols through `qSymbol` for non-MachO targets (#200134)

I am working with a binary where some symbols are generated from linker
scripts. They end up identified as `eSymbolInvalid` when loaded in LLDB.
OpenOCD can try to fetch them.

Some might even be hard-coded data, not going through an address in the
binary (explaining the presence of the check and raw value
return).

Testing it showed that **GDB returns them despite them not being proper
addresses**.
These can also be generated by C++ static constexpr, such values could
be accessed by a qSymbol query.

358cf1ea302eb introduced a divergence between GDB and LLDB where LLDB
does not serve symbols of unknown type through GDB protocol command
`qSymbol`. Per commit description, this is an expected behavior on
MachO-based platforms, but it is not on ELF-based platforms, where LLDB
should follow GDB. The changes introduced by said commit are now gated
behind an architecture check.
DeltaFile
+15-0lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+2-4lldb/test/API/functionalities/gdb_remote_client/TestQSymbol.py
+17-42 files

LLVM/project 2e88420llvm/lib/Target/AMDGPU AMDGPUReserveWWMRegs.cpp SILowerSGPRSpills.cpp

[NFC][AMDGPU] Rename some variable names to follow convention better

This is a follow-up of #213491.
DeltaFile
+5-5llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+5-5llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
+4-5llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp
+2-2llvm/lib/Target/AMDGPU/AMDGPUReserveWWMRegs.cpp
+16-174 files

LLVM/project b5645e2offload/liboffload/src OffloadImpl.cpp, offload/plugins-nextgen/amdgpu/src rtl.cpp

[offload] allow h2h olMemcpy with a queue (#212757)

olMemcpy currently disallows host-to-host copies with a queue, even
though that is a desirable use case (e.g. to copy a buffer as a
dependency for another operation)

This PR adds support for asynchronous host-to-host copies by adding
`GenericDeviceTy::dataMemcpy` and the corresponding required
`dataMemcpyImpl` plugin operation. Unlike `dataSubmit`, `dataRetrieve`,
and `dataExchange`, this operation does not assign a device direction to
either pointer:
- CUDA: Uses `cuMemcpyAsync`, which by itself determines the pointer
types and preserves stream ordering. Dynamic CUDA symbol declarations
and `_v2` lookup support are included.
- Level Zero: Uses the existing queue `memoryCopy` operation (backed by
`zeCommandListAppendMemoryCopy`), which appends a memory-copy command to
the command list.
- AMDGPU: No "enqueue a host-to-host copy" operation exists directly in
that API, so we enqueue a `std::memcpy` callback through

    [10 lines not shown]
DeltaFile
+71-0offload/unittests/OffloadAPI/memory/olMemcpy.cpp
+27-0offload/plugins-nextgen/amdgpu/src/rtl.cpp
+14-0offload/plugins-nextgen/cuda/src/rtl.cpp
+12-0offload/plugins-nextgen/common/src/PluginInterface.cpp
+3-5offload/liboffload/src/OffloadImpl.cpp
+6-0offload/plugins-nextgen/host/src/rtl.cpp
+133-56 files not shown
+150-612 files