LLVM/project 525e68eclang/docs ReleaseNotes.rst, clang/lib/Sema TreeTransform.h

Don't mark lambda non-dependent if nested in a generic lambda. (#149121)

Fixes #118187
Fixes #156579

An instantiated `LambdaExpr` can currently be marked as
`LDK_NeverDependent` if it's nested within a generic lambda. If that
`LambdaExpr` in fact depends on template parameters introduced by the
enclosing generic lambda, then its dependence will be misreported as
"never dependent" and spurious diagnostics can result.

The fix here proposed is a bit ugly, but the condition that it's being
bolted onto already seems like a bit of a hack, so this seems no worse
for wear.

Note that #89702 surfaced this change because it caused the inner lambda
expression to (correctly) be considered in a constant-evaluated context.
The affected check for whether to mark the inner lambda as
`LDK_NeverDependent` therefore started to apply, whereas it didn't

    [2 lines not shown]
DeltaFile
+22-1clang/test/SemaCXX/cxx2a-consteval.cpp
+2-0clang/lib/Sema/TreeTransform.h
+1-0clang/docs/ReleaseNotes.rst
+25-13 files

LLVM/project 0859ac5llvm/test/CodeGen/AMDGPU local-atomicrmw-fsub.ll local-atomicrmw-fmin.ll, llvm/test/CodeGen/NVPTX atomics-b128.ll

