LLVM/project 9da250cflang/lib/Semantics resolve-names.cpp, flang/test/Lower/OpenACC acc-host-data-cuda-host-assoc.f90

[flang][cuda][openacc] Fix OpenACC use_device host association symbol copies (#194705)

When a use_device object comes from host association, the OpenACC
construct scope may already contain a HostAssocDetails symbol. Reusing
that symbol prevents semantics from applying the CUDA DEVICE attribute,
because the copied symbol is not an object entity. The fix materializes
the expected host-associated symbol in the containing scope, then
replaces the OpenACC-scope symbol with an ObjectEntityDetails copy that
can carry the device attribute.

This allows generic resolution and lowering to see the device version
inside the host_data construct while preserving the host-associated
binding needed by lowering.
DeltaFile
+29-11flang/lib/Semantics/resolve-names.cpp
+24-0flang/test/Lower/OpenACC/acc-host-data-cuda-host-assoc.f90
+53-112 files

LLVM/project 353935bclang/lib/CIR/Dialect/Transforms LoweringPrepare.cpp

Simplify `RegisterFunction` call on target divergance
DeltaFile
+8-12clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+8-121 files

LLVM/project 6283decllvm/lib/DWARFLinker/Parallel DWARFLinkerCompileUnit.cpp DIEAttributeCloner.cpp, llvm/test/tools/dsymutil null-die.test

[DWARFLinker] Treat NULL DIE references as resolution failures in parallel (#195363)

CompileUnit::resolveDIEReference returned whatever getDIEIndexForOffset
pointed at, even when the entry was a NULL tombstone. The classic linker
checks DWARFDie::isNULL(). Mirror that here so callers get std::nullopt
and warn.

Also fix the "cann't" typo at the two warning sites to match classic,
and enable `--linker parallel` in null-die.test.
DeltaFile
+14-4llvm/lib/DWARFLinker/Parallel/DWARFLinkerCompileUnit.cpp
+2-1llvm/test/tools/dsymutil/null-die.test
+1-1llvm/lib/DWARFLinker/Parallel/DIEAttributeCloner.cpp
+1-1llvm/lib/DWARFLinker/Parallel/DependencyTracker.cpp
+18-74 files

LLVM/project 1f83fdbllvm/test/tools/llvm-profgen filter-build-id.test, llvm/test/tools/llvm-profgen/Inputs buildid-cs-noprobe.aggperfscript buildid-cs-noprobe.perfscript

Revert "[llvm-profgen] Support [buildid:]0xaddr format in perfscript input" (#195551)

Reverts llvm/llvm-project#190863 due to buildbot breakage e.g.,
https://lab.llvm.org/buildbot/#/builders/52/builds/16951

```
Failed Tests (1):
  LLVM :: tools/llvm-profgen/filter-build-id.test
```
```
==llvm-profgen==3809550==ERROR: AddressSanitizer: container-overflow on address 0x6e80441e1762 at pc 0x6216c3f2cdce bp 0x7fff3c3ddf60 sp 0x7fff3c3dd710
READ of size 8 at 0x6e80441e1762 thread T0
    #0 0x6216c3f2cdcd in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long) /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:848:7
    #1 0x6216c3f2d25c in bcmp /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:894:10
    #2 0x6216c400b836 in operator== /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/StringRef.h:914:10
    #3 0x6216c400b836 in operator!= /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/include/llvm/ADT/StringRef.h:917:69
    #4 0x6216c400b836 in llvm::sampleprof::PerfScriptReader::extractCallstack(llvm::sampleprof::TraceStream&, llvm::SmallVectorImpl<unsigned long>&) /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/tools/llvm-profgen/PerfReader.cpp:801:36
    #5 0x6216c400d37a in llvm::sampleprof::HybridPerfReader::parseSample(llvm::sampleprof::TraceStream&, unsigned long) /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/tools/llvm-profgen/PerfReader.cpp:881:8
    #6 0x6216c40150d8 in parseSample /home/b/sanitizer-x86_64-linux-bootstrap-asan/build/llvm-project/llvm/tools/llvm-profgen/PerfReader.cpp:1118:3

    [31 lines not shown]
DeltaFile
+13-58llvm/tools/llvm-profgen/PerfReader.cpp
+0-57llvm/test/tools/llvm-profgen/filter-build-id.test
+0-11llvm/test/tools/llvm-profgen/Inputs/buildid-cs-noprobe.aggperfscript
+0-9llvm/test/tools/llvm-profgen/Inputs/buildid-cs-noprobe.perfscript
+13-1354 files

LLVM/project 2dccc37lld/test/ELF riscv-reloc-rvc.s riscv-reloc-add.s

[test] Cover R_RISCV_ADD/SUB and R_RISCV_RVC_{BRANCH,JUMP} (#195555)

These were uncovered according to an LLVM_BUILD_INSTRUMENTED_COVERAGE
build.

llvm-mc resolves `.L1 - .L0` differences at assembly time, so
riscv-reloc-add.s doesn't emit the R_RISCV_ADD*/R_RISCV_SUB* pairs it
was meant to test.

Add riscv-reloc-rvc.s, modeled on riscv-branch.s/riscv-jal.s, to
exercise R_RISCV_RVC_BRANCH and R_RISCV_RVC_JUMP. Drive offsets via
-Ttext + --defsym to land precise values that isolate complementary
extractBits groups.
DeltaFile
+48-0lld/test/ELF/riscv-reloc-rvc.s
+11-4lld/test/ELF/riscv-reloc-add.s
+59-42 files

LLVM/project 92e2dfbclang/lib/CIR/CodeGen CIRGenBuiltinNVPTX.cpp, clang/test/CIR/CodeGenBuiltins/NVPTX builtins-nvptx-sync.cu builtins-sm90.cu

[CIR][NVPTX] Implement sync and cluster barrier builtins
DeltaFile
+30-33clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.cpp
+45-0clang/test/CIR/CodeGenBuiltins/NVPTX/builtins-nvptx-sync.cu
+44-0clang/test/CIR/CodeGenBuiltins/NVPTX/builtins-sm90.cu
+119-333 files

LLVM/project 4adca7eclang/lib/CIR/CodeGen CIRGenBuiltinNVPTX.cpp

fix fmt
DeltaFile
+4-6clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.cpp
+4-61 files

LLVM/project 7287ab0clang/lib/CIR/CodeGen CIRGenBuiltinNVPTX.cpp CIRGenBuiltin.cpp

Address comments and add missing OG builtins.
DeltaFile
+68-0clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.cpp
+2-1clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
+70-12 files

LLVM/project 1b1af5allvm/test/tools/llvm-profgen filter-build-id.test, llvm/test/tools/llvm-profgen/Inputs buildid-cs-noprobe.aggperfscript buildid-cs-noprobe.perfscript

Revert "[llvm-profgen] Support [buildid:]0xaddr format in perfscript input (#…"

This reverts commit 8f46a9db2fd043c790a2eb579196c71778884053.
DeltaFile
+13-58llvm/tools/llvm-profgen/PerfReader.cpp
+0-57llvm/test/tools/llvm-profgen/filter-build-id.test
+0-11llvm/test/tools/llvm-profgen/Inputs/buildid-cs-noprobe.aggperfscript
+0-9llvm/test/tools/llvm-profgen/Inputs/buildid-cs-noprobe.perfscript
+13-1354 files

LLVM/project 7608c5fclang/test/CXX/drs cwg26xx.cpp, clang/www cxx_dr_status.html

[clang][NFC] Mark CWG2629 as implemented and add a test (#195490)

This is ill-formed:
```cpp
switch (0.0) {}
```
Before [CWG2629](https://wg21.link/cwg2629) though, this was allowed:
```cpp
switch (double d = 0.0) {} // Value of 'd' is implicitly converted to an integer
```
Clang however has always rejected both: https://godbolt.org/z/GYc4hhrnz
DeltaFile
+7-0clang/test/CXX/drs/cwg26xx.cpp
+1-1clang/www/cxx_dr_status.html
+8-12 files

LLVM/project e8a85b2lld/ELF InputSection.h Target.h

[ELF] Remove unused functions. NFC (#195546)
DeltaFile
+0-5lld/ELF/InputSection.h
+0-1lld/ELF/Target.h
+0-62 files

LLVM/project 441a18dclang-tools-extra/clang-tidy/modernize UseUsingCheck.cpp, clang-tools-extra/docs ReleaseNotes.rst

[clang-tidy] Preserve typedef comments in `modernize-use-using` (#180372)

Keep comment blocks between the typedef type and name by capturing the
raw lexer range and avoid injecting unrelated tokens into the
replacement.

Fixes https://github.com/llvm/llvm-project/issues/159518.
DeltaFile
+283-49clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp
+67-0clang-tools-extra/test/clang-tidy/checkers/modernize/use-using.cpp
+6-2clang-tools-extra/docs/ReleaseNotes.rst
+356-513 files

LLVM/project 268813dlld/ELF Symbols.cpp, lld/test/ELF symbol-ordering-file-warnings.s

[ELF] maybeWarnUnorderableSymbol: drop redundant `d &&`, assert isShared. NFC (#195543)

Test Defined first via dyn_cast. Lazy/Common/Placeholder cannot reach
here: readCallGraph runs after replaceCommonSymbols, buildSectionOrder
runs after demoteSymbolsAndComputeIsPreemptible, and redirectSymbols
detaches Placeholder foo at v1 stubs from objectFiles.

In symbol-ordering-file-warnings.s, add a common-symbol case and use
`count 0` for empty-output checks.
DeltaFile
+13-11lld/test/ELF/symbol-ordering-file-warnings.s
+11-11lld/ELF/Symbols.cpp
+24-222 files

LLVM/project d362f21llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer sincos.ll

Small improvements

Created using spr 1.3.7
DeltaFile
+62-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+14-28llvm/test/Transforms/SLPVectorizer/sincos.ll
+76-292 files

LLVM/project 92a10f4lld/ELF Symbols.cpp, lld/test/ELF common-shared.s

[ELF] Simplify checkDuplicate; cover SharedSymbol/CommonSymbol resolve. NFC (#195541)

Drop the redundant isDefined() check.

Extend common-shared.s to also exercise the case where the
SharedSymbol's
st_size is not larger than the incoming CommonSymbol's.
DeltaFile
+19-7lld/test/ELF/common-shared.s
+1-1lld/ELF/Symbols.cpp
+20-82 files

LLVM/project 928b14bllvm/lib/Target/AVR AVRISelDAGToDAG.cpp AVRAsmPrinter.cpp, llvm/test/CodeGen/AVR issue-167244.ll

[AVR] Fix selecting inline assembly operands (#195066)
DeltaFile
+33-0llvm/test/CodeGen/AVR/issue-167244.ll
+10-0llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp
+7-1llvm/lib/Target/AVR/AVRAsmPrinter.cpp
+50-13 files

LLVM/project aec3ce0clang/docs UndefinedBehaviorSanitizer.rst, compiler-rt/include/sanitizer ubsan_interface.h

[compiler-rt][UBSan] Add __ubsan_default_suppressions() hook (#194862)

In line with commit 5c62af5 and 83566da.

Assisted-by: Gemini

---------

Co-authored-by: Vitaly Buka <vitalybuka at google.com>
DeltaFile
+24-0compiler-rt/test/ubsan/TestCases/Misc/Posix/ubsan_suppressions.cpp
+10-0clang/docs/UndefinedBehaviorSanitizer.rst
+8-0compiler-rt/include/sanitizer/ubsan_interface.h
+7-0compiler-rt/lib/ubsan/ubsan_diag.cpp
+4-0compiler-rt/lib/ubsan/ubsan_flags.h
+1-0llvm/utils/gn/secondary/compiler-rt/lib/ubsan/BUILD.gn
+54-04 files not shown
+58-010 files

LLVM/project 739e513llvm/test/Transforms/SLPVectorizer/X86 arith-sub-usubo.ll arith-sub-ssubo.ll

Rebase, improves vectorization of extractvalues with vec calls

Created using spr 1.3.7
DeltaFile
+248-2,746llvm/test/Transforms/SLPVectorizer/X86/arith-sub-usubo.ll
+248-2,746llvm/test/Transforms/SLPVectorizer/X86/arith-sub-ssubo.ll
+248-2,746llvm/test/Transforms/SLPVectorizer/X86/arith-add-uaddo.ll
+248-2,746llvm/test/Transforms/SLPVectorizer/X86/arith-add-saddo.ll
+326-843llvm/test/Transforms/SLPVectorizer/X86/arith-mul-umulo.ll
+354-587llvm/test/Transforms/SLPVectorizer/X86/arith-mul-smulo.ll
+1,672-12,4141 files not shown
+1,752-12,4157 files

LLVM/project 0af78eeclang/test/Headers __clang_hip_math.hip, llvm/include/llvm/IR Instruction.h

[IR] Drop parameter attributes (#195516)

Previously `dropPoisonGeneratingReturnAttributes` only considers
poison-generating attributes on return values. However, it is not enough
as shown in
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/245/files.

This patch also drops parameter attributes, as
`dropUBImplyingAttrsAndMetadata` does.

IR diff shows this patch doesn't block existing transformations:
https://github.com/dtcxzyw/llvm-opt-benchmark-nightly/pull/246
Compile-time impact looks neutral:
https://llvm-compile-time-tracker.com/compare.php?from=d184d9ad0e9f7f34f05d88b7245e7a9a248b245b&to=cdc17034e313657bfd87936e01fa21abd55e184a&stat=instructions:u
DeltaFile
+16-8llvm/lib/IR/Instruction.cpp
+7-8llvm/include/llvm/IR/Instruction.h
+3-2clang/test/Headers/__clang_hip_math.hip
+2-2llvm/test/Transforms/InstCombine/ispow2.ll
+1-1llvm/lib/IR/Operator.cpp
+29-215 files

LLVM/project 35c7191mlir/include/mlir/Analysis/Presburger Matrix.h, mlir/lib/Analysis/Presburger Matrix.cpp

[MLIR][Presburger] Conversion between Int- and FracMatrix (#192822)

A straightforward conversion between `IntMatrix` and `FracMatrix`. This
is one further preparation PR.

The next step for upstreaming is to find a particular solution `x` to
the system `Ax = Bp + C`, which might contain fractions while `A`, `B`
and `C` are IntMatrices. That's the reason we need these conversion
helpers.

---------

Co-authored-by: Arjun Pitchanathan <arjunpitchanathan at gmail.com>
DeltaFile
+18-0mlir/lib/Analysis/Presburger/Matrix.cpp
+8-0mlir/include/mlir/Analysis/Presburger/Matrix.h
+26-02 files

LLVM/project becb707llvm/include/llvm/ADT FoldingSet.h ImmutableSet.h, llvm/lib/IR Intrinsics.cpp

Rebase, address comments

Created using spr 1.3.7
DeltaFile
+214-184llvm/test/CodeGen/X86/subcarry.ll
+94-105llvm/include/llvm/ADT/FoldingSet.h
+61-69llvm/include/llvm/ADT/ImmutableSet.h
+52-0llvm/test/Transforms/SLPVectorizer/X86/shuffled-gathered-vectors.ll
+31-13llvm/lib/IR/Intrinsics.cpp
+36-7llvm/utils/TableGen/Basic/CodeGenIntrinsics.cpp
+488-37831 files not shown
+719-62437 files

LLVM/project 6f2deabllvm/include/llvm/CodeGen SelectionDAGNodes.h, llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp

[SelectionDAG][NFC] Add function for `peekThroughFreeze` (#195324)

There are a few callsites in SelectionDAG and DAGCombiner where it is
necessary to look through an `ISD::FREEZE` to unblock some optimization
and folds. This patch introduces `peekThroughFreeze` and
`peekThroughOneUseFreeze` utility functions to cleanup the repeated sites.
DeltaFile
+16-0llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+1-6llvm/lib/Target/X86/X86ISelLowering.cpp
+1-3llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+1-3llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+1-1llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+20-135 files

LLVM/project 2ae0fbbclang/docs ReleaseNotes.rst, clang/lib/Sema SemaTemplateInstantiate.cpp

[Clang][ItaniumMangle] Preserve field-name closure-prefix for instantiated lambdas (#195340)

Previously, instantiation did not pass `LambdaContextDecl`, so the NSDMI
lambda in the class template used the wrong `ContextDecl`.

Fixes: #190555
DeltaFile
+2-2clang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp
+3-0clang/docs/ReleaseNotes.rst
+2-1clang/lib/Sema/SemaTemplateInstantiate.cpp
+1-1clang/test/CodeGenCXX/dtor-local-lambda-mangle.cpp
+8-44 files

LLVM/project 58eadc4clang/include/clang/AST DeclCXX.h, clang/lib/AST DeclCXX.cpp

[clang][AST][NFC] Simplify ExplicitSpecifier (#193984)

One overload of each of these functions is all that is needed.
DeltaFile
+5-16clang/include/clang/AST/DeclCXX.h
+2-2clang/lib/AST/DeclCXX.cpp
+7-182 files

LLVM/project 6d97082clang/lib/AST/ByteCode Interp.cpp, clang/test/AST/ByteCode lifetimes.cpp

[clang][bytecode] Fix an assertion for composite array roots (#195530)

The assertion only holds if the array is primitive.
DeltaFile
+11-4clang/test/AST/ByteCode/lifetimes.cpp
+3-2clang/lib/AST/ByteCode/Interp.cpp
+14-62 files

LLVM/project 2ae4f5allvm/test/Transforms/SLPVectorizer/X86 buildvector-store-chains.ll

[SLP][NFC] Pre-commit tests for build-vector stores in store chains (#195531)

These tests exercise SLP store-chain handling when an explicit
build-vector store (a chain of insertelements stored to memory) is
interleaved with scalar stores at adjacent addresses. The CHECK lines
reflect current behavior:

- buildvector_store_middle: vector store sits in the middle of the
chain.
  SLP currently leaves it intact and packs the surrounding scalars into
  a narrower <2 x float> + scalar tail mix.

- buildvector_store_start / buildvector_store_end: vector store sits at
  the start/end of the chain. SLP already combines the adjacent scalar
  stores into a clean <4 x float> store, so these are regression cases
  that should remain unchanged.

- buildvector_store_duplicate_offset: scalar stores at the same address
  bracket the vector store; SLP keeps the chain split.

A follow-up patch updates the CHECK lines for the cases that change.
DeltaFile
+191-0llvm/test/Transforms/SLPVectorizer/X86/buildvector-store-chains.ll
+191-01 files

LLVM/project c4aba56llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/X86 shuffled-gathered-vectors.ll

[SLP][REVEC] Replace all uses of direct gather scalar operands

When ReVec gather inserts a tree-vector scalar V directly as a
shufflevector operand (poison-vector path of createInsertVector), the
existing per-User external use only rewrites V's use inside that one
shufflevector. Other in-IR uses of V are left untouched and trigger
the "Deleting out-of-tree value" assertion in vectorizeTree when V's
tree entry is erased.

Register an additional nullptr-User external use so V's remaining
uses are rewritten via replaceAllUsesWith.

Fixes #195425

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/195536
DeltaFile
+52-0llvm/test/Transforms/SLPVectorizer/X86/shuffled-gathered-vectors.ll
+9-0llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+61-02 files

LLVM/project 8cc0907llvm/test/CodeGen/X86 subcarry.ll

[X86] subcarry.ll - regenerate to show stack math and missing AVX512 codegen (#195524)
DeltaFile
+214-184llvm/test/CodeGen/X86/subcarry.ll
+214-1841 files

LLVM/project 2a2348eclang/test/Format clang-format-ignore.cpp list-ignored.cpp, clang/tools/clang-format ClangFormat.cpp

[clang-format] Honor later negated .clang-format-ignore patterns (#195432)

This addresses (#178344).
In this issue the negation (`!`) for paths inside .clang-format-ignore
doesn't behave as intended, as clang-format stops processing patterns on
the first match, rather than processing further rules/patterns.
Rather than 
```
foo/*
!foo/*.h
```
un-ignoring `.h`-files in `foo/` - the header-files remain ignored,
since the ignore-condition exits early and considers the files ignored
when checking `foo/*`.

I've tried to make negation work with the old behaviour (like mentioned
in #178344), but could find no sensible way to use it.
From the draft/proposal of .clang-format-ignore (#52975) it looks like
the intent of the negation pattern was to behave similar to .gitignore -

    [8 lines not shown]
DeltaFile
+38-0clang/test/Format/clang-format-ignore.cpp
+11-0clang/test/Format/list-ignored.cpp
+4-3clang/tools/clang-format/ClangFormat.cpp
+53-33 files

LLVM/project 26b8316clang/docs ClangFormatStyleOptions.rst, clang/include/clang/Format Format.h

[clang-format][docs] Clarify AllowShortFunctionsOnASingleLine deprecation (#195491)

Addresses #195326.
DeltaFile
+4-8clang/docs/ClangFormatStyleOptions.rst
+4-8clang/include/clang/Format/Format.h
+8-162 files