LLVM/project 5340f7cclang/tools/clang-format git-clang-format

[git-clang-format] Don't format the line preceding a deletion (#215946)

`git diff -U0` renders a pure deletion as `@@ -3,3 +2,0 @@`: no new
lines,
anchored at the preceding line. extract_lines coerces that zero count to
one, so clang-format reformats a line the deletion never touched.

Skip such hunks, matching clang-format-diff.py. start_line is 0 only for
deletions at the start of a file, so that check goes away as well.

Aided by Claude Opus 5

(cherry picked from commit fe0143b1a97484e10bc11b012ceb2c1ecd8bc38c)
DeltaFile
+3-2clang/tools/clang-format/git-clang-format
+3-21 files

LLVM/project 687ecdcclang/tools/clang-format git-clang-format

Add option to format a whole file using git-clang-format (#204336)

Today, git-clang-format will only format lines which have been modified.
However, in some cases, that's not sufficient to get a "clean" file
which would be unmodified by running `clang-format` manually.

I've got a minimal repro using the default clang-format rules. Setup a
new git repository and create a commit with an empty file:

```
mkdir /tmp/bla
cd /tmp/bla
git init
touch t.cpp
git add t.cpp
git commit -m "V1"
```

Add a line to that file containing a comment:

    [30 lines not shown]
DeltaFile
+29-16clang/tools/clang-format/git-clang-format
+29-161 files

LLVM/project ab544f6llvm CMakeLists.txt

workflows/release-binaries: Smaller WiX installer on Windows (#219858)

Reduce WiX installer size by using LZX compression instead of MSZIP
previously. Tested on `release/23.x` at commit
fdf0409c656cc66c61b14d71c831f2b453c13e19 targetting Win64:

- MSZIP: 779 MiB
- LZX: 613 MiB

(cherry picked from commit dee1f43598034a63b3de521032bb894b33152b1c)
DeltaFile
+8-2llvm/CMakeLists.txt
+8-21 files

LLVM/project 99cfc87clang/lib/Sema SemaDecl.cpp, clang/test/Modules pr218152.cppm

[C++20] [Modules] Handling merging predefined decls from std (#219151)

Close https://github.com/llvm/llvm-project/issues/218152

This was only reported in windows as MSSTL chose to implement std module
by wrapping the STL into extern "C++", which is different from libstdc++
and libc++.

But technically this is not specific to windows and we're able to
preoduce it in linux although we won't face it in linux.

(cherry picked from commit 52774473867e49b5891ab9381accf4e5a3ce0024)
DeltaFile
+17-0clang/test/Modules/pr218152.cppm
+1-1clang/lib/Sema/SemaDecl.cpp
+18-12 files

LLVM/project a92d777orc-rt/include/orc-rt/bedrock/sps SimpleRemoteCA.h, orc-rt/lib/bedrock/sps SimpleRemoteCA.cpp

[orc-rt] Move connection state and teardown to SimpleRemoteCA (#220188)

Shares the connection-state and teardown logic between transports.

SimpleRemoteCA now tracks connection state, so disconnect,
callController and sendWrapperResult are final. A controller call either
registers under the same lock that publishes the state, or is failed
inline on the caller's stack, so it can never be left pending with no
result to come. Teardown funnels through finishTeardown, which drains
pending calls and then notifies the Session exactly once, however
teardown began. registerPendingCall and failAllPendingCalls become
private.

Subclasses implement connect plus two hooks. The base calls sendMessage
with an opcode, sequence number, tag and payload for the transport to
frame and send; it runs with no lock held, so framing stays off the
critical section, and is best-effort, so a transport that has gone away
can drop the message. beginTeardown stops the transport, sending an
orderly hang-up first, and calls finishTeardown once it is done.

    [4 lines not shown]
DeltaFile
+218-44orc-rt/test/unit/bedrock/sps/SimpleRemoteCATest.cpp
+82-35orc-rt/include/orc-rt/bedrock/sps/SimpleRemoteCA.h
+78-2orc-rt/lib/bedrock/sps/SimpleRemoteCA.cpp
+378-813 files

LLVM/project 7de1badllvm/lib/Target/AArch64 AArch64InstrInfo.td AArch64InstrInfo.cpp, llvm/test/CodeGen/AArch64 ptrauth-tail-call-shrink-wrapping.ll sign-return-address-pauth-lr-mir.ll

[AArch64][PAC] Emit tail calls more efficiently

It may be required to insert explicit checks that LR was authenticated
successfully before performing a tail call. Previously, such checks were
inserted when expanding the TCRETURN pseudo instructions, if the stack
frame was created by the particular function. This did not take into
account the shrink-wrapping optimization, though.

This commit introduces a separate `PAUTH_CHECK_LR` pseudo instruction.
A conservative heuristic is implemented that drops the completely useless
checks. Furthermore, it moves the remaining checks to the shrink-wrapping
epilogue (if any), but only if that doesn't hurt any regular return code
paths.
DeltaFile
+273-129llvm/test/CodeGen/AArch64/sign-return-address-pauth-lr-mir.ll
+142-17llvm/lib/Target/AArch64/AArch64PointerAuth.cpp
+12-36llvm/test/CodeGen/AArch64/ptrauth-tail-call-shrink-wrapping.ll
+15-32llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+20-14llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+7-0llvm/lib/Target/AArch64/AArch64InstrInfo.td
+469-2286 files

LLVM/project 083b00blibcxx/docs index.rst, libcxx/docs/Status Parallelism.rst FormatIssues.csv

[libc++][docs][NFC] Remove Format and Parallelism TS status pages (#220021)

Removes the last meta-status pages in favor of GitHub meta-issues.

Co-authored-by: Hristo Hristov <zingam at outlook.com>
DeltaFile
+0-49libcxx/docs/Status/Format.rst
+0-43libcxx/docs/Status/ParallelismProjects.csv
+0-33libcxx/docs/Status/FormatPaper.csv
+0-29libcxx/docs/Status/Parallelism.rst
+0-29libcxx/docs/Status/FormatIssues.csv
+0-2libcxx/docs/index.rst
+0-1856 files

LLVM/project 084cb22libcxx/test/std/ranges/range.adaptors/range.enumerate/iterator iter_move.pass.cpp

[libc++][ranges][enumerate_view] Update iterator `iter_move` test (#219474)

Completes the [range.enumerate.iterator] `iter_move` test by addressing
the review comment
https://github.com/llvm/llvm-project/pull/73617#discussion_r1416642892
from the original implementation.

---------

Co-authored-by: Hristo Hristov <zingam at outlook.com>
Co-authored-by: Hristo Hristov <hghristov.rmm at gmail.com>
Co-authored-by: A. Jiang <de34 at live.cn>
DeltaFile
+45-12libcxx/test/std/ranges/range.adaptors/range.enumerate/iterator/iter_move.pass.cpp
+45-121 files

LLVM/project 5205dc5llvm/lib/Target/AArch64 AArch64InstrInfo.cpp, llvm/test/CodeGen/AArch64 sign-return-address-epilogue-regs.ll

[AArch64][PAC] Prevent PAUTH_EPILOGUE from overwriting live registers

With shrink-wrapping, it is possible for PAUTH_EPILOGUE to be inserted
in the middle of the function where X15/X16/X17 may be alive and must
not be clobbered.

This commit implements ad-hoc spilling of the scratch registers used by
PAUTH_EPILOGUE to other GPRs. If no such registers is available at the
insertion point, an explicit compiler error is triggered.
DeltaFile
+541-0llvm/test/CodeGen/AArch64/sign-return-address-epilogue-regs.ll
+68-9llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+609-92 files

LLVM/project 8a9eb66llvm/test/CodeGen/AArch64 ptrauth-tail-call-shrink-wrapping.ll

[AArch64][PAC] Precommit tests on efficient LR checks before tail calls

When performing a tail call with pac-ret hardening enabled, depending on
the performance vs. security trade-off, it may be required to insert an
explicit check that the LR register contains a valid address (that is,
the authentication succeeded), as unlike a regular call, a tail call does
not dereference LR right away.

When shrink-wrapping optimization is in effect, this might be expensive
both in terms of time complexity and code size. This commit adds several
tests demonstrating the existing codegen behavior.
DeltaFile
+476-0llvm/test/CodeGen/AArch64/ptrauth-tail-call-shrink-wrapping.ll
+476-01 files

LLVM/project 2f3dac5llvm/lib/Target/AArch64 AArch64InstrInfo.cpp, llvm/test/CodeGen/AArch64 swifttail-ptrauth.ll

[AArch64][PAC] Fix the list of registers clobbered by PAUTH_EPILOGUE

When SP adjustment might be needed, whether X15 scratch register can be used
by PAUTH_EPILOGUE or not depends on PAuth LR hardening being requested for
the particular function, not the availability of `FEAT_PAuth_LR`.
DeltaFile
+25-0llvm/test/CodeGen/AArch64/swifttail-ptrauth.ll
+1-1llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+26-12 files

LLVM/project e821909clang/lib/Headers amxavx512intrin.h

[X86][AMX-AVX512] Update intrinsic Operation to match with ISE062, NFCI (#219868)

Ref.: https://cdrdv2.intel.com/v1/dl/getContent/671368

Assisted-by: Claude Opus 4.8
DeltaFile
+150-124clang/lib/Headers/amxavx512intrin.h
+150-1241 files

LLVM/project 872ed98llvm/test/CodeGen/AArch64 arm64-addp.ll aarch64-vuzp.ll

[AArch64][GobalISel] Update and regenerate test coverage. NFC (#220179)
DeltaFile
+275-128llvm/test/CodeGen/AArch64/faddp-half.ll
+157-18llvm/test/CodeGen/AArch64/aarch64-vuzp.ll
+103-44llvm/test/CodeGen/AArch64/arm64-addp.ll
+535-1903 files

LLVM/project 19f66fbopenmp/runtime/src kmp_runtime.cpp

[libomp] Atomically claim library unregistration (#216713)

Claude assisted with this patch.

Follow-up to https://github.com/llvm/llvm-project/pull/215988.
DeltaFile
+12-12openmp/runtime/src/kmp_runtime.cpp
+12-121 files

LLVM/project edbd582llvm/lib/Target/Mips MipsISelLowering.cpp, llvm/test/CodeGen/Mips named-register-mips3-o32.ll

[Mips] Select GPR register class based on requested type size (#220012)

In MipsTargetLowering::getRegisterByName(), the register class was
previously selected solely based on Subtarget.isGP64bit(), ignoring the
requested value type size (VT).

When compiling for a 64-bit MIPS CPU with the 32-bit o32 ABI (such as
-mcpu=mips3 -target-abi=o32), Subtarget.isGP64bit() is true even though
32-bit registers are expected. Reading a 32-bit named register like $gp
(e.g., via llvm.read_register.i32) returned a 64-bit register ($gp_64).
This resulted in a cross-register-class copy from GPR64 to GPR32 that
MipsSEInstrInfo::copyPhysReg() could not lower. In builds without
assertions, this constructed an invalid TargetOpcode::PHI (opcode 0)
instruction and caused a crash in MipsMCCodeEmitter during object file
emission.

Inspect VT.getSizeInBits() in getRegisterByName() to select
GPR32RegClassID for 32-bit types and GPR64RegClassID for 64-bit types
when supported by the subtarget, reporting an error for invalid types.

    [3 lines not shown]
DeltaFile
+29-0llvm/test/CodeGen/Mips/named-register-mips3-o32.ll
+17-3llvm/lib/Target/Mips/MipsISelLowering.cpp
+46-32 files

LLVM/project 1b1a935llvm/test/MC/Disassembler/X86 hex-bytes.txt, llvm/tools/llvm-mc Disassembler.cpp

[llvm-mc] Propagate invalid-token errors from byteArrayFromString (#217533)

byteArrayFromString always returned false after skipping an invalid
non-hex token, so llvm-mc exited 0 despite printing errors. Track
whether an error occurred so the process status matches.
DeltaFile
+13-0llvm/test/MC/Disassembler/X86/hex-bytes.txt
+3-1llvm/tools/llvm-mc/Disassembler.cpp
+16-12 files

LLVM/project 65443a3llvm/include/llvm/ABI TargetInfo.h, llvm/lib/ABI TargetInfo.cpp

[ABI] Add AMDGPU target ABI classifier to the LLVM ABI library
DeltaFile
+274-0llvm/unittests/ABI/AMDGPUTargetInfoTest.cpp
+248-0llvm/lib/ABI/Targets/AMDGPU.cpp
+0-55llvm/lib/ABI/Targets/X86.cpp
+54-0llvm/lib/ABI/TargetInfo.cpp
+6-0llvm/include/llvm/ABI/TargetInfo.h
+1-0llvm/unittests/ABI/CMakeLists.txt
+583-551 files not shown
+584-557 files

LLVM/project c1100cdmlir/include/mlir/Dialect/Linalg/IR LinalgStructuredOps.td, mlir/lib/Dialect/Linalg/IR LinalgOps.cpp

[mlir] [linalg] Fold reduce(broadcast(x)) max/min (#213190)

This patch tries to implement the optimization for

```
max(broadcast(x)) -> x # (or replace min)
```

We can extend the optimization to other reduce op like add, mul, and,
or, xor ... in the future. This patch tries to be small by implementing
the simplest case.

AI assisted.

---------

Co-authored-by: yedeng.yd <yedeng.yd at alibaba-inc.com>
DeltaFile
+141-0mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+109-0mlir/test/Dialect/Linalg/canonicalize.mlir
+1-0mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
+251-03 files

LLVM/project bf6129bllvm/test/Transforms/SLPVectorizer/AArch64 store-load-forward-conflict.ll

[SLP][NFC] Pre-commit test for AArch64 store-to-load forwarding bail-out (#218116)

Add an AArch64 SLP test that locks in the current (pre-feature)
vectorization of a widened backward load that aliases a widened store,
plus a narrow-load control case that never straddles two widened stores.
The follow-up patch adding the store-to-load forwarding cost-model
bail-out will update these checks, making its effect visible as a diff
on a non-X86 target.

---------

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+131-0llvm/test/Transforms/SLPVectorizer/AArch64/store-load-forward-conflict.ll
+131-01 files

LLVM/project e526949llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.cpp

[SandboxVec][LoadStoreVec] Extract LoadStoreVec::vectorizeStores from runOnRegion

Move runOnRegion()'s body -- the store-chain legality checks, operand
classification, vector value construction, and profitability decision
-- into a new vectorizeStores(Bndl, Rgn, Sched, A) method. runOnRegion()
now only builds the initial bundle from the region's Aux and calls
vectorizeStores() once.

Snapshot the region's cost in saveIR() and decide accept vs revert in
acceptOrRevert(), so vectorizeStores() does not thread ScoreBoard or
CostBefore through the profitability check. NFC.

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+37-22llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.cpp
+19-0llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
+56-222 files

LLVM/project 9f1e88bllvm/lib/Target/AMDGPU SIMemoryLegalizer.cpp, llvm/test/CodeGen/AMDGPU av-invalid-scope.ll memory-legalizer-invalid-syncscope.ll

AMDGPU: Lowercase the unsupported fence sync scope diagnostic (#220081)

Error messages should start with a lowercase letter per the diagnostic
policy.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+5-5llvm/test/CodeGen/AMDGPU/memory-legalizer-invalid-syncscope.ll
+3-3llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp
+2-2llvm/test/CodeGen/AMDGPU/av-invalid-scope.ll
+10-103 files

LLVM/project 8624148clang/include/clang/Basic DiagnosticSemaKinds.td, clang/include/clang/Sema SemaAMDGPU.h

clang/AMDGPU: Diagnose invalid fence sync scope (#220077)

Reject an unrecognized synchronization scope string passed to
__builtin_amdgcn_fence during semantic analysis instead of relying on
the backend to report it during codegen.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+19-0clang/test/SemaHIP/builtin-amdgcn-fence-scope.hip
+12-1clang/lib/Sema/SemaAMDGPU.cpp
+2-4clang/test/Sema/builtin-amdgcn-fence-failure.cpp
+3-1clang/include/clang/Sema/SemaAMDGPU.h
+1-1clang/lib/Sema/SemaChecking.cpp
+2-0clang/include/clang/Basic/DiagnosticSemaKinds.td
+39-76 files

LLVM/project 98e4cdcllvm/test/MC/Disassembler/AArch64 armv8.9a-prfm-slc.txt armv8.6a-amvs.s, llvm/test/MC/Disassembler/ARM armv8.1m-vlldm_vlstm-8.main.txt move-banked-regs-thumb.txt

[MC,test] Use # comments in llvm-mc --disassemble inputs (#220163)

llvm-mc --disassemble recognizes only # as a comment marker; `//` lead
to invalid-token errors, which will change the exit status after an
upcoming llvm-mc change.
DeltaFile
+286-286llvm/test/MC/Disassembler/AArch64/armv8r-sysreg.txt
+135-135llvm/test/MC/Disassembler/AArch64/armv8.6a-amvs.s
+67-67llvm/test/MC/Disassembler/ARM/move-banked-regs-thumb.txt
+67-67llvm/test/MC/Disassembler/ARM/move-banked-regs-arm.txt
+11-11llvm/test/MC/Disassembler/AArch64/armv8.9a-prfm-slc.txt
+8-8llvm/test/MC/Disassembler/ARM/armv8.1m-vlldm_vlstm-8.main.txt
+574-5747 files not shown
+590-58713 files

LLVM/project 866ee80llvm/lib/Target/X86 X86AsmPrinter.cpp

X86: Pass instruction to inline asm register printing helpers (#219473)

printAsmMRegister and printAsmVRegister only used the operand to recover
its parent instruction's inline asm dialect. Pass the containing instruction
directly so they no longer depend on MachineOperand::getParent().

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+9-8llvm/lib/Target/X86/X86AsmPrinter.cpp
+9-81 files

LLVM/project 6ca17fdllvm/lib/Target/LoongArch LoongArchFloatInstrFormats.td LoongArchInstrInfo.td, llvm/lib/Target/LoongArch/Disassembler LoongArchDisassembler.cpp

[LoongArch][Disassembler] Add symbolic operands for decoded immediates (#217971)

Symbolize operands for decoded immediates when possible. This gives
`LoongArchDisassembler` non-raw immediate capabilities similar to that
of `{X86,RISCV}Disassembler`. See also #217550 for similar work on
RISC-V.

This is part of the preparatory work for a future port of BOLT to
LoongArch.
DeltaFile
+192-0llvm/unittests/MC/LoongArch/LoongArchMCDisassemblerTest.cpp
+17-3llvm/lib/Target/LoongArch/Disassembler/LoongArchDisassembler.cpp
+11-4llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
+13-0llvm/unittests/MC/LoongArch/CMakeLists.txt
+1-1llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp
+1-1llvm/lib/Target/LoongArch/LoongArchFloatInstrFormats.td
+235-96 files

LLVM/project be6d098llvm/include/llvm/Analysis LoopAccessAnalysis.h, llvm/lib/Analysis LoopAccessAnalysis.cpp

[LAA][NFC] Factor out MemoryDepChecker::isStoreLoadForwardingConflict (#212085)

Extract the store-to-load forwarding conflict predicate used inside
MemoryDepChecker::couldPreventStoreLoadForward into a static helper so
it
can be shared with other consumers (e.g. the SLP vectorizer's STLF cost
model).

The helper takes an optional LoadElementSize so callers that know the
load
width can ask whether the load actually straddles two widened stores:
  (a) a misaligned load that starts R = Distance % VectorStoreSize bytes
below a widened-store boundary overruns into the next store only if it
      is wider than those R bytes (LoadElementSize > R), and
(b) an aligned load (R == 0) overruns only if it is itself wider than
the
      widened store window (LoadElementSize > VectorStoreSize).
LoadElementSize defaults to 0 (unknown width, both terms disabled).
couldPreventStoreLoadForward passes VF as the load width, so (a) reduces

    [9 lines not shown]
DeltaFile
+31-0llvm/include/llvm/Analysis/LoopAccessAnalysis.h
+3-7llvm/lib/Analysis/LoopAccessAnalysis.cpp
+34-72 files

LLVM/project 143c56ellvm/lib/CodeGen LowLevelTypeUtils.cpp, llvm/test/CodeGen/AArch64/GlobalISel irtranslator-unwind-inline-asm.ll irtranslator-exceptions.ll

[GlobalISel] Use integer as the fallback type for getLLTForType. (#218148)

In the test cases this comes up from struct types with a known size,
from an invoke instruction. Using integer as the fallback type for it
seems to work fine.
DeltaFile
+4-4llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
+2-2llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-unwind-inline-asm.ll
+2-1llvm/lib/CodeGen/LowLevelTypeUtils.cpp
+8-73 files

LLVM/project 813609cclang/lib/AST/ByteCode Program.cpp Program.h

[clang][bytecode] Allocate functions via Program allocator (#219994)

They have the same lifetime as `Program`, so use the allocator we're
already carrying around.
DeltaFile
+8-4clang/lib/AST/ByteCode/Program.h
+2-2clang/lib/AST/ByteCode/Program.cpp
+10-62 files

LLVM/project 678058alibcxx/include/__compare type_order.h, libcxx/test/libcxx/language.support no_specializations.verify.cpp

[libc++] Implement P2830R10: Standardized Constexpr Type Ordering (#216616)

This patch implements the library side of `std::type_order` from
P2830R10 including the changes from P3778R0, P4140R0 and LWG4305. Since
clang's `__builtin_type_order`'s semantics match GCC's, this does not
need special casing for GCC.

Resolves https://github.com/llvm/llvm-project/issues/148152
Resolves https://github.com/llvm/llvm-project/issues/171284
Resolves https://github.com/llvm/llvm-project/issues/189595
Resolves https://github.com/llvm/llvm-project/issues/171344
DeltaFile
+65-0libcxx/test/std/language.support/cmp/cmp.type/type_order.compile.pass.cpp
+46-0libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+46-0libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.compile.pass.cpp
+40-0libcxx/include/__compare/type_order.h
+18-0libcxx/test/libcxx/language.support/no_specializations.verify.cpp
+7-0libcxx/utils/generate_feature_test_macro_components.py
+222-010 files not shown
+251-416 files

LLVM/project 5bf0ddellvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 adox.ll

[X86] Fix ADOX miscompile by restricting COND_O optimization when EFLAGS are used (#220117)

This patch fixes a miscompile where the X86 DAGCombiner aggressively
folds an `ADD` node into an `ADOX` instruction even when the Zero Flag
(ZF) produced by the `ADD` is used by a subsequent branch (e.g., `je`).
DeltaFile
+61-0llvm/test/CodeGen/X86/adox.ll
+5-3llvm/lib/Target/X86/X86ISelLowering.cpp
+66-32 files