LLVM/project f4b593allvm/lib/Target/Mips Mips64InstrInfo.td MipsDelaySlotFiller.cpp, llvm/test/CodeGen/Mips r5900-short-loop.ll

[Mips] Add r5900 (PlayStation 2 Emotion Engine) CPU support (#176666)

This PR adds basic support for the MIPS R5900 CPU, the Emotion Engine
processor used in the PlayStation 2.

**LLVM changes:**
- Add r5900 CPU definition (with soft float support for now)
- Disable instructions not supported by r5900 (64-bit multiply/divide,
LL/SC atomics, COP3)
- Add r5900 specific short loop delay slot fix (hardware errata
workaround)
- Set ISA extension `AFL_EXT_5900` in ELF flags for proper ABI
identification

**Clang changes:**
- Add r5900 as a valid CPU target for `-mcpu=r5900`
- Add r5900 to CPU test coverage
DeltaFile
+95-80llvm/lib/Target/Mips/Mips64InstrInfo.td
+87-2llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp
+70-0llvm/test/CodeGen/Mips/r5900-short-loop.ll
+55-13llvm/lib/Target/Mips/MipsInstrInfo.td
+59-0llvm/test/MC/Mips/r5900-invalid.s
+11-2llvm/lib/Target/Mips/MipsSEISelLowering.cpp
+377-9713 files not shown
+431-10519 files

LLVM/project bda27d5clang/docs ReleaseNotes.rst, clang/lib/Lex PPDirectives.cpp

[Clang] prevent assertion in __has_embed parameter recovery at end-of-directive (#175104)

Fixes #175088

---

This PR addresses an assertion failure in the preprocessor triggered
when `__has_embed` parameter parsing reaches end-of-directive while
expecting a parenthesized argument.
DeltaFile
+10-0clang/test/Preprocessor/embed___has_embed_parsing_errors.c
+2-2clang/lib/Lex/PPDirectives.cpp
+1-0clang/docs/ReleaseNotes.rst
+13-23 files

LLVM/project 848164cllvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV xqcibm-insert.ll

[RISCV] Run combineOrToBitfieldInsert after DAG legalize (#177830)

Not combing `OR` into `QC.INSB(I)` before DAG legalization helps known
bits analysis to simplify the code if possible.

(cherry picked from commit 3ed48305ab19bf0090d2ca714a37dd7b0667b6c2)
DeltaFile
+22-0llvm/test/CodeGen/RISCV/xqcibm-insert.ll
+4-3llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+26-32 files

LLVM/project e351925llvm/lib/Target/ARM ARMBaseInstrInfo.cpp ARMFrameLowering.cpp, llvm/test/CodeGen/ARM estimate-size-copy.mir

[ARM] Count register copies when estimating function size (#175763)

`EstimateFunctionSizeInBytes`, in `ARMFrameLowering.cpp`, provides an
early estimate of the compiled size of a function, in a context that
wants to overestimate rather than underestimate.

In some cases it was underestimating severely, by over 20%. The
discrepancy was entirely accounted for by the fact that `COPY`
operations were not being counted at all, even though each one (or at
least each one that survives any post-regalloc optimizations) takes 2
bytes in Thumb or 4 in Arm. This could lead to a compile failure, if the
underestimated function size led frame lowering to not stack LR, but
later, `ARMConstantIslandsPass` needed to insert an intra-function
branch long enough to require a `bl` instruction, needing LR to have
been stacked.

The result of `EstimateFunctionSizeInBytes` was not directly available
for testing, so I added an `LLVM_DEBUG` at the end of the function. That
way, the test file doesn't need to try to make a >2048 byte function

    [11 lines not shown]
DeltaFile
+37-0llvm/test/CodeGen/ARM/estimate-size-copy.mir
+5-0llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+2-0llvm/lib/Target/ARM/ARMFrameLowering.cpp
+44-03 files

LLVM/project 47e1141lldb/include/lldb/Host ProcessLaunchInfo.h, lldb/source/Host/windows ProcessLauncherWindows.cpp

[lldb][windows] do not attach to a PseudoConsole if it is not opened (#177934)

# Summary

This patch ensures lldb will not try to read from a PseudoConsole if it
has not been opened.

# Original issue

https://github.com/llvm/llvm-project/pull/168729 introduces support for
the Windows ConPTY in `lldb-dap`. This caused a regression in `lldb`
which was not caught by our tests:
https://github.com/llvm/llvm-project/issues/175652.

This patch fixes https://github.com/llvm/llvm-project/issues/175652.

`lldb_private::ProcessLauncherWindows::LaunchProcess` connects the
debuggee to a PseudoConsole only if:
```cpp

    [18 lines not shown]
DeltaFile
+8-8lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py
+12-0lldb/include/lldb/Host/ProcessLaunchInfo.h
+4-3lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
+1-3lldb/source/Host/windows/ProcessLauncherWindows.cpp
+25-144 files

LLVM/project 6f90a85llvm/docs AMDGPUUsage.rst

Modelled fmin/fmax similar to llvm.minimumnum/maximumnum
DeltaFile
+8-2llvm/docs/AMDGPUUsage.rst
+8-21 files

LLVM/project 1e0114cllvm/lib/Target/WebAssembly WebAssemblyInstrSIMD.td WebAssemblyISelLowering.cpp, llvm/test/CodeGen/WebAssembly simd-relaxed-fmax.ll simd-relaxed-fmin.ll

[WebAssembly] Zero and NaN checks for min/max (#177968)

Custom lower FMINNUM, FMINIMUMNUM, FMAXNUM and FMAXIMUMNUM to generate
relaxed_min and relaxed_max when the inputs cannot be NaN or signed
zero.

Tablegen patterns have also been modified to check the above conditions
when trying to match relaxed min/max using the pmin/pmax pattern.
DeltaFile
+972-28llvm/test/CodeGen/WebAssembly/simd-relaxed-fmax.ll
+858-25llvm/test/CodeGen/WebAssembly/simd-relaxed-fmin.ll
+27-9llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
+34-1llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+2-0llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
+1,893-635 files

LLVM/project db99723clang/test/Frontend rewrite-includes-bom.c

[Clang] Fix rewrite-includes-bom.c to use POSIX-compliant regex (#176043)

As `\s` is a GNU extension, it is not supported by the system grep on
AIX and thus fails in the
[buildbot](https://lab.llvm.org/buildbot/#/builders/64/builds/6835):

```
******************** TEST 'Clang :: Frontend/rewrite-includes-bom.c' FAILED ********************
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
cat /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Frontend/Inputs/rewrite-includes-bom.h | od -t x1 | grep -q 'ef\s*bb\s*bf'
# executed command: cat /home/llvm/llvm-external-buildbots/workers/aix-ppc64/clang-ppc64-aix/llvm-project/clang/test/Frontend/Inputs/rewrite-includes-bom.h
# executed command: od -t x1
# executed command: grep -q 'ef\s*bb\s*bf'
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
--

    [8 lines not shown]
DeltaFile
+2-2clang/test/Frontend/rewrite-includes-bom.c
+2-21 files

LLVM/project 06b159allvm/test/Analysis/CostModel/RISCV scalable-scatter.ll scalable-gather.ll

[RISCV] Add tests for rv32 gather/scatter costs. NFC

There's a divergence with the rv32 costs that I plan on fixing in
another patch, so this precommits the tests for them.

The zve32f RUN lines were split off into another file so the check prefixes
are easier to reason about.

The -riscv-v-vector-bits-max RUN lines were also removed to simplify the
check prefixes since I'm not sure if they were intentionally testing any
specific logic.

(cherry picked from commit 3ad6d350c44f54482a86a7eb488732093eaed372)
DeltaFile
+133-112llvm/test/Analysis/CostModel/RISCV/scalable-scatter.ll
+130-113llvm/test/Analysis/CostModel/RISCV/scalable-gather.ll
+125-0llvm/test/Analysis/CostModel/RISCV/scalable-scatter-zve32f.ll
+112-0llvm/test/Analysis/CostModel/RISCV/scalable-gather-zve32f.ll
+500-2254 files

LLVM/project 1a91718llvm/lib/Target/RISCV RISCVTargetTransformInfo.cpp, llvm/test/Analysis/CostModel/RISCV scalable-scatter.ll scalable-gather.ll

[RISCV] Fix i64 gather/scatter cost on rv32 (#176105)

Fixes #175909

We compute the cost of a gather/scatter by multiplying the cost of the
scalar element type memory op by the estimated number of elements. On
rv32 though a scalar i64 load costs 2, even if we have zve64x.

This causes the cost to diverge between a vector of f64 and vector of
i64, even though both are the same. This fixes it by just using
TTI::TCC_Basic as the scalar memory op cost. The element type is checked
to be legal at this point.

I think we have the same issue for the strided op cost, but we don't
have test coverage for it yet.

(cherry picked from commit 0c1257cd46456513016b106d964dc5ad47c6289b)
DeltaFile
+33-67llvm/test/Analysis/CostModel/RISCV/scalable-scatter.ll
+33-67llvm/test/Analysis/CostModel/RISCV/scalable-gather.ll
+2-5llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+68-1393 files

LLVM/project 3ddddf7offload/tools/kernelreplay llvm-omp-kernel-replay.cpp

Use reportFatalUsageError in llvm-omp-kernel-replay (#178371)

All error cases in this tool are usage errors (bad user input, missing
files, malformed JSON) rather than internal LLVM bugs, so
`reportFatalUsageError` is the appropriate replacement.
DeltaFile
+9-7offload/tools/kernelreplay/llvm-omp-kernel-replay.cpp
+9-71 files

LLVM/project 5e3b708lld/ELF RelocScan.h, lld/ELF/Arch PPC64.cpp RISCV.cpp

[ELF] Simplify RelocScan after #163138 (#178375)

DeltaFile
+3-13lld/ELF/Arch/PPC64.cpp
+4-10lld/ELF/Arch/RISCV.cpp
+13-0lld/ELF/RelocScan.h
+2-3lld/ELF/Arch/Mips.cpp
+22-264 files

LLVM/project a21001allvm/lib/Transforms/Utils Local.cpp

[JumpThreading] Avoid unnecessary map resizing in gatherIncomingValuesToPhi (#173596)

Previously, `gatherIncomingValuesToPhi` populated the `IncomingValues`
map with *all* non-undef incoming values from the PHI node. For PHI
nodes with a large number of incoming blocks, this caused the
`SmallDenseMap` to grow significantly, triggering expensive resizing and
rehashing operations, even when the caller
(`redirectValuesFromPredecessorsToPhi`) was only interested in a small
subset of predecessors.

This patch optimizes the logic to prevent this unnecessary map growth.

Instead of collecting all values, we now:
1. Initialize the `IncomingValues` map specifically for the blocks in
`BBPreds` (setting them to `nullptr` initially).
2. Iterate through the PHI node and update the map entries only if the
incoming block is already present in the map.

This ensures that the size of the map is bounded by the size of

    [5 lines not shown]
DeltaFile
+27-14llvm/lib/Transforms/Utils/Local.cpp
+27-141 files

LLVM/project f58b37bclang/docs StandardCPlusPlusModules.rst

[docs] [C++20] [Modules] Offer a method to use clang module map with named modules (#178368)

See the doc for details.
DeltaFile
+274-0clang/docs/StandardCPlusPlusModules.rst
+274-01 files

LLVM/project fc7ad81llvm/lib/Transforms/InstCombine InstructionCombining.cpp, llvm/test/Transforms/InstCombine binop-select.ll

[InstCombine][profcheck] Preserve !prof metadata when folding select. (#177707)

The new select `InstCombinerImpl::foldBinOpSelectBinOp` reuses the same
condition in the same BB as the original so the profile info can be
trivially copied over.
DeltaFile
+10-5llvm/test/Transforms/InstCombine/binop-select.ll
+9-3llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+0-1llvm/utils/profcheck-xfail.txt
+19-93 files

LLVM/project da3f293llvm/lib/Transforms/InstCombine InstructionCombining.cpp, llvm/test/Transforms/InstCombine branch.ll

[InstCombine][profcheck] Propogate profile metadata when transforming br (X && !Y) to br (!X || Y) (#175939)

Updated visitBranchInst to propagate and swap !prof metadata when transforming br (X && !Y) to br (!X || Y).
DeltaFile
+21-13llvm/test/Transforms/InstCombine/branch.ll
+15-0llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+0-1llvm/utils/profcheck-xfail.txt
+36-143 files

LLVM/project adbbe85llvm/lib/CodeGen AssignmentTrackingAnalysis.cpp TargetInstrInfo.cpp, llvm/lib/CodeGen/GlobalISel LoadStoreOpt.cpp

[perf] Replace copy-assign by move-assign in llvm/lib/CodeGen/* (#178172)

DeltaFile
+2-2llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+1-1llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+1-1llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+1-1llvm/lib/CodeGen/TargetInstrInfo.cpp
+5-54 files

LLVM/project 2624d84llvm/lib/Target/RISCV RISCVInstrInfoZvfbf.td

[RISCV] Remove unnecessary 'let' from VFWMACCBF16_V. NFC (#178367)

earlyclobber and RVVConstraint are already handled in VWMAC_FV_V_F.
DeltaFile
+1-2llvm/lib/Target/RISCV/RISCVInstrInfoZvfbf.td
+1-21 files

LLVM/project b9070bbllvm/lib/Target/RISCV RISCVInstrFormatsC.td RISCVInstrInfoC.td

[RISCV] Add OPC_C0/C1/C2 named values to tablegen. NFC (#178325)

This adds named opcodes for the compressed instructions like we have for
the 32-bit instructions.
DeltaFile
+37-28llvm/lib/Target/RISCV/RISCVInstrFormatsC.td
+24-24llvm/lib/Target/RISCV/RISCVInstrInfoC.td
+9-9llvm/lib/Target/RISCV/RISCVInstrInfoZc.td
+8-8llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td
+4-4llvm/lib/Target/RISCV/RISCVInstrInfoXwch.td
+2-2llvm/lib/Target/RISCV/RISCVInstrInfoXqccmp.td
+84-751 files not shown
+85-767 files

LLVM/project 094c65ellvm/docs AMDGPUUsage.rst

Modelled fmin/fmax similar to llvm.minimumnum/maximumnum
DeltaFile
+8-2llvm/docs/AMDGPUUsage.rst
+8-21 files

LLVM/project 14d4061llvm/docs AMDGPUUsage.rst

[AMDGPU] Update documentation for wave reduction intrinsics
DeltaFile
+70-4llvm/docs/AMDGPUUsage.rst
+70-41 files

LLVM/project c776e92clang/include/clang/Basic BuiltinsAMDGPU.td, clang/lib/CodeGen/TargetBuiltins AMDGPU.cpp

[AMDGPU] Add builtins for wave reduction intrinsics
DeltaFile
+84-0clang/test/CodeGenOpenCL/builtins-amdgcn.cl
+8-0clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+4-0clang/include/clang/Basic/BuiltinsAMDGPU.td
+96-03 files

LLVM/project f74346fllvm/lib/Target/AMDGPU SIISelLowering.cpp

Don't use the pseudo as a case label.
DeltaFile
+17-23llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+17-231 files

LLVM/project c8b1ff9llvm/lib/Target/RISCV RISCVISelLowering.cpp

[RISCV] Hoist a duplicate setOperationAction to a common place. NFC (#178364)

DeltaFile
+2-4llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+2-41 files

LLVM/project f42f10cllvm/docs AMDGPUUsage.rst

Modelled fmin/fmax similar to llvm.minimumnum/maximumnum
DeltaFile
+8-2llvm/docs/AMDGPUUsage.rst
+8-21 files

LLVM/project 56ad524clang/test/Modules modulemap-with-named-module.cppm

[NFC] [C++20] [Modules] Make sure we can use named module with module map
DeltaFile
+25-0clang/test/Modules/modulemap-with-named-module.cppm
+25-01 files

LLVM/project e8c0682llvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll amdgcn.bitcast.512bit.ll, polly/lib/External/isl/include/isl typed_cpp.h cpp.h

Merge branch 'users/chapuni/cov/single/condop' into users/chapuni/cov/single/execskipexists
DeltaFile
+47,161-55,379llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+52,760-0polly/lib/External/isl/include/isl/typed_cpp.h
+17,188-14,558llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+12,842-18,547llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll
+30,864-0polly/lib/External/isl/include/isl/cpp.h
+11,654-16,786llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll
+172,469-105,2703,678 files not shown
+558,830-338,0243,684 files

LLVM/project 527d5adllvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll amdgcn.bitcast.512bit.ll, polly/lib/External/isl/include/isl typed_cpp.h cpp.h

Merge branch 'users/chapuni/mcdc/nest/bitmapaddr' into users/chapuni/cov/single/condop

Conflicts:
        clang/lib/CodeGen/CGExprScalar.cpp
        clang/lib/CodeGen/CodeGenPGO.cpp
        clang/lib/CodeGen/CoverageMappingGen.cpp
DeltaFile
+47,161-55,379llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+52,760-0polly/lib/External/isl/include/isl/typed_cpp.h
+17,188-14,558llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+12,842-18,547llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll
+30,864-0polly/lib/External/isl/include/isl/cpp.h
+11,654-16,786llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll
+172,469-105,2706,625 files not shown
+857,903-536,6736,631 files

LLVM/project 41f2ac0llvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll amdgcn.bitcast.512bit.ll, polly/lib/External/isl/include/isl typed_cpp.h cpp.h

Merge branch 'main' into users/chapuni/mcdc/nest/bitmapaddr
DeltaFile
+47,161-55,379llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+52,760-0polly/lib/External/isl/include/isl/typed_cpp.h
+17,188-14,558llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+12,842-18,547llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll
+30,864-0polly/lib/External/isl/include/isl/cpp.h
+11,654-16,786llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll
+172,469-105,2703,678 files not shown
+558,830-338,0243,684 files

LLVM/project 69e855blibc/shared/math ilogb.h, libc/src/__support/math ilogb.h CMakeLists.txt

[libc][math] Refactor ilogb implementation to header-only in src/__support/math folder. (#175504)

closes #175348
DeltaFile
+27-0libc/src/__support/math/ilogb.h
+23-0libc/shared/math/ilogb.h
+16-1utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+10-0libc/src/__support/math/CMakeLists.txt
+2-4libc/src/math/generic/ilogb.cpp
+2-1libc/test/shared/shared_math_test.cpp
+80-63 files not shown
+83-79 files