LLVM/project e34e809llvm/lib/Target/Mips MipsCallLowering.h MipsInstructionSelector.cpp, llvm/test/CodeGen/Mips/GlobalISel/irtranslator big-endian.ll

[Mips][GlobalISel] Fix Big Endian lowering (#225972)

Flip on the big-endian switch in Mips call lowering. Fix split memory
piece placement, short-load bit extraction, and unaligned left/right
instruction offsets for big-endian targets.

Add BE/LE test coverage.
DeltaFile
+303-0llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/big-endian-memory.ll
+105-0llvm/test/CodeGen/Mips/GlobalISel/irtranslator/big-endian.ll
+27-13llvm/lib/Target/Mips/MipsLegalizerInfo.cpp
+6-4llvm/lib/Target/Mips/MipsInstructionSelector.cpp
+2-0llvm/lib/Target/Mips/MipsCallLowering.h
+1-0llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/load_store_vec.ll
+444-173 files not shown
+447-179 files

LLVM/project 47d06b4llvm/lib/Target/AMDGPU SIFoldOperands.cpp, llvm/test/CodeGen/AMDGPU true16-fold.mir

[AMDGPU] Simplify true16 SGPR folding (#226082)

Rewrite part of the SGPR folding "hack" from #128929 using
getChannelFromSubReg to avoid relying on the exact numbering of subreg
indices.

This also fixes a potential bug when folding a copy with no subreg on
the source operand like `%1:sgpr_lo16 = COPY %0:sgpr_lo16`. The old
implementation would have generated `%0.sub0:sgpr_lo16` which fails
machine verification.

Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>

Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
DeltaFile
+39-0llvm/test/CodeGen/AMDGPU/true16-fold.mir
+8-27llvm/lib/Target/AMDGPU/SIFoldOperands.cpp
+47-272 files

LLVM/project 441b9d6lldb/test/API/macosx/find-dsym/bundle-with-dot-in-filename Makefile

Revert "[LLDB] Simplify Makefile for TestBundleWithDotInFilename (#225930)"

This reverts commit 408ae6803f0cf2d8a65b00d3e1c9534113c5f0be.
DeltaFile
+8-5lldb/test/API/macosx/find-dsym/bundle-with-dot-in-filename/Makefile
+8-51 files

LLVM/project d4dffb0llvm/lib/Target/AMDGPU SIWholeQuadMode.cpp

Review comments
DeltaFile
+2-2llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp
+2-21 files

LLVM/project 44d931dflang/lib/Lower Bridge.cpp, flang/test/Lower do-loop-branch-to-loop-header.f90 do_loop_unstructured.f90

[flang] Lower loops whose branching is confined to their body structurally

Such a loop was classified separately by a previous change but still
lowered as a raw CFG, so its structured form was lost.

Lower it structurally instead, with its body folded into a region that can
hold the branching. The loop keeps its bounds on the op, so it remains
available to whatever transforms or parallelizes it. Only the body is
folded: the loop control statements are emitted as they are for any
structured loop, since a branch from outside may target either of them.

Loops an OpenACC or OpenMP directive owns are lowered the same way, so
they keep their form too.
DeltaFile
+20-134flang/test/Lower/do_loop_unstructured.f90
+119-11flang/lib/Lower/Bridge.cpp
+73-0flang/test/Lower/OpenACC/acc-unstructured-internals.f90
+34-28flang/test/Lower/OpenMP/wsloop-unstructured-cycle.f90
+55-0flang/test/Lower/do-loop-branch-to-loop-header.f90
+50-0flang/test/Lower/OpenMP/metadirective-loop-unstructured.f90
+351-17310 files not shown
+453-24116 files

LLVM/project 63d15eellvm/lib/CodeGen/GlobalISel LegalizerHelper.cpp, llvm/unittests/CodeGen/GlobalISel LegalizerHelperTest.cpp

[GlobalISel] Only narrow IEEE half in narrowScalarFPTOI (#223615)

narrowScalarFPTOI swaps a conversion for a narrower one plus an
extension, which is only valid if every finite value of the source fits
in the narrow type. The guard tests the width, so it also accepts
bfloat, which has float's exponent range.

Match LLT::float16() instead of LLT::scalar(16). Register types come
from LLT::floatingPoint(), which degrades to ANY_SCALAR without extended
LLTs, and an ANY_SCALAR LLT matches any scalar of the same size, so this
is unchanged on such targets. AArch64 and AMDGPU only narrow
LLT::float16() sources and WebAssembly does not narrow these at all, so
they are unaffected too.
DeltaFile
+49-0llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
+4-3llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+53-32 files

LLVM/project c462f43flang/include/flang/Lower PFTBuilder.h, flang/lib/Lower PFTBuilder.cpp

[flang] Detect loops whose branching is confined to their body

A DO loop is classified as either structured or unstructured, and a single
raw branch anywhere in its body forces the loop -- and every construct
enclosing it -- onto the unstructured path.

That is stronger than necessary. A loop keeps its structured control flow
as long as its branching neither leaves its body nor enters it from
outside. Classify such a loop separately from a fully unstructured one.

This only classifies: lowering is unchanged. PFT dumps mark the new
classification with '~', which is what the tests key on.
DeltaFile
+191-23flang/lib/Lower/PFTBuilder.cpp
+137-0flang/test/Lower/pre-fir-tree-unstructured-internals.f90
+51-6flang/include/flang/Lower/PFTBuilder.h
+9-6flang/test/Lower/trailing-cycle.f90
+388-354 files

LLVM/project d952cf0flang/lib/Lower PFTBuilder.cpp, flang/test/Lower pre-fir-tree-assigned-goto.f90

[flang] Resolve an assigned GO TO's targets from the completed assign map

An assigned GO TO reaches any label ASSIGNed to its variable, and a label
list does not bound that: lowering allows a branch to any ASSIGNed label
whether or not the list names it. Branch analysis only sees the ASSIGNs
preceding the GO TO in program order, so the successors it records, and the
incoming branches derived from them, can be incomplete.

The symbol-to-labels map is complete once branch analysis has finished,
which is when the classification runs. Ask it for the full target set
instead of trusting the recorded successors, so a loop whose assigned GO TO
stays within its body is still recognised.
DeltaFile
+42-41flang/test/Lower/pre-fir-tree-assigned-goto.f90
+22-2flang/lib/Lower/PFTBuilder.cpp
+64-432 files

LLVM/project b880df0flang/include/flang/Lower PFTDefs.h PFTBuilder.h, flang/lib/Lower PFTBuilder.cpp

[flang] Record the evaluations that branch to each evaluation

The PFT records where each branch goes, but not where it comes from, so
asking whether anything branches into a construct means walking the whole
procedure.

Record the reverse edges beside the forward ones, and print them in PFT
dumps so both directions of the branch graph are visible.
DeltaFile
+68-0flang/test/Lower/pre-fir-tree-incoming-branches.f90
+20-0flang/lib/Lower/PFTBuilder.cpp
+8-8flang/test/Lower/assigned-goto-labeled-end.f90
+3-3flang/test/Lower/trailing-cycle.f90
+3-0flang/include/flang/Lower/PFTDefs.h
+3-0flang/include/flang/Lower/PFTBuilder.h
+105-111 files not shown
+106-127 files

LLVM/project 2424d26flang/include/flang/Lower PFTBuilder.h

[flang][NFC] Say which control successors are not incoming branches

The map records branches, not every control successor: a construct
transferring control between its own statements is not a branch
(F2023 11.2.1 p1), so the successors analyzeBranches sets directly are
absent from it. Say so, rather than calling the map a plain inverse.
DeltaFile
+4-2flang/include/flang/Lower/PFTBuilder.h
+4-21 files

LLVM/project f4c248ellvm/lib/MC MCDwarf.cpp

[MC] Prevent multiplication overflow when calling `encodeULEB128` (#224647)

`encodeULEB128` takes its `Value` as a 64-bit integer but the
multiplication is done using 32 bits. This fixes two issues reported by
a CodeQL scan however it's unclear how realistic an overflow is in this
case.
DeltaFile
+3-2llvm/lib/MC/MCDwarf.cpp
+3-21 files

LLVM/project c64f6cdmlir/include/mlir/Support InterfaceSupport.h

[mlir] Fold interface-map trait packs without recursive templates (NFC) (#226084)

Count interface traits and insert their models with fold expressions.
This keeps insertion order and avoids two recursive template chains for
every registered operation.

Assisted-by: Codex
DeltaFile
+7-25mlir/include/mlir/Support/InterfaceSupport.h
+7-251 files

LLVM/project 225e478clang/test/CodeGen/AArch64/sve dup.c, clang/test/CodeGen/AArch64/sve-intrinsics acle_sve_dup.c

[clang][AArch64] Consolidate codegen tests for SVE's DUP intrinsics

This patch completes the migration of the tests from:

* clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_dup.c

to:

* clang/test/CodeGen/AArch64/sve/dup.c

`dup.c` covers all the cases previously tested by `acle_sve_dup.c`.
However, unlike `acle_sve_dup.c`, it was only tested as C. Add `-x c++`
RUN lines to provide the equivalent C++ coverage, including lowering
via CIR.
DeltaFile
+0-1,130clang/test/CodeGen/AArch64/sve-intrinsics/acle_sve_dup.c
+146-80clang/test/CodeGen/AArch64/sve/dup.c
+146-1,2102 files

LLVM/project a60626aflang/lib/Optimizer/Transforms AddDebugInfo.cpp, flang/test/Integration debug-include-file.f90 debug-common-block-1.f90

[flang][debug] Emit debug for a COMMON block from an INCLUDE'd file (#225867)

This handles the case of a common block that was missed in #225068 and
pointed out in

https://github.com/llvm/llvm-project/pull/225068#issuecomment-5782632548.

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+24-22flang/test/Integration/debug-common-block-1.f90
+15-3flang/test/Integration/debug-include-file.f90
+5-3flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+44-283 files

LLVM/project ba5c0a6mlir/include/mlir/IR OperationSupport.h

[mlir] Store OperationState property callbacks as function pointers (NFC) (#226083)

The property callbacks never capture state. Store their function
pointers directly instead of wrapping them in function_ref. This improve
slightly MLIR build time and generates slightly smaller binaries.

Assisted-by: Codex
DeltaFile
+3-5mlir/include/mlir/IR/OperationSupport.h
+3-51 files

LLVM/project c949a97mlir/include/mlir/IR OpDefinition.h

[mlir] Fold operation trait lookup without a temporary array (NFC) (#226081)

Compare trait IDs directly in the generated pack expansion. This avoids
building and scanning a local array in every operation trait lookup.

Assisted-by: Codex
DeltaFile
+1-5mlir/include/mlir/IR/OpDefinition.h
+1-51 files

LLVM/project c12a0d2mlir/include/mlir/IR OpImplementation.h, mlir/lib/IR OperationSupport.cpp

[mlir][ODS] Share optional operand and type parser logic (NFC) (#226066)

Move repeated optional operand and type parsing into out-of-line
helpers.

Generated parsers now reuse those helpers across operations.

This improves MLIR build time by avoid redundant compilation of these
helpers.

Assisted-by: Codex
DeltaFile
+5-21mlir/tools/mlir-tblgen/OpFormatGen.cpp
+26-0mlir/lib/IR/OperationSupport.cpp
+9-0mlir/include/mlir/IR/OpImplementation.h
+1-1mlir/test/mlir-tblgen/op-format.td
+41-224 files

LLVM/project 303cf70llvm/include/llvm/Analysis TargetFolder.h, llvm/test/Transforms/SLPVectorizer/RISCV revec.ll

[TargetFolder] Use getGetElementPtr() overload accepting DataLayout (#226068)

To directly construct the constant GEP in canonical ptradd form.

The test change is because this ends up canonicalizing the vector
GEP case as well, rather than just the scalar cases.
DeltaFile
+5-1llvm/include/llvm/Analysis/TargetFolder.h
+1-1llvm/test/Transforms/SLPVectorizer/RISCV/revec.ll
+6-22 files

LLVM/project 43a0a95llvm/lib/Target/WebAssembly WebAssemblyCFGStackify.cpp, llvm/test/CodeGen/WebAssembly cfg-stackify-eh-legacy.mir exception-legacy.mir

[WebAssembly] Remove per-invoke EH_LABEL handling (#226053)

Per-invoke `EH_LABEL`s are no longer emitted after #225903. This removes
code that handles per-invoke `EH-LABEL`s and removes them from mir
tests.
DeltaFile
+7-31llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
+2-9llvm/test/CodeGen/WebAssembly/exception-legacy.mir
+0-6llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.mir
+9-463 files

LLVM/project 1087708flang/lib/Semantics resolve-directives.cpp, flang/test/Semantics/OpenMP defaultmap-clause-none.f90

[flang][OpenMP] Fix crash in defaultmap(none) on structure constructors (#220994)

Fixes :
[https://github.com/llvm/llvm-project/issues/218929](https://github.com/llvm/llvm-project/issues/218929)
Flang was crashing when a target defaultmap(none:...) region contained a
structure constructor, like this:
```
program p
  type t
  end type
  type(t) :: x

  !$omp target defaultmap(none:aggregate)
  x = t()
  !$omp end target
end
```
The problem is in `IsOpenMPAggregate` and `IsOpenMPScalar`. When the
OpenMP attribute visitor walks the names in the region, it hits the t in

    [7 lines not shown]
DeltaFile
+14-0flang/test/Semantics/OpenMP/defaultmap-clause-none.f90
+6-0flang/lib/Semantics/resolve-directives.cpp
+20-02 files

LLVM/project 65d651bllvm/lib/Target/AMDGPU AMDGPUISelLowering.cpp SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU llvm.set.rounding.ll readlane-known-bits.ll

[AMDGPU] Look through readfirstlane/readlane in computeKnownBitsForTargetInstr. (#224275)

Currently, `computeKnownBitsForTargetInstr` in GISel and
`computeKnownBitsForTargetNode` in SDAG treats
`amdgcn.readfirstlane/readlane` as fully unknown, even though both just
return the data operand's value from some lane. This patch teaches it to
recurse into the data operand (operand 2) and reuse its known bits.

Thus, it unblocks known-bits combines (e.g. redundant_and) that see
these intrinsics while still generic.
DeltaFile
+89-0llvm/test/CodeGen/AMDGPU/readlane-known-bits.ll
+52-0llvm/test/CodeGen/AMDGPU/GlobalISel/known-bits-readlane.mir
+50-0llvm/test/CodeGen/AMDGPU/GlobalISel/combine-readlane-redundant-and.mir
+8-24llvm/test/CodeGen/AMDGPU/llvm.set.rounding.ll
+7-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+5-0llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+211-241 files not shown
+211-257 files

LLVM/project 2347fc7flang/include/flang/Lower PFTBuilder.h, flang/lib/Lower PFTBuilder.cpp

[flang] Detect loops whose branching is confined to their body

A DO loop is classified as either structured or unstructured, and a single
raw branch anywhere in its body forces the loop -- and every construct
enclosing it -- onto the unstructured path.

That is stronger than necessary. A loop keeps its structured control flow
as long as its branching neither leaves its body nor enters it from
outside. Classify such a loop separately from a fully unstructured one.

This only classifies: lowering is unchanged. PFT dumps mark the new
classification with '~', which is what the tests key on.
DeltaFile
+191-23flang/lib/Lower/PFTBuilder.cpp
+137-0flang/test/Lower/pre-fir-tree-unstructured-internals.f90
+51-6flang/include/flang/Lower/PFTBuilder.h
+9-6flang/test/Lower/trailing-cycle.f90
+388-354 files

LLVM/project e1c829aflang/include/flang/Lower PFTBuilder.h

[flang][NFC] Say which control successors are not incoming branches

The map records branches, not every control successor: a construct
transferring control between its own statements is not a branch
(F2023 11.2.1 p1), so the successors analyzeBranches sets directly are
absent from it. Say so, rather than calling the map a plain inverse.
DeltaFile
+4-2flang/include/flang/Lower/PFTBuilder.h
+4-21 files

LLVM/project cbe5b43flang/include/flang/Lower PFTDefs.h PFTBuilder.h, flang/lib/Lower PFTBuilder.cpp

[flang] Record the evaluations that branch to each evaluation

The PFT records where each branch goes, but not where it comes from, so
asking whether anything branches into a construct means walking the whole
procedure.

Record the reverse edges beside the forward ones, and print them in PFT
dumps so both directions of the branch graph are visible.
DeltaFile
+68-0flang/test/Lower/pre-fir-tree-incoming-branches.f90
+20-0flang/lib/Lower/PFTBuilder.cpp
+8-8flang/test/Lower/assigned-goto-labeled-end.f90
+3-3flang/test/Lower/trailing-cycle.f90
+3-0flang/include/flang/Lower/PFTDefs.h
+3-0flang/include/flang/Lower/PFTBuilder.h
+105-111 files not shown
+106-127 files

LLVM/project 6cf36fdlibcxx/docs/Status Cxx17Issues.csv

[libc++][docs] Mark LWG2727 Complete in LLVM 24 (#225606)

In 9853cb54d9d2684b27f0d0db89c00c2da7e31b88 and
672843a3f2ee2aaaed0463ec9064b6ccea2a5d4d, we implemented parallel
versions of `std::min_element`, `std::max_element`, and
`std::minmax_element` without adding incorrect `constexpr`. This
essentially implemented the resolution of LWG2727.
DeltaFile
+1-1libcxx/docs/Status/Cxx17Issues.csv
+1-11 files

LLVM/project b8f452eflang/lib/Lower Bridge.cpp, flang/test/Lower do-loop-branch-to-loop-header.f90 do_loop_unstructured.f90

[flang] Lower loops whose branching is confined to their body structurally

Such a loop was classified separately by a previous change but still
lowered as a raw CFG, so its structured form was lost.

Lower it structurally instead, with its body folded into a region that can
hold the branching. The loop keeps its bounds on the op, so it remains
available to whatever transforms or parallelizes it. Only the body is
folded: the loop control statements are emitted as they are for any
structured loop, since a branch from outside may target either of them.

Loops an OpenACC or OpenMP directive owns are lowered the same way, so
they keep their form too.
DeltaFile
+20-134flang/test/Lower/do_loop_unstructured.f90
+119-11flang/lib/Lower/Bridge.cpp
+73-0flang/test/Lower/OpenACC/acc-unstructured-internals.f90
+34-28flang/test/Lower/OpenMP/wsloop-unstructured-cycle.f90
+55-0flang/test/Lower/do-loop-branch-to-loop-header.f90
+50-0flang/test/Lower/OpenMP/metadirective-loop-unstructured.f90
+351-17310 files not shown
+453-24116 files

LLVM/project 4e323a6flang/include/flang/Lower PFTBuilder.h, flang/lib/Lower PFTBuilder.cpp

[flang] Detect loops whose branching is confined to their body

A DO loop is classified as either structured or unstructured, and a single
raw branch anywhere in its body forces the loop -- and every construct
enclosing it -- onto the unstructured path.

That is stronger than necessary. A loop keeps its structured control flow
as long as its branching neither leaves its body nor enters it from
outside. Classify such a loop separately from a fully unstructured one.

This only classifies: lowering is unchanged. PFT dumps mark the new
classification with '~', which is what the tests key on.
DeltaFile
+191-23flang/lib/Lower/PFTBuilder.cpp
+137-0flang/test/Lower/pre-fir-tree-unstructured-internals.f90
+51-6flang/include/flang/Lower/PFTBuilder.h
+9-6flang/test/Lower/trailing-cycle.f90
+388-354 files

LLVM/project d5c01b4flang/include/flang/Lower PFTBuilder.h

[flang][NFC] Say which control successors are not incoming branches

The map records branches, not every control successor: a construct
transferring control between its own statements is not a branch
(F2023 11.2.1 p1), so the successors analyzeBranches sets directly are
absent from it. Say so, rather than calling the map a plain inverse.
DeltaFile
+4-2flang/include/flang/Lower/PFTBuilder.h
+4-21 files

LLVM/project 84afb5aflang/lib/Optimizer/CodeGen CodeGen.cpp CodeGenOpenMP.cpp, flang/lib/Optimizer/Dialect FIROps.cpp

[flang] Stop using Operation::getAttrs (NFC) (#223049)

Migrate FIR attribute copying and printing to the explicit inherent and
discardable attribute APIs.

Also upgrade the textual assembly to stop mixing inherent and
discardable attributes in the same dictionary.

This is part of a general migration to use the "new" properties-based
APIs and stop mixing discardable/inherent attributes, see #155475

Assisted-by: Codex
DeltaFile
+143-59flang/lib/Optimizer/Dialect/FIROps.cpp
+77-77flang/lib/Optimizer/CodeGen/CodeGenOpenMP.cpp
+41-41flang/test/Lower/OpenACC/acc-reduction.f90
+37-37flang/test/Transforms/tbaa2.fir
+30-24flang/lib/Optimizer/CodeGen/CodeGen.cpp
+26-26flang/test/Lower/OpenMP/implicit-dsa.f90
+354-264522 files not shown
+2,413-2,299528 files

LLVM/project 27cddfellvm/lib/Target/Mips MipsInstrInfo.td, llvm/test/MC/Mips/mips32r6 valid.s

[Mips] Add sync instruction aliases (#225866)

These aliases are documented in the MIPS ISA Reference Manual. These
also exist in binutils and are declared to be part of the MIPS32R2 ISA.
DeltaFile
+6-0llvm/lib/Target/Mips/MipsInstrInfo.td
+5-0llvm/test/MC/Mips/mips64r6/valid.s
+5-0llvm/test/MC/Mips/mips64r5/valid.s
+5-0llvm/test/MC/Mips/mips64r3/valid.s
+5-0llvm/test/MC/Mips/mips64r2/valid.s
+5-0llvm/test/MC/Mips/mips32r6/valid.s
+31-05 files not shown
+48-211 files