LLVM/project 4e3a074llvm/lib/Transforms/Utils SimplifyCFG.cpp, llvm/test/Transforms/SimplifyCFG/X86 switch-to-lookup-comdat.ll

[SimplifyCFG] Reuse function comdat for switch lookup table (#190995)

Fixes #190994.

As the switch table is extracted from the function, the table should be
removed when the function is removed, and therefore inherits the comdat
of the function.
DeltaFile
+58-0llvm/test/Transforms/SimplifyCFG/X86/switch-to-lookup-comdat.ll
+1-0llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+59-02 files

LLVM/project cb961d3llvm/lib/Analysis ValueTracking.cpp, llvm/lib/CodeGen/GlobalISel GISelValueTracking.cpp

[ValueTracking][KnownFPClass] Cover known no-infinity cases for powi (#191736)

Teach `computeKnownFPClass` to infer non-infinity cass for `powi`.

Rules out `inf` for `powi(x, exp)` when:
- `x ?= inf` && `exp > 0`
- `x ?= +/-0` && `exp < 0`
- `x ?= finite` && `|exp| > 1`
- `x ?= subnormal` && `exp ?= -1` (special asym case after |exp| > 1)

where `?=` is maybe equal.

It's a bit conservative, and we could refine it further, but I'd take an
iterative improvement.
DeltaFile
+74-4llvm/unittests/CodeGen/GlobalISel/KnownFPClassTest.cpp
+68-0llvm/unittests/Analysis/ValueTrackingTest.cpp
+52-0llvm/test/Transforms/Attributor/nofpclass-powi.ll
+35-1llvm/lib/Support/KnownFPClass.cpp
+16-4llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
+14-5llvm/lib/Analysis/ValueTracking.cpp
+259-146 files

LLVM/project da8abd8llvm/lib/DebugInfo/LogicalView/Core LVCompare.cpp

[llvm][DebugInfo] Use formatv in LVCompare (#192001)

This relates to #35980.
DeltaFile
+2-2llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp
+2-21 files

LLVM/project 0f2afdeclang/lib/Sema SemaOpenACC.cpp, clang/test/SemaOpenACC routine-construct-clauses.cpp

[OpenACC] Fix invalid routine case where 'bind' didn't exist (#192270)

For some reason I'd failed to check the result of `find_if` and just
assumed that the `bind` clause must exist! Looking through my other
tests, I've validated every other combination other than this one for
some reason.

Fixes: #192245
DeltaFile
+30-27clang/lib/Sema/SemaOpenACC.cpp
+11-0clang/test/SemaOpenACC/routine-construct-clauses.cpp
+41-272 files

LLVM/project 54ae11dclang/test/CXX/drs cwg31xx.cpp, clang/www cxx_dr_status.html

[Clang][NFC] Mark 3106 as implemented. (#192256)

This was a wording clarification, but we add a test nonetheless.
DeltaFile
+16-0clang/test/CXX/drs/cwg31xx.cpp
+1-1clang/www/cxx_dr_status.html
+17-12 files

LLVM/project e0f5ad7clang/docs ReleaseNotes.rst, clang/lib/Sema SemaOverload.cpp

[Clang] Fix handling of overloads differing only by constraints and ref-qualifiers (#192018)

We should only error about inconsistent qualifiers if the functions are
actually overloads.

Fixes #120812
DeltaFile
+17-9clang/lib/Sema/SemaOverload.cpp
+11-0clang/test/CXX/drs/cwg24xx.cpp
+1-0clang/docs/ReleaseNotes.rst
+29-93 files

LLVM/project 0bced21llvm/tools/llvm-jitlink llvm-jitlink.cpp llvm-jitlink.h

[llvm-jitlink] Hold Session::ObjLayer by unique_ptr. (#192253)

This will simplify the Session construction process when we remove
jitlink::JITLinkMemoryManager ownership from ExecutorProcessControl in
an upcoming patch.

(Reason: ObjectLinkingLayer's constructor will require a
JITLinkMemoryManager, which we'll want to cerate after the
ExecutionSession has been initialized. Creating a JITLinkMemoryManager
is generally a fallible operation, so we want to be able to bail on
construction of the ObjectLinkingLayer entirely if we can't create a
memory manager for it).
DeltaFile
+26-24llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+2-2llvm/tools/llvm-jitlink/llvm-jitlink.h
+1-1llvm/tools/llvm-jitlink/llvm-jitlink-statistics.cpp
+29-273 files

LLVM/project f194504llvm/lib/Target/AMDGPU AMDGPURegBankLegalizeRules.cpp, llvm/test/CodeGen/AMDGPU buffer-fat-pointers-memcpy.ll

[AMDGPU][GlobalISel] Implement missing rules for G_TRUNC legalization (#180647)

Implement G_TRUNC (result, source) register bank rules for sizes {32,
64, 96, 128, 160, 256, 512} with two generic wildcard rules using
UniBRC/DivBRC predicates and SgprBRC/VgprBRC apply IDs.
DeltaFile
+210-196llvm/test/CodeGen/AMDGPU/buffer-fat-pointers-memcpy.ll
+398-0llvm/test/CodeGen/AMDGPU/GlobalISel/trunc-brc.ll
+5-3llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp
+613-1993 files

LLVM/project e2195ffclang/test/Analysis bstring.c

[analyzer] Fix 'bstring.c' test on Mingw (#192252)

Addresses
https://github.com/llvm/llvm-project/pull/191061#issuecomment-4250948488

Co-authored-by: Martin Storsjö <martin at martin.st>
DeltaFile
+1-1clang/test/Analysis/bstring.c
+1-11 files

LLVM/project b9077c8lldb/docs/_ext lldb_setting.py build_include.py, lldb/scripts gen-property-docs-from-json.py

[lldb][Docs] Fix presentation of some default values (#192239)

There were two bugs with the display of default values:

1. If a default value contains a backtick, that would render
incorrectly. For example
[`disassembly-format`](https://lldb.llvm.org/use/settings.html#disassembly-format).
Fixed by doing the wrapping when we generate the Markdown instead of
when parsing the directive. MyST will already parse the content of the
directive as Markdown. We can escape backticks inside the string by
changing the fence. Markdown can take any number of backticks at the
start as long as they match the amount at the end
([spec](https://spec.commonmark.org/0.31.2/#code-spans)).
2. When the docs were built on Windows, UTF-8 was not correctly picked
up, because the default encoding isn't utf8 there.
[`separator`](https://lldb.llvm.org/use/settings.html#separator) was one
example (renders correctly on the Website but not on my machine).
DeltaFile
+1-20lldb/docs/_ext/lldb_setting.py
+12-3lldb/scripts/gen-property-docs-from-json.py
+1-1lldb/docs/_ext/build_include.py
+14-243 files

LLVM/project d87e2eaclang/docs ReleaseNotes.rst, clang/lib/Sema SemaDeclCXX.cpp

[Clang] Diagnose `co_await` expressions in default arguments of nested functions (#191817)

co_await/co_yield expressions are not allowed in default arguments. We
were checking they do not appear outside of function contexts, which
include default arguments of the corresponding function, but it missed
default arguments of functions declared in the body of another
functions.

Because parsing default argument isn't done in a dedicated scope, we do
additional checks in `ActOnParamDefaultArgument`. Because the checks is
done in two places, we cannot introduce a more precise diagnostic.

It might be worth considering a parse scope for default arguments in the
future.

Fixes #98923
DeltaFile
+21-0clang/test/SemaCXX/coroutines.cpp
+19-0clang/lib/Sema/SemaDeclCXX.cpp
+1-0clang/docs/ReleaseNotes.rst
+41-03 files

LLVM/project 1802123clang/include/clang/Analysis/Analyses/LifetimeSafety FactsGenerator.h, clang/lib/Analysis/LifetimeSafety FactsGenerator.cpp

[LifetimeSafety] Propagate origins through explicit cast expressions (#192180)

Before this PR, `FactsGenerator` handled cast nodes with
`VisitImplicitCastExpr` (`CastKind` switch case) and
`VisitCXXFunctionalCastExpr` (handle`gsl::Pointer` types). Other
explicit casts (`CStyleCastExpr`, `CXXStaticCastExpr`, ...) had no
handler, so origin was silently dropped. This is the root cause of
#190912: the dangle in `a = StringView(s);` is missed even though the
equivalent `StringView tmp(s); a = tmp;` is reported.

The policy for "does this cast propagate origin?" is a function of
`CastKind`, independent of whether the cast is implicit or explicit.
This PR replaces `VisitImplicitCastExpr` with a generic `VisitCastExpr`.
`VisitCXXFunctionalCastExpr` is retained only to preserve the
`handleTestPoint` logic, then delegates to `VisitCastExpr`.

This mirrors `clang/lib/AST/ExprConstant.cpp`, where each evaluator
implements only `VisitCastExpr` and switches on `CastKind`; the few
ExprClass-specific overrides (e.g., `VisitCXXDynamicCastExpr`) exist

    [4 lines not shown]
DeltaFile
+27-0clang/test/Sema/warn-lifetime-safety.cpp
+7-8clang/lib/Analysis/LifetimeSafety/FactsGenerator.cpp
+1-1clang/include/clang/Analysis/Analyses/LifetimeSafety/FactsGenerator.h
+35-93 files

LLVM/project f22071aflang/include/flang/Semantics openmp-utils.h

Update comment about returning std::nullopt
DeltaFile
+2-0flang/include/flang/Semantics/openmp-utils.h
+2-01 files

LLVM/project 3174b3dutils/bazel/llvm-project-overlay/lldb/source/Plugins BUILD.bazel, utils/bazel/llvm-project-overlay/llvm BUILD.bazel

[bazel] Port 789f30c (#192261)
DeltaFile
+15-1utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+1-1utils/bazel/llvm-project-overlay/mlir/test/Bytecode/BUILD.bazel
+1-0utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
+1-0utils/bazel/llvm-project-overlay/lldb/source/Plugins/BUILD.bazel
+18-24 files

LLVM/project 25264b6flang/lib/Semantics openmp-utils.cpp

Check if enough loops were present
DeltaFile
+1-1flang/lib/Semantics/openmp-utils.cpp
+1-11 files

LLVM/project 75d74eellvm/lib/DebugInfo/LogicalView/Core LVReader.cpp

[llvm][DebugInfo] Use formatv in LVReader (#192007)

This relates to #35980.
DeltaFile
+6-6llvm/lib/DebugInfo/LogicalView/Core/LVReader.cpp
+6-61 files

LLVM/project 2be9a7fflang/lib/Semantics openmp-utils.cpp

Depth should not be negative
DeltaFile
+2-1flang/lib/Semantics/openmp-utils.cpp
+2-11 files

LLVM/project 387ff9cflang/lib/Semantics openmp-utils.cpp

Detect issues getting cons/prod in the middle of nest
DeltaFile
+10-6flang/lib/Semantics/openmp-utils.cpp
+10-61 files

LLVM/project 469fd98llvm/test/CodeGen/AArch64 branch-relax-cross-section.mir, llvm/test/CodeGen/AMDGPU local-stack-alloc-add-references.gfx8.mir coalesce-copy-to-agpr-to-av-registers.mir

[AMDGPU][NFC] Update MIR tests to use symbolic INLINEASM operands
DeltaFile
+180-180llvm/test/CodeGen/AMDGPU/local-stack-alloc-add-references.gfx8.mir
+120-120llvm/test/CodeGen/AMDGPU/coalesce-copy-to-agpr-to-av-registers.mir
+90-90llvm/test/CodeGen/AMDGPU/local-stack-alloc-add-references.gfx9.mir
+71-71llvm/test/CodeGen/AArch64/branch-relax-cross-section.mir
+56-56llvm/test/CodeGen/AMDGPU/machine-sink-cycle.mir
+36-36llvm/test/CodeGen/Mips/longbranch/branch-limits-int-mips64r6.mir
+553-553124 files not shown
+1,251-1,251130 files

LLVM/project 3d40731mlir/lib/Conversion/FuncToLLVM FuncToLLVM.cpp

[MLIR] Fix a mismatch between the function return type and the returned value type (NFC) (#192258)

This fixes the build on some platform where the inferred count differs.
DeltaFile
+1-1mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp
+1-11 files

LLVM/project 7a48740flang/lib/Semantics resolve-names.cpp, flang/test/Semantics stmt-func03.f90 stmt-func02.f90

[Flang] Fix statement-function shadowing to avoid false unresolved-symbol internal error (#189360)

When a statement function shadows a host-associated internal procedure
name, HandleStmtFunction creates a local symbol but leaves name.symbol
pointing to the host SubprogramNameDetails.

Because of that stale pointer, AnalyzeStmtFunctionStmt exits early (it
expects SubprogramDetails), so the RHS is never resolved and flang emits
a false `internal error: "Internal: no symbol found".` Clearing
name.symbol after creating the local shadow symbol lets it re-resolve
correctly and fixes the issue.

---------

Co-authored-by: Chandra Ghale <ghale at pe34genoa.hpc.amslabs.hpecorp.net>
DeltaFile
+18-0flang/test/Semantics/stmt-func03.f90
+4-0flang/lib/Semantics/resolve-names.cpp
+2-0flang/test/Semantics/stmt-func02.f90
+24-03 files

LLVM/project 8a42e2fmlir/lib/Dialect/Math/Transforms AlgebraicSimplification.cpp

[MLIR][Math] Move exponent threshold check before IR creation in PowIStrengthReduction (#188955)

PowIStrengthReduction::matchAndRewrite was creating the `one` constant
(using complex::ConstantOp::create for complex::PowiOp) before the
threshold check that guards whether the rewrite is profitable. When the
exponent exceeds the threshold, the pattern returned failure() after IR
was already modified, violating
MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS.

Fix: reorder so the abs(exponent) computation and threshold check occur
before any IR creation.

Assisted-by: Claude Code
Fix a failure present with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
DeltaFile
+12-10mlir/lib/Dialect/Math/Transforms/AlgebraicSimplification.cpp
+12-101 files

LLVM/project f7464cbmlir/lib/Dialect/Bufferization/Transforms OneShotModuleBufferize.cpp, mlir/test/Dialect/Bufferization/Transforms one-shot-module-bufferize.mlir

[MLIR][Bufferization] Fix foldMemRefCasts dropping ranked return type for unranked->ranked cast (#189249)

When one-shot-bufferize with bufferize-function-boundaries is used and a
function returns a ranked tensor that is produced by casting from an
unranked intermediate (e.g. a call to a function returning
tensor<*xf32>), the foldMemRefCasts post-processing step incorrectly
unpacked the memref.cast from unranked to ranked memref, downgrading the
function return type to the unranked memref type and using the unranked
value as the return operand.

The fix is in unpackCast(): do not unpack a cast whose source is an
unranked memref and whose result is a ranked memref, since doing so
would lose type specificity.

Fixes https://github.com/llvm/llvm-project/issues/176739

Assisted-by: Claude Code
DeltaFile
+21-0mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize.mlir
+8-0mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
+29-02 files

LLVM/project c3d7f77clang/lib/CIR/CodeGen CIRGenFunction.cpp CIRGenFunction.h, clang/test/CIR/CodeGen three-way-cmp.cpp

[CIR] Lower PsuedoObjectExpr LValues (#192108)

This ends up being pretty much copy/paste from classic-codegen, so it
doesn't have anything particularly novel.

I DID switch the return type of the helper function to be a variant
instead of a manually-put-together pair, and switched to range-for, but
otherwise it should be identical.

However, I was uanble to reproduce a few of the branches, so NYIs were
left in place until we can figure them out. At least some of them are
going to be for RValue versions.
DeltaFile
+195-2clang/test/CIR/CodeGen/three-way-cmp.cpp
+82-0clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+2-0clang/lib/CIR/CodeGen/CIRGenFunction.h
+279-23 files

LLVM/project 95b8fb6clang/lib/CIR/CodeGen CIRGenExprScalar.cpp, clang/test/CIR/CodeGen cast-cxx20.cpp

[CIR] Handle scalar lowering of qualification-changes (#192152)

Similar to the previous Expr-change that I made, this does the same with
pointers-to-arrays (and other types). The new implementation is
effectively a copy/paste of the classic-codegen, so it maintains our
current invariants/assumptions about changes via emitLoadOfLValue.
DeltaFile
+19-0clang/test/CIR/CodeGen/cast-cxx20.cpp
+3-12clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+22-122 files

LLVM/project 6ec03a7clang/lib/CIR/CodeGen CIRGenExprAggregate.cpp CIRGenFunction.h, clang/test/CIR/CodeGen array-init-loop-exprs.cpp

[CIR] Implement 'ArrayInitLoopExpr lowering' in ExprAgg. (#192053)

This ended up being a fairly common pattern: a copy operation on a
structure with an array inside of it. Classic-Codegen has a few
different ways of initializing/copying an array, of which this is one.
However, this patch uses the array-init functionality we already have.

This ends up being a bit verbose, but will make sure we don't have to
worry about separately handling throwing types/etc for this AST node.

Additionally, this has to handle the ArrayInitIndexExpr, but that is as
simple as making sure we properly cache the index value when doing our
initialization.
DeltaFile
+340-0clang/test/CIR/CodeGen/array-init-loop-exprs.cpp
+30-4clang/lib/CIR/CodeGen/CIRGenExprAggregate.cpp
+31-0clang/lib/CIR/CodeGen/CIRGenFunction.h
+3-3clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
+404-74 files

LLVM/project a10674fllvm/utils/gn/secondary/clang/unittests/StaticAnalyzer BUILD.gn

[gn build] Port 5d7a143ec677 (#192249)

[gn build] Port 5d7a143ec677
DeltaFile
+1-0llvm/utils/gn/secondary/clang/unittests/StaticAnalyzer/BUILD.gn
+1-01 files

LLVM/project 3603446llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM BUILD.gn, llvm/utils/gn/secondary/llvm/unittests/DebugInfo/GSYM BUILD.gn

[gn build] Port c3650687e0b7 (#192250)

[gn build] Port c3650687e0b7
DeltaFile
+6-0llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn
+5-1llvm/utils/gn/secondary/llvm/unittests/DebugInfo/GSYM/BUILD.gn
+11-12 files

LLVM/project 13e0f6cllvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone BUILD.gn, llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/hicpp BUILD.gn

[gn build] Port c9f09d305b55 (#192251)

[gn build] Port c9f09d305b55
DeltaFile
+1-0llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/bugprone/BUILD.gn
+0-1llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/hicpp/BUILD.gn
+1-12 files

LLVM/project ad8a627llvm/utils/gn/secondary/llvm/lib/Debuginfod BUILD.gn, llvm/utils/gn/secondary/llvm/lib/HTTP BUILD.gn

[gn] port 789f30c73ef4e6a2 (llvm/lib/HTTP) (#192248)
DeltaFile
+0-12llvm/utils/gn/secondary/llvm/lib/Support/HTTP/BUILD.gn
+12-0llvm/utils/gn/secondary/llvm/lib/HTTP/BUILD.gn
+0-9llvm/utils/gn/secondary/llvm/unittests/Support/HTTP/BUILD.gn
+9-0llvm/utils/gn/secondary/llvm/unittests/HTTP/BUILD.gn
+1-1llvm/utils/gn/secondary/llvm/tools/llvm-cov/BUILD.gn
+1-1llvm/utils/gn/secondary/llvm/lib/Debuginfod/BUILD.gn
+23-236 files not shown
+29-2912 files