LLVM/project 7088c00llvm/include/llvm/Support KnownFPClass.h, llvm/lib/Support KnownFPClass.cpp

[KnownFPClass] Refactor direct access to `KnownFPClass::SignBit` [NFC] (#218514)

Part of https://github.com/llvm/llvm-project/issues/217072

This PR is the first step in refactoring `KnownFPClass`. It replaces
direct access to the `SignBit` field with getters and setters.

The long-term goal is to eliminate the `SignBit` field so that
`KnownFPClass` can be represented by a single bitmask, rather than an
`FPClassTest` together with a `std::optional<bool>`.
```c++
struct KnownFPClass {
  FPClassTest KnownFPClasses = fcAllFlags;
  std::optional<bool> SignBit;
};

struct KnownFPClass {
  // Also distinguishes positive/negative qNaN and sNaN.
  KnownFPMask KnownFPClasses = kfcAllFlags;

    [13 lines not shown]
DeltaFile
+76-76llvm/unittests/CodeGen/GlobalISel/KnownFPClassTest.cpp
+32-22llvm/include/llvm/Support/KnownFPClass.h
+21-21llvm/unittests/Target/AArch64/AArch64SelectionDAGTest.cpp
+19-19llvm/unittests/Analysis/ValueTrackingTest.cpp
+13-12llvm/lib/Support/KnownFPClass.cpp
+12-11llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+173-1614 files not shown
+187-17510 files

LLVM/project 289b634lld/MachO SyntheticSections.h SyntheticSections.cpp, lld/docs ReleaseNotes.md

[lld][MachO] Order objc stubs by caller priority (#218732)

__objc_stubs is synthetic, so the input section sorting never reaches
its entries. A stub is faulted in when its caller runs, so stubs called
from hot code end up scattered across pages that startup otherwise never
touches.

Record the sections that branch to each stub, give each stub the lowest
priority among its callers, and stable-sort the stubs before addresses
are assigned. Stubs with no prioritized caller keep their relative order
at the end.

This reduces page faults in __objc_stubs by 40% for a large app.
DeltaFile
+87-0lld/test/MachO/objc-stubs-order-file.s
+60-0lld/test/MachO/objc-stubs-order-file-icf-safe-thunks.s
+41-0lld/MachO/Writer.cpp
+25-7lld/MachO/SyntheticSections.cpp
+6-0lld/MachO/SyntheticSections.h
+4-0lld/docs/ReleaseNotes.md
+223-76 files

LLVM/project 49d043fcompiler-rt/lib/fuzzer FuzzerDriver.cpp FuzzerUtilWindows.cpp

[libFuzzer] [Darwin] Let the kernel kill fuzzers when OOM (#216836)
DeltaFile
+11-0compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp
+5-0compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp
+3-0compiler-rt/lib/fuzzer/FuzzerUtil.h
+2-0compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
+2-0compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
+1-0compiler-rt/lib/fuzzer/FuzzerDriver.cpp
+24-06 files

LLVM/project 7315639flang/lib/Optimizer/Transforms AddDebugInfo.cpp

[flang][debug] Fix build after fir.global linkage became a typed enum (#220280)

#220243 replaced the string `linkName` on `fir.global` with a typed
`fir::LinkageAttr`, so `GlobalOp::getLinkName()` no longer exists.

It landed 46 minutes before #215369 was merged, and the two changes
touch
disjoint sets of files: #220243 never touched `AddDebugInfo.cpp`, and
#215369 added the only `getLinkName()` call in it. They merged cleanly
with
no textual conflict, and main is currently unable to build flang:

```
flang/lib/Optimizer/Transforms/AddDebugInfo.cpp:564:39: error:
  'class fir::GlobalOp' has no member named 'getLinkName';
  did you mean 'getLinkage'?
```

Use the typed accessor, matching what #220243 did for the same idiom in

    [9 lines not shown]
DeltaFile
+2-1flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+2-11 files

LLVM/project fff9753clang/include/clang/Basic BuiltinsNVPTX.td, clang/test/CodeGen builtins-nvptx.c

[Clang][NVPTX] Add sm_107 to SM_Instantiate for NVPTX builtins (#220019)

Add sm_107 to the list of architectures instantiated for NVPTX builtins
in BuiltinsNVPTX.td.

Also add a test invocation with -target-cpu sm_107a to builtins-nvptx.c.
DeltaFile
+3-0clang/test/CodeGen/builtins-nvptx.c
+1-1clang/include/clang/Basic/BuiltinsNVPTX.td
+4-12 files

LLVM/project d8b59c0llvm/lib/Target/AMDGPU SIRegisterInfo.h SIInstrInfo.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.h AMDGPUBaseInfo.cpp

[AMDGPU] Match the AsmParser's operand-side check and share its helper

In the upcoming PR AsmParser performs the same alignment check but differently:
it tests whether a concrete physreg, which carries no regclass, is in the
relaxed operand's regclass.

Change the verifier to work the same way, reusing
AMDGPUBaseInfo::getUnalignedEquivalentRC.

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+87-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+0-15llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+7-6llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+0-10llvm/lib/Target/AMDGPU/SIRegisterInfo.h
+5-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+99-315 files

LLVM/project 73851c2llvm/lib/Target/AMDGPU SIRegisterInfo.h SIRegisterInfo.cpp, llvm/test/CodeGen/AMDGPU verify-gfx90a-aligned-vgprs.mir verify-ds-gws-align.mir

[AMDGPU] Verify VGPR tuple alignment from the operand register class

The machine verifier decided VGPR tuple alignment with isProperlyAlignedRC(),
which inspects only the register's own class. Alignment is not really a property
of the register in isolation: whether a 64-bit tuple must be even-aligned depends
on the operand it feeds, and on mixed-alignment targets the same register class
can be required to be aligned in one operand and exempt in another. Inspecting
only the register also conflates alignment with unrelated problems - a register
that is simply the wrong bank or size for the operand came out as "requires even
aligned vector registers" as well.

Make the operand's register class the source of truth instead: a register is
misaligned only when it does not satisfy the operand's class but its even-aligned
same-bank/width equivalent (SIRegisterInfo::getAlignedEquivalentRC) would. A
register that fits neither is a genuine class or bank mismatch and is left to the
illegal-register and sub-register checks. So an AGPR in a VGPR|SGPR (VS_64)
operand is now reported as an illegal register, and a wrong-size register (e.g. a
64-bit VGPR in a 128-bit MFMA source) or an invalid sub-register index is
reported by those checks alone, no longer doubled up as an "even aligned" error.

    [17 lines not shown]
DeltaFile
+32-38llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+15-0llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+0-10llvm/test/CodeGen/AMDGPU/verify-gfx90a-aligned-vgprs.mir
+0-10llvm/test/CodeGen/AMDGPU/verify-ds-gws-align.mir
+10-0llvm/lib/Target/AMDGPU/SIRegisterInfo.h
+0-4llvm/test/MachineVerifier/AMDGPU/unsupported-subreg-index-aligned-vgpr-check.mir
+57-621 files not shown
+57-647 files

LLVM/project c29c94allvm/test/CodeGen/AMDGPU verify-ds-gws-align.mir verify-gfx90a-aligned-vgprs.mir

[AMDGPU] Restructure VGPR-alignment verifier tests, NFC

Rewrite verify-gfx90a-aligned-vgprs.mir and verify-ds-gws-align.mir so each case
documents inline what makes it invalid, and match the verifier's fuller output -
the "*** Bad machine code ***" kind and the "- instruction:" line - instead of a
single message fragment. Pure test restructure with no functional change, so the
follow-up commit that derives alignment from the operand register class shows
only the change in diagnostic wording.

Co-Authored-By: Claude <noreply at anthropic.com>
DeltaFile
+147-31llvm/test/CodeGen/AMDGPU/verify-gfx90a-aligned-vgprs.mir
+62-26llvm/test/CodeGen/AMDGPU/verify-ds-gws-align.mir
+209-572 files

LLVM/project 012ea23llvm/docs AMDGPUUsage.rst

[AMDGPU][DOC] Fix private address space in CFI documentation (#220274)

The CFI implementation has always used the private wave address space.
Update the documentation, which erroneously referred to the private lane
address space.
DeltaFile
+1-1llvm/docs/AMDGPUUsage.rst
+1-11 files

LLVM/project 10397ecllvm/lib/Target/AMDGPU SIInstrInfo.h SIInstrInfo.cpp, llvm/test/CodeGen/AMDGPU lit.local.cfg

add machine verifier check
DeltaFile
+84-3llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+3-0llvm/lib/Target/AMDGPU/SIInstrInfo.h
+2-0llvm/test/CodeGen/AMDGPU/lit.local.cfg
+89-33 files

LLVM/project 4b0e16cllvm/lib/Target/AMDGPU SIFoldOperands.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.alignbyte.ll true16-fold.mir

fold sgpr32 via vgpr16
DeltaFile
+122-0llvm/test/CodeGen/AMDGPU/true16-fold.mir
+26-58llvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
+57-0llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+4-11llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
+1-3llvm/test/CodeGen/AMDGPU/llvm.amdgcn.alignbyte.ll
+2-2llvm/test/CodeGen/AMDGPU/GlobalISel/fshr-new-regbank-select.ll
+212-741 files not shown
+213-767 files

LLVM/project 80d14dbllvm/test/CodeGen/AMDGPU global-atomicrmw-fsub.ll global-atomicrmw-fmin.ll

fix pattern
DeltaFile
+8,380-0llvm/test/CodeGen/AMDGPU/schedule-amdgpu-trackers.ll
+1,481-1,527llvm/test/CodeGen/AMDGPU/float-to-arbitrary-fp-widen.ll
+542-1,095llvm/test/CodeGen/AMDGPU/global-atomicrmw-fsub.ll
+542-1,095llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmin.ll
+542-1,095llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmax.ll
+542-1,095llvm/test/CodeGen/AMDGPU/global-atomicrmw-fadd.ll
+12,029-5,90760 files not shown
+18,087-14,41766 files

LLVM/project 83acefdllvm/test/CodeGen/AMDGPU global-atomicrmw-fmin.ll global-atomicrmw-fmax.ll, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-llvm.amdgcn.image.sample.a16.ll

calling conv update
DeltaFile
+748-1,428llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll
+1,308-842llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.128bit.ll
+1,248-856llvm/test/CodeGen/AMDGPU/global-atomicrmw-fadd.ll
+1,251-722llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmin.ll
+1,251-722llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmax.ll
+1,251-722llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmin.ll
+7,057-5,292159 files not shown
+22,660-15,893165 files

LLVM/project 8d17da4llvm/test/CodeGen/AMDGPU isel-amdgpu-cs-chain-cc.ll fptoui-sat-scalar.ll, llvm/test/CodeGen/AMDGPU/GlobalISel llvm.amdgcn.raw.tbuffer.store.f16.ll

update test
DeltaFile
+146-218llvm/test/CodeGen/AMDGPU/fptoui-sat-vector.ll
+106-170llvm/test/CodeGen/AMDGPU/gfx-callable-argument-types.ll
+123-131llvm/test/CodeGen/AMDGPU/GlobalISel/llvm.amdgcn.raw.tbuffer.store.f16.ll
+42-89llvm/test/CodeGen/AMDGPU/usubsat.ll
+13-41llvm/test/CodeGen/AMDGPU/fptoui-sat-scalar.ll
+21-27llvm/test/CodeGen/AMDGPU/isel-amdgpu-cs-chain-cc.ll
+451-67611 files not shown
+561-82917 files

LLVM/project 6307808mlir/include/mlir/Dialect/Tosa/IR TosaComplianceData.h.inc, mlir/test/Dialect/Tosa ops.mlir invalid_extension.mlir

[mlir][tosa] Add support for mxfp in TRANSPOSE_CONV2D (#218953)

TOSA Speicifcation changes:
* https://github.com/arm/tosa-specification/pull/65
* https://github.com/arm/tosa-specification/pull/77

Signed-off-by: Jeremy Johnson <jeremy.johnson at arm.com>
DeltaFile
+1,343-2mlir/include/mlir/Dialect/Tosa/IR/TosaComplianceData.h.inc
+20-0mlir/test/Dialect/Tosa/verifier.mlir
+18-0mlir/test/Dialect/Tosa/tosa-validation-version-1p1-valid.mlir
+10-0mlir/test/Dialect/Tosa/tosa-validation-version-1p0-invalid.mlir
+9-0mlir/test/Dialect/Tosa/ops.mlir
+9-0mlir/test/Dialect/Tosa/invalid_extension.mlir
+1,409-26 files

LLVM/project 1b762d3llvm/test/CodeGen/AMDGPU frem.ll fptoui-sat-vector.ll

Legalize sgpr16 in sdag
DeltaFile
+2,231-2,790llvm/test/CodeGen/AMDGPU/minimumnum.bf16.ll
+2,231-2,790llvm/test/CodeGen/AMDGPU/maximumnum.bf16.ll
+1,527-1,576llvm/test/CodeGen/AMDGPU/float-to-arbitrary-fp-widen.ll
+213-220llvm/test/CodeGen/AMDGPU/fptosi-sat-vector.ll
+139-146llvm/test/CodeGen/AMDGPU/fptoui-sat-vector.ll
+144-140llvm/test/CodeGen/AMDGPU/frem.ll
+6,485-7,66270 files not shown
+7,876-9,18676 files

LLVM/project 9218dcbutils/bazel/llvm-project-overlay/llvm BUILD.bazel

Revert "[Bazel] Fixes 16a770d (#220089)" (#220153)
DeltaFile
+0-8utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+0-81 files

LLVM/project 8ac016ellvm/lib/Target/RISCV RISCVSchedule.td RISCVInstrInfoZfh.td, llvm/test/MC/RISCV rvq-zfhmin-invalid.s rvq-zfhmin-valid.s

[RISCV] Add MC support for FCVT.H.Q and FCVT.Q.H (#220176)

According to the
[SPEC](https://github.com/riscv/riscv-isa-manual/blob/e5c0c60fa1fbfcc1d343e314299d15693485f678/src/unpriv/zfh.adoc?plain=1#L77-L82),
`FCVT.Q.H` and `FCVT.H.Q` are available when both the Q and Zfhmin
extensions are present. This commit adds MC support for these
instructions.
DeltaFile
+24-0llvm/test/MC/RISCV/rvq-zfhmin-valid.s
+12-0llvm/test/MC/RISCV/rvq-zfhmin-invalid.s
+10-0llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td
+8-0llvm/lib/Target/RISCV/RISCVSchedule.td
+54-04 files

LLVM/project 937027dflang/lib/Optimizer/Transforms FIRToMemRef.cpp, flang/test/Transforms/FIRToMemRef slice.mlir index-overflow-flags.mlir

[flang] Try to keep overflow flags in `FIRToMemRef::canonicalizeIndex'. (#220127)

The method specifically runs on every `fir.array_coor` subscript. For
`arith.addi` it recursively canonicalizes both operands and then
unconditionally rebuilds the op defaulting flags to `none`. Thus
subscript operand becomes a flagless clone, with the original one left
behind dead. The patch makes a couple of changes: (1) use the original
op if unmodified and (2) when its type preserved keep overflow flags of
the original.

Assisted-by: Claude Opus 5
DeltaFile
+54-0flang/test/Transforms/FIRToMemRef/index-overflow-flags.mlir
+16-5flang/lib/Optimizer/Transforms/FIRToMemRef.cpp
+1-2flang/test/Transforms/FIRToMemRef/slice.mlir
+71-73 files

LLVM/project 3841f50flang/lib/Optimizer/Transforms AddDebugInfo.cpp, flang/test/Integration debug-submodule-procedure.F90 debug-use-stmt.f90

Revert "Reland [flang][debug] Emit debug info for named constants- #213974 (#…"

This reverts commit e0424be5bb143bac25257f42fc2d0e217c5e1895.
DeltaFile
+32-128flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+0-42flang/test/Integration/debug-module-constant.f90
+0-41flang/test/Transforms/debug-local-constant.fir
+0-27flang/test/Transforms/debug-module-constant.fir
+0-24flang/test/Integration/debug-submodule-procedure.F90
+1-23flang/test/Integration/debug-use-stmt.f90
+33-2859 files not shown
+42-40515 files

LLVM/project e0424beflang/lib/Optimizer/Transforms AddDebugInfo.cpp, flang/test/Integration debug-use-stmt.f90 debug-submodule-procedure.F90

Reland [flang][debug] Emit debug info for named constants- #213974 (#215369)

Reland of #213974, which was reverted in #214813 because of #214777.

This is the same as #213974 with a check added to skip a constant for which we only have a declaration. A constant of a user module is still described in the unit defining the module, so nothing is lost there. An intrinsic module has no such unit, so its constants are not described until we emit DW_AT_const_value for them, which can be done separately.

Whether a module is described as a definition or a declaration is now decided up front rather than inferred from whichever member reached getOrCreateModuleAttr first.

Two tests are added: one on the pass, and one checking that the object file has no undefined symbol from iso_fortran_env, which is the case the original change did not cover.
DeltaFile
+128-32flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+42-0flang/test/Integration/debug-module-constant.f90
+41-0flang/test/Transforms/debug-local-constant.fir
+27-0flang/test/Transforms/debug-module-constant.fir
+23-1flang/test/Integration/debug-use-stmt.f90
+24-0flang/test/Integration/debug-submodule-procedure.F90
+285-339 files not shown
+405-4215 files

LLVM/project 07ed92dllvm/include/llvm/Analysis AliasSetTracker.h AliasAnalysis.h, llvm/lib/Analysis AliasSetTracker.cpp

[Analysis] Remove dead declarations in AliasAnalysis and AliasSetTracker (NFC) (#220184)

AAResults::doesNotAccessMemory(const Function *),
AAResults::onlyReadsMemory(const Function *): The last callers were
removed on December 15, 2004 in commits b17f3e13ec7a and 71d04bce5509
when call sites were migrated to getModRefBehavior (later renamed to
getMemoryEffects).

AAResults::canBasicBlockModify(..., const Value *): Added on
September 14, 2010 in commit 41f14cf3e981ca1eb39d087d4c567098ee56514d
without any callers.

AAResults::callCapturesBefore(..., const Value *): Added on May 14, 2012
in commit a968caf8e024c51cb90872fef60cd529043e25d0 without any callers.

AAResults::canInstructionRangeModRef(..., const Value *): Added on
December 15, 2014 in commit a5599bfd7215e6ded1aad312c192f906d473877a
without any callers.


    [3 lines not shown]
DeltaFile
+0-47llvm/include/llvm/Analysis/AliasAnalysis.h
+0-21llvm/lib/Analysis/AliasSetTracker.cpp
+0-2llvm/include/llvm/Analysis/AliasSetTracker.h
+0-703 files

LLVM/project b2ad334flang/lib/Lower/OpenMP Decomposer.cpp

Better handling of missing version attribute
DeltaFile
+3-1flang/lib/Lower/OpenMP/Decomposer.cpp
+3-11 files

LLVM/project 28e2f8fflang/include/flang/Semantics openmp-modifiers.h, flang/lib/Parser openmp-parsers.cpp

Rename getOpenMP to getOpenMPVersion
DeltaFile
+58-58flang/lib/Semantics/check-omp-structure.cpp
+7-7flang/lib/Semantics/resolve-directives.cpp
+6-6flang/lib/Semantics/check-omp-loop.cpp
+8-4flang/lib/Parser/openmp-parsers.cpp
+5-5flang/lib/Semantics/check-omp-variant.cpp
+5-5flang/include/flang/Semantics/openmp-modifiers.h
+89-8513 files not shown
+113-10819 files

LLVM/project 6e960abflang/include/flang/Semantics openmp-modifiers.h openmp-utils.h, flang/lib/Semantics check-omp-loop.cpp resolve-directives.cpp

[flang][OpenMP] Switch OpenMP version from unsigned to llvm::omp::Version

Also make llvm::omp::Version converting constructor/operstor explicit.
DeltaFile
+91-88flang/lib/Semantics/check-omp-structure.cpp
+20-18flang/include/flang/Semantics/openmp-utils.h
+18-17flang/lib/Semantics/openmp-utils.cpp
+10-10flang/include/flang/Semantics/openmp-modifiers.h
+7-7flang/lib/Semantics/resolve-directives.cpp
+6-6flang/lib/Semantics/check-omp-loop.cpp
+152-14621 files not shown
+218-20327 files

LLVM/project 8363414clang/lib/Sema TreeTransform.h

Restore uses of getOpenMPVersion in TreeTransform.h
DeltaFile
+2-2clang/lib/Sema/TreeTransform.h
+2-21 files

LLVM/project 64ec6b8clang/lib/Sema SemaOpenMP.cpp

One more place
DeltaFile
+3-2clang/lib/Sema/SemaOpenMP.cpp
+3-21 files

LLVM/project 9331aa3clang/lib/Sema SemaOpenMP.cpp

format
DeltaFile
+2-2clang/lib/Sema/SemaOpenMP.cpp
+2-21 files

LLVM/project 9caf48bclang/include/clang/Basic LangOptions.h, clang/lib/AST StmtPrinter.cpp DeclPrinter.cpp

Replace getOpenMP with getOpenMPVersion
DeltaFile
+54-53clang/lib/Sema/SemaOpenMP.cpp
+16-15clang/lib/Parse/ParseOpenMP.cpp
+6-3clang/lib/AST/StmtPrinter.cpp
+6-3clang/lib/AST/DeclPrinter.cpp
+3-3clang/lib/Sema/TreeTransform.h
+3-1clang/include/clang/Basic/LangOptions.h
+88-781 files not shown
+89-797 files

LLVM/project 5c58cd7clang/include/clang/AST OpenMPClause.h, clang/lib/AST DeclPrinter.cpp StmtPrinter.cpp

[clang][OpenMP] Switch OpenMP version from unsigned to llvm::omp::Version
DeltaFile
+61-58clang/lib/Sema/SemaOpenMP.cpp
+16-16clang/lib/Parse/ParseOpenMP.cpp
+6-9clang/lib/AST/StmtPrinter.cpp
+4-3clang/lib/Sema/TreeTransform.h
+3-3clang/lib/AST/DeclPrinter.cpp
+3-2clang/include/clang/AST/OpenMPClause.h
+93-912 files not shown
+98-928 files