[RegAlloc] Fix the terminal rule check for interfere with DstReg (#168661)

This maybe a bug which is introduced by commit
6749ae36b4a33769e7a77cf812d7cd0a908ae3b9, and has been present ever
since.
In this case, `OtherReg` always overlaps with `DstReg` cause they from
the `Copy` all.
DeltaFile
+1,382-1,424llvm/test/CodeGen/AMDGPU/local-atomicrmw-fsub.ll
+1,235-1,263llvm/test/CodeGen/AMDGPU/local-atomicrmw-fmin.ll
+1,235-1,263llvm/test/CodeGen/AMDGPU/local-atomicrmw-fmax.ll
+1,158-1,184llvm/test/CodeGen/AMDGPU/local-atomicrmw-fadd.ll
+96-92llvm/test/CodeGen/X86/i128-mul.ll
+75-75llvm/test/CodeGen/NVPTX/atomics-b128.ll
+5,181-5,30149 files not shown
+5,939-6,05655 files

LLVM/project 0ef522fllvm/utils/TableGen DAGISelMatcherEmitter.cpp DAGISelMatcherGen.cpp, llvm/utils/TableGen/Common DAGISelMatcher.h CodeGenDAGPatterns.h

[TableGen] Use MVT instead of MVT::SimpleValueType. NFC (#169180)

This improves type safety and is less verbose. Use SimpleTy only where
an integer is needed like switches or emitting a VBR.

---------

Co-authored-by: Sergei Barannikov <barannikov88 at gmail.com>
DeltaFile
+27-34llvm/utils/TableGen/Common/DAGISelMatcher.h
+31-28llvm/utils/TableGen/DAGISelMatcherEmitter.cpp
+8-11llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
+7-8llvm/utils/TableGen/DAGISelMatcherGen.cpp
+7-8llvm/utils/TableGen/Common/DAGISelMatcher.cpp
+6-8llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+86-9712 files not shown
+122-13718 files

LLVM/project 0619292llvm/utils/TableGen GlobalISelEmitter.cpp DAGISelMatcherGen.cpp, llvm/utils/TableGen/Common CodeGenDAGPatterns.cpp CodeGenDAGPatterns.h

[TableGen] Constify CodeGenInstruction where possible (NFC) (#169193)

DeltaFile
+8-7llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+5-4llvm/utils/TableGen/GlobalISelEmitter.cpp
+4-4llvm/utils/TableGen/DAGISelMatcherGen.cpp
+2-2llvm/utils/TableGen/Common/CodeGenDAGPatterns.h
+2-1llvm/utils/TableGen/Common/GlobalISel/PatternParser.cpp
+1-1llvm/utils/TableGen/FastISelEmitter.cpp
+22-193 files not shown
+25-229 files

LLVM/project 2d051adflang/lib/Semantics canonicalize-do.cpp

[flang] Add missing include, fix build break after c81a189c50 (#169192)

DeltaFile
+1-0flang/lib/Semantics/canonicalize-do.cpp
+1-01 files

LLVM/project 1c05dfbclang/lib/StaticAnalyzer/Checkers CallAndMessageChecker.cpp

[StaticAnalyzer] Use a range-based for loop (NFC) (#169175)

Identified with modernize-loop-convert.
DeltaFile
+2-3clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
+2-31 files

LLVM/project c593993clang/lib/Lex Preprocessor.cpp

[Lex] Use a range-based for loop (NFC) (#169174)

Identified with modernize-loop-convert.
DeltaFile
+2-4clang/lib/Lex/Preprocessor.cpp
+2-41 files

LLVM/project b296386llvm/lib/CodeGen CallingConvLower.cpp, llvm/lib/TextAPI InterfaceFile.cpp

[llvm] Use llvm::equal (NFC) (#169173)

While I am at it, this patch uses const l-value references for
std::shared_ptr.  We don't need to increment the reference count by
passing std::shared_ptr by value.

Identified with llvm-use-ranges.
DeltaFile
+5-6llvm/lib/TextAPI/InterfaceFile.cpp
+1-2llvm/lib/CodeGen/CallingConvLower.cpp
+6-82 files

LLVM/project 637299eclang/lib/Frontend CompilerInvocation.cpp, clang/utils/TableGen NeonEmitter.cpp

[clang] Use llvm::equal (NFC) (#169172)

Identified with llvm-use-ranges.
DeltaFile
+4-7clang/utils/TableGen/NeonEmitter.cpp
+3-4clang/lib/Frontend/CompilerInvocation.cpp
+7-112 files

LLVM/project 9de880ellvm/lib/Transforms/Utils DebugSSAUpdater.cpp, llvm/utils/TableGen/Basic TargetLibraryInfoEmitter.cpp

[llvm] Remove unused local variables (NFC) (#169171)

Identified with bugprone-unused-local-non-trivial-variable.
DeltaFile
+0-1llvm/lib/Transforms/Utils/DebugSSAUpdater.cpp
+0-1llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp
+0-22 files

LLVM/project 7757262flang/lib/Semantics canonicalize-do.cpp

[flang] Add missing include, fix build break after c81a189c50
DeltaFile
+1-0flang/lib/Semantics/canonicalize-do.cpp
+1-01 files

LLVM/project c81a189flang/include/flang/Parser openmp-utils.h, flang/lib/Parser openmp-utils.cpp

[flang][OpenMP] Canonicalize loops with intervening OpenMP constructs (#169191)

Example based on the gfortran test a.6.1.f90
```
  do 100 i = 1,10
  !$omp do
    do 100 j = 1,10
      call work(i,j)
    100 continue
```

During canonicalization of label-DO loops, if the body of an OpenMP
construct ends with a label, treat the label as ending the construct
itself.

This will also allow handling of cases like
```
  do 100 i = 1, 10
  !$omp atomic write

    [2 lines not shown]
DeltaFile
+48-0flang/test/Parser/OpenMP/cross-label-do.f90
+39-0flang/test/Parser/OpenMP/atomic-label-do.f90
+39-0flang/lib/Parser/openmp-utils.cpp
+14-3flang/lib/Semantics/canonicalize-do.cpp
+1-0flang/include/flang/Parser/openmp-utils.h
+141-35 files

LLVM/project 857dd4dflang/include/flang/Parser openmp-utils.h, flang/lib/Parser openmp-utils.cpp

[flang][OpenMP] Canonicalize loops with intervening OpenMP constructs

Example based on the gfortran test a.6.1.f90
```
  do 100 i = 1,10
  !$omp do
    do 100 j = 1,10
      call work(i,j)
    100 continue
```

During canonicalization of label-DO loops, if the body of an OpenMP
construct ends with a label, treat the label as ending the construct
itself.

This will also allow handling of cases like
```
  do 100 i = 1, 10
  !$omp atomic write

    [3 lines not shown]
DeltaFile
+48-0flang/test/Parser/OpenMP/cross-label-do.f90
+39-0flang/test/Parser/OpenMP/atomic-label-do.f90
+39-0flang/lib/Parser/openmp-utils.cpp
+14-3flang/lib/Semantics/canonicalize-do.cpp
+1-0flang/include/flang/Parser/openmp-utils.h
+141-35 files

LLVM/project a2231afllvm/lib/Transforms/Vectorize VPlanUtils.cpp

[VPlan] Share PreservesUniformity logic between isSingleScalar and isUniformAcrossVFsAndUFs

Extract the PreservesUniformity logic from isSingleScalar into a shared
static helper function. Update isUniformAcrossVFsAndUFs to use this
logic for VPWidenRecipe and VPInstruction, so that any opcode that
preserves uniformity is considered uniform-across-vf-and-uf if its
operands are.

This unifies the uniformity checking logic and makes it easier to extend
in the future.

This should effectively by NFC currently.
DeltaFile
+30-22llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+30-221 files

LLVM/project 29d1e18llvm/lib/Target/AMDGPU AMDGPUTargetMachine.cpp SIMachineFunctionInfo.cpp, llvm/test/CodeGen/MIR/AMDGPU preload-kernarg-mfi.ll preload-kernarg-invalid-register-name-error.mir

[AMDGPU] Enable serializing of allocated preload kernarg SGPRs info (#168374)

- Support serialization of the number of allocated preload kernarg SGPRs
- Support serialization of the first preload kernarg SGPR allocated

Together they enable reconstructing correctly MIR with preload kernarg
SGPRs.
DeltaFile
+254-0llvm/test/CodeGen/MIR/AMDGPU/preload-kernarg-mfi.ll
+36-0llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+19-2llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp
+19-0llvm/test/CodeGen/MIR/AMDGPU/preload-kernarg-invalid-register-name-error.mir
+18-0llvm/test/CodeGen/MIR/AMDGPU/preload-kernarg-invalid-register-class-error.mir
+18-0llvm/test/CodeGen/MIR/AMDGPU/preload-kernarg-stack-type-error.mir
+364-27 files not shown
+382-213 files

LLVM/project ebb0c9cflang/include/flang/Parser openmp-utils.h, flang/lib/Parser openmp-parsers.cpp openmp-utils.cpp

[flang][OpenMP] Move some utilities from openmp-parsers to openmp-uti… (#169188)

…ls, NFC
DeltaFile
+0-24flang/lib/Parser/openmp-parsers.cpp
+19-0flang/lib/Parser/openmp-utils.cpp
+10-0flang/include/flang/Parser/openmp-utils.h
+29-243 files

LLVM/project 9ee6fdfflang/include/flang/Parser openmp-utils.h, flang/lib/Parser openmp-parsers.cpp openmp-utils.cpp

[flang][OpenMP] Move some utilities from openmp-parsers to openmp-utils, NFC
DeltaFile
+0-24flang/lib/Parser/openmp-parsers.cpp
+19-0flang/lib/Parser/openmp-utils.cpp
+10-0flang/include/flang/Parser/openmp-utils.h
+29-243 files

LLVM/project d96a93flld/ELF InputFiles.cpp SyntheticSections.cpp, lld/test/ELF version-script-extern-undefined.s

ELF: Use index 0 for unversioned undefined symbols (#168189)

The GNU documentation is ambiguous about the version index for
unversioned undefined symbols. The current specification at
https://sourceware.org/gnu-gabi/program-loading-and-dynamic-linking.txt
defines VER_NDX_LOCAL (0) as "The symbol is private, and is not
available outside this object."

However, this naming is misleading for undefined symbols. As suggested
in
discussions, VER_NDX_LOCAL should conceptually be VER_NDX_NONE and apply
to unversioned undefined symbols as well.

GNU ld has used index 0 for unversioned undefined symbols both before
version 2.35 (see https://sourceware.org/PR26002) and in the upcoming
2.46 release (see https://sourceware.org/PR33577). This change aligns
with GNU ld's behavior by switching from index 1 to index 0.

While here, add a test to dso-undef-extract-lazy.s that undefined
symbols of index 0 in DSO are treated as unversioned symbols.
DeltaFile
+3-2lld/ELF/InputFiles.cpp
+3-2lld/ELF/SyntheticSections.cpp
+2-2llvm/include/llvm/BinaryFormat/ELF.h
+1-1lld/test/ELF/linkerscript/version-script.s
+2-0lld/ELF/Symbols.h
+1-1lld/test/ELF/version-script-extern-undefined.s
+12-86 files

LLVM/project 080ca90llvm/lib/Transforms/Vectorize VPlanTransforms.cpp LoopVectorize.cpp, llvm/unittests/Transforms/Vectorize VPlanHCFGTest.cpp

[VPlan] Create resume phis in scalar preheader early. (NFC) (#166099)

Create phi recipes for scalar resume value up front in addInitialSkeleton during initial construction. This will allow moving the remaining code dealing with resume values to VPlan transforms/construction.

PR: https://github.com/llvm/llvm-project/pull/166099
DeltaFile
+20-27llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+3-14llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+6-6llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+9-0llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+4-2llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
+4-1llvm/lib/Transforms/Vectorize/VPlan.h
+46-501 files not shown
+48-527 files

LLVM/project bac88b5llvm/lib/Target/AArch64 AArch64InstrInfo.td

[AArch64] Mark FMOVvXfY_ns as rematerializable, cheap

Otherwise, the register allocator may spill and reload constants that
can be rematerialized with a single instruction.
DeltaFile
+2-0llvm/lib/Target/AArch64/AArch64InstrInfo.td
+2-01 files

LLVM/project 4294d6allvm/test/CodeGen/AMDGPU shufflevector.v4p0.v4p0.ll shufflevector.v4i64.v4i64.ll, llvm/test/tools/llvm-dwarfdump/X86 simplified-template-names.s

remove test change, which was pre-committed

Created using spr 1.3.5-bogner
DeltaFile
+5,975-8,879llvm/test/CodeGen/AMDGPU/shufflevector.v4p0.v4p0.ll
+5,975-8,879llvm/test/CodeGen/AMDGPU/shufflevector.v4i64.v4i64.ll
+7,387-7,087llvm/test/tools/llvm-dwarfdump/X86/simplified-template-names.s
+5,500-8,716llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+3,880-6,644llvm/test/CodeGen/AMDGPU/shufflevector.v4p0.v3p0.ll
+3,880-6,644llvm/test/CodeGen/AMDGPU/shufflevector.v4i64.v3i64.ll
+32,597-46,8493,191 files not shown
+205,763-176,0803,197 files

LLVM/project e83cc89flang/lib/Parser openmp-parsers.cpp

[flang][OpenMP] Fix build with gcc 7.5.0 (#169184)

DeltaFile
+1-1flang/lib/Parser/openmp-parsers.cpp
+1-11 files

LLVM/project 7e275f8flang/lib/Parser openmp-parsers.cpp

[flang][OpenMP] Fix build with gcc 7.5.0
DeltaFile
+1-1flang/lib/Parser/openmp-parsers.cpp
+1-11 files

LLVM/project 1f865ebllvm/lib/Passes PassBuilderPipelines.cpp, llvm/test/Other new-pm-thinlto-postlink-defaults.ll new-pm-thinlto-postlink-pgo-defaults.ll

Revert "Revert "[DFAJumpThreading] Enable DFAJumpThread by default." (#167352)"

This reverts commit 7e043364cf1f267380b2be955901b28ede9ca8eb.
DeltaFile
+1-1llvm/lib/Passes/PassBuilderPipelines.cpp
+1-0llvm/test/Other/new-pm-thinlto-postlink-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-postlink-samplepgo-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-prelink-defaults.ll
+1-0llvm/test/Other/new-pm-thinlto-prelink-pgo-defaults.ll
+6-12 files not shown
+8-18 files

LLVM/project 8baa5bfllvm/lib/Transforms/Scalar DFAJumpThreading.cpp, llvm/test/Transforms/DFAJumpThreading dfa-jump-threading-transform.ll dfa-jump-threading-analysis.ll

[DFAJumpThreading] Try harder to avoid cycles in paths. (#169151)

If a threading path has cycles within it then the transformation is not
correct. This patch fixes a couple of cases that create such cycles.

Fixes https://github.com/llvm/llvm-project/issues/166868
DeltaFile
+136-0llvm/test/Transforms/DFAJumpThreading/dfa-jump-threading-transform.ll
+77-0llvm/test/Transforms/DFAJumpThreading/dfa-jump-threading-analysis.ll
+10-1llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
+223-13 files

LLVM/project e37a530flang/test/Semantics/OpenMP loop-transformation-construct03.f90

Update loop-transformation-construct03.f90
DeltaFile
+0-1flang/test/Semantics/OpenMP/loop-transformation-construct03.f90
+0-11 files

LLVM/project 4a0b1a0flang/test/Semantics/OpenMP loop-transformation-construct02.f90

Update loop-transformation-construct02.f90
DeltaFile
+0-1flang/test/Semantics/OpenMP/loop-transformation-construct02.f90
+0-11 files

LLVM/project 1dd9d2bclang/lib/CIR/CodeGen CIRGenBuiltin.cpp, libcxx/test/std/utilities/any/any.nonmembers/any.cast any_cast_reference.pass.cpp

Merge branch 'main' into users/kparzysz/n03-invalid-directive
DeltaFile
+1,005-1,005llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+498-488llvm/test/Analysis/CostModel/AMDGPU/shufflevector.ll
+705-88clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
+28-592llvm/lib/Analysis/DependenceAnalysis.cpp
+387-219llvm/lib/ExecutionEngine/Orc/Debugging/ELFDebugObjectPlugin.cpp
+235-238libcxx/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+2,858-2,630275 files not shown
+8,309-5,991281 files

LLVM/project c2d659bflang/lib/Parser openmp-parsers.cpp parse-tree.cpp, flang/lib/Semantics canonicalize-omp.cpp check-omp-loop.cpp

[flang][OpenMP] Implement loop nest parser (#168884)

Previously, loop constructs were parsed in a piece-wise manner: the
begin directive, the body, and the end directive were parsed separately.
Later on in canonicalization they were all coalesced into a loop
construct. To facilitate that end-loop directives were given a special
treatment, namely they were parsed as OpenMP constructs. As a result
syntax errors caused by misplaced end-loop directives were handled
differently from those cause by misplaced non-loop end directives.

The new loop nest parser constructs the complete loop construct,
removing the need for the canonicalization step. Additionally, it is the
basis for parsing loop-sequence-associated constructs in the future.

It also removes the need for the special treatment of end-loop
directives. While this patch temporarily degrades the error messaging
for misplaced end-loop directives, it enables uniform handling of any
misplaced end-directives in the future.
DeltaFile
+185-8flang/lib/Parser/openmp-parsers.cpp
+0-189flang/lib/Semantics/canonicalize-omp.cpp
+78-1flang/lib/Semantics/check-omp-loop.cpp
+22-18flang/test/Semantics/OpenMP/loop-transformation-construct01.f90
+15-21flang/test/Semantics/OpenMP/loop-association.f90
+27-8flang/lib/Parser/parse-tree.cpp
+327-24514 files not shown
+356-27220 files

LLVM/project 216e85bmlir/python requirements.txt, mlir/python/mlir/dialects/linalg/opdsl/lang yaml_helper.py

[MLIR][Python] remove PyYAML as a dep (#169145)

PyYAML is not an actual use-time/runtime dependency of our bindings. It
is necessary only if someone wants to regenerate
`LinalgNamedStructuredOps.yaml`:
https://github.com/llvm/llvm-project/blob/93097b2d47c87bf5eee0a2612d961c7a01831eab/mlir/tools/mlir-linalg-ods-gen/update_core_linalg_named_ops.sh.in#L29

This PR does the minimal refactor to remove the need during actual run/use time.
DeltaFile
+41-25mlir/python/mlir/dialects/linalg/opdsl/lang/yaml_helper.py
+4-2mlir/python/requirements.txt
+45-272 files