LLVM/project d3be056llvm/docs/GlobalISel GenericOpcode.rst, llvm/lib/CodeGen MachineVerifier.cpp

[GlobalISel]Allow mixing fixed and scalable vectors for G_INSERT_SUBVECTOR and G_EXTRACT_SUBVECTOR (#198012)

Allow `G_INSERT_SUBVECTOR` and `G_EXTRACT_SUBVECTOR` to
be used with a scalable and a fix length vector types, similar to the
OP's SelectionDAG version.
DeltaFile
+15-7llvm/lib/CodeGen/MachineVerifier.cpp
+7-3llvm/docs/GlobalISel/GenericOpcode.rst
+5-4llvm/test/MachineVerifier/test_g_extract_subvector.mir
+8-0llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp
+5-2llvm/test/MachineVerifier/test_g_insert_subvector.mir
+40-165 files

LLVM/project 09ec64dmlir/docs PrivateNameObfuscation.md, mlir/include/mlir/TableGen PrivateName.h

strip op and pass names
DeltaFile
+195-0mlir/docs/PrivateNameObfuscation.md
+179-0mlir/test/mlir-tblgen/private-name-obfuscation.td
+153-0mlir/tools/mlir-tblgen/PrivateName.cpp
+82-0mlir/test/mlir-tblgen/private-pass-strip.td
+55-13mlir/tools/mlir-tblgen/PassGen.cpp
+60-0mlir/include/mlir/TableGen/PrivateName.h
+724-1322 files not shown
+947-4528 files

LLVM/project f7424c7clang/lib/Sema SemaDeclAttr.cpp, clang/test/SemaSYCL sycl-cconv.cpp

[clang][SYCL] Enable possibility for device-only calling convention (#198479)

After 94ca49099ef77751a33e4babe41b2ae03ff228e1 DPC++ downstream
experienced failures. This happened because it has a calling convention
attribute that applies calling convention valid only for device targets
which given SYCL model is quite unusual and was not expected by
94ca49099ef77751a33e4babe41b2ae03ff228e1 . Even though there is no
device-only calling conventions, we should not prevent a possibility for
it. So this patch preserves the semantics of the device over those of
the host while also preserving device side diagnostics if they are less
severe than the host.
DeltaFile
+21-5clang/lib/Sema/SemaDeclAttr.cpp
+9-1clang/test/SemaSYCL/sycl-cconv.cpp
+30-62 files

LLVM/project 8d5b898mlir/docs PrivateNameObfuscation.md, mlir/test/mlir-tblgen private-name-obfuscation.td private-pass-strip.td

strip op and pass names
DeltaFile
+198-0mlir/test/mlir-tblgen/private-name-obfuscation.td
+195-0mlir/docs/PrivateNameObfuscation.md
+153-0mlir/tools/mlir-tblgen/PrivateName.cpp
+82-10mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
+82-0mlir/test/mlir-tblgen/private-pass-strip.td
+55-13mlir/tools/mlir-tblgen/PassGen.cpp
+765-2324 files not shown
+1,062-4730 files

LLVM/project 2e06e00llvm/runtimes CMakeLists.txt

[cmake][runtimes] Pass variable type for passthrough CMake options (#198505)

Passing the types affects the handling of `PATH` cache variables.
The motivating case is setting `COMPILER_RT_INSTALL_LIBRARY_DIR` without `CMAKE_BINARY_DIR` getting prepended to it.
DeltaFile
+8-0llvm/runtimes/CMakeLists.txt
+8-01 files

LLVM/project a70586bllvm/lib/Target/WebAssembly WebAssemblyGISel.td, llvm/lib/Target/WebAssembly/GISel WebAssemblyLegalizerInfo.cpp

Implement saturating fp to int
DeltaFile
+424-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/fptoui_sat.ll
+418-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/fptosi_sat.ll
+6-12llvm/lib/Target/WebAssembly/GISel/WebAssemblyLegalizerInfo.cpp
+13-0llvm/lib/Target/WebAssembly/WebAssemblyGISel.td
+861-124 files

LLVM/project 38f44e1llvm/lib/Target/WebAssembly/GISel WebAssemblyLegalizerInfo.cpp, llvm/test/CodeGen/WebAssembly/GlobalISel/instructions is_fpclass.ll fcmp.ll

Implement floating-point comparisons
DeltaFile
+490-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/is_fpclass.ll
+436-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/fcmp.ll
+308-0llvm/lib/Target/WebAssembly/GISel/WebAssemblyLegalizerInfo.cpp
+225-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/fminimumnum.ll
+219-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/fmaximumnum.ll
+55-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/fmaxnum.ll
+1,733-03 files not shown
+1,852-09 files

LLVM/project ca66a0allvm/test/CodeGen/WebAssembly/GlobalISel/instructions icmp.ll select.ll

Implement integer comparisons and `G_SELECT`
DeltaFile
+277-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/icmp.ll
+94-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/select.ll
+89-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ucmp.ll
+81-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/scmp.ll
+77-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/umin.ll
+77-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/umax.ll
+695-03 files not shown
+857-09 files

LLVM/project bfbb0fdllvm/lib/Target/WebAssembly WebAssemblyRegisterInfo.cpp, llvm/lib/Target/WebAssembly/GISel WebAssemblyInstructionSelector.cpp

Implement `COPY`
DeltaFile
+294-0llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/copy.mir
+57-1llvm/lib/Target/WebAssembly/GISel/WebAssemblyInstructionSelector.cpp
+17-2llvm/lib/Target/WebAssembly/WebAssemblyRegisterInfo.cpp
+368-33 files

LLVM/project ce002b2bolt/test/RISCV dynamic-link.s pie.s

[BOLT][RISCV] Add RV32 bare-metal support (#193913)

Enable BOLT to read, analyze, and rewrite 32-bit RISC-V (RV32) ELF
binaries. This lets us use BOLT as the core of our internal binary
analysis tooling for RV32 targets.

Scope is limited to statically linked, non-PIE programs. PLT, GOT,
dynamic relocations, TLS, and the instrumentation runtime are out of
scope for this change yet, and we plan to support those stuff in future
changes.
DeltaFile
+47-0bolt/test/RISCV/dynamic-link.s
+46-0bolt/test/RISCV/pie.s
+45-0bolt/test/RISCV/reloc-bb-split-rv32.s
+29-0bolt/test/RISCV/static-pie.s
+28-0bolt/test/RISCV/reloc-lohi-rv32.s
+27-0bolt/test/RISCV/reloc-pcrel-rv32.s
+222-025 files not shown
+376-3731 files

LLVM/project 9c768f8llvm/test/DebugInfo/COFF fortran-basic.ll

[DebugInfo][test] Replace Intel-proprietary intrinsics in fortran-basic.ll [NFC] (#198697)

The test was originally captured from Intel's Fortran compiler and
references two intrinsics that have never existed in upstream LLVM:

- @llvm.intel.subscript.p0.i64.i64.p0.i64 was only declared and never
called, so it can simply be dropped.
- @llvm.for.cpystr.i64.i64.i64 lowers to a string copy; rewrite the one
call site using @llvm.memcpy.p0.p0.i64. The test only checks the emitted
CodeView debug info, so the precise lowering of the string copy does not
matter.
DeltaFile
+2-6llvm/test/DebugInfo/COFF/fortran-basic.ll
+2-61 files

LLVM/project b00e624llvm/lib/Target/AMDGPU GCNSubtarget.h

[AMDGPU] Enable support for Wave64 on gfx13 (#198629)

This is a temporary workaround needed to unblock ongoing GFX13-related
changes. This will be removed by
https://github.com/llvm/llvm-project/pull/197991
DeltaFile
+1-1llvm/lib/Target/AMDGPU/GCNSubtarget.h
+1-11 files

LLVM/project 5cebdadllvm/test/CodeGen/AMDGPU sched.barrier.inverted.mask.ll si-split-load-store-alias-info.ll

[AMDGPU][test] Replace invalid intrinsic calls in two tests [NFC] (#198696)

These tests reference intrinsics that do not exist:

- sched.barrier.inverted.mask.ll calls @llvm.amdcn.s.nop, a typo of
@llvm.amdgcn.s.nop that has been in the test since it was added in
f1156fb622a7.
- si-split-load-store-alias-info.ll calls
@llvm.amdgcn.wmma.f32.16x16x16.f32, which has never existed (only the
.f16/.bf16/.fp8/.bf8 input variants are defined). The intrinsic was only
used to keep the loaded value alive between the load and the store; an
fadd serves the same purpose while exercising the same alias-info
propagation path being tested.

The dyn_cast<IntrinsicInst> we rely on in passes such as
ReplaceWithVeclib only checks the "llvm." prefix and does not validate
the intrinsic name, so these calls have silently become IntrinsicInst
with Intrinsic::not_intrinsic. Fix the tests so that strengthening the
check does not turn into a spurious regression.

Assisted-by: Opus 4.7
DeltaFile
+13-13llvm/test/CodeGen/AMDGPU/sched.barrier.inverted.mask.ll
+1-2llvm/test/CodeGen/AMDGPU/si-split-load-store-alias-info.ll
+14-152 files

LLVM/project 3768702llvm/include/llvm/Target/GlobalISel Combine.td, llvm/lib/CodeGen/GlobalISel CombinerHelper.cpp

[GlobalISel] Add tablegen pattern for shufflevector combine (#198514)

Related to #197693 which filters the worklist to only include opcodes
for which there are combines. It's mostly handled by canMatchOpcode
which is tablgen'ed but some old combines like this shufflevector one
are missing a tablegen pattern and require extra handling. This adds a
simple wrapper so it gets picked up by canMatchOpcode and we can delete
the C++ handling.

I was expecting this to be NFC but it does change codegen on AMDGPU. I
tried re-ordering the patterns so the old shuffle combine comes before
this one but it didn't help.

Assisted-by: codex
DeltaFile
+15-15llvm/test/CodeGen/AMDGPU/integer-mad-patterns.ll
+0-9llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
+7-0llvm/include/llvm/Target/GlobalISel/Combine.td
+0-6llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
+3-1llvm/lib/Target/AArch64/AArch64Combine.td
+1-1llvm/lib/Target/AMDGPU/AMDGPUCombine.td
+26-322 files not shown
+26-368 files

LLVM/project 9f12368llvm/include/llvm/Analysis CodeMetrics.h, llvm/lib/Analysis CodeMetrics.cpp

[Analysis][NFC] Reduce memory usage of CodeMetrics (#198518)

FunctionSpecializer will keep the CodeMetrics of many functions at the
same time, causing the hash table in CodeMetrics to substantially
contribute to overall memory usage. Therefore, replace the DenseMap with
a vector indexed by block number.

On ArrayFunctionsRegistration.bc, this reduces the memory usage at the
time IPSCCP runs from 655.0MiB to 577.5MiB (measured with massif).
DeltaFile
+7-10llvm/include/llvm/Analysis/CodeMetrics.h
+3-2llvm/lib/Analysis/CodeMetrics.cpp
+10-122 files

LLVM/project aab7a00clang/lib/Parse ParseStmt.cpp

format
DeltaFile
+1-1clang/lib/Parse/ParseStmt.cpp
+1-11 files

LLVM/project 7108d37clang/lib/Parse ParseStmt.cpp

fix ci
DeltaFile
+20-18clang/lib/Parse/ParseStmt.cpp
+20-181 files

LLVM/project 44fc3b3libc/test/src/stdio fgets_test.cpp rewind_test.cpp, libc/test/src/sys/socket/linux shutdown_test.cpp

[libc] Use scope_exit to clean up resources in tests (#196120)

Simplify socket and FILE unit tests by using the `scope_exit` helper to
automatically clean up resources (sockets and FILE pointers), preventing
leaks on test failures.

Assisted by Gemini.
DeltaFile
+70-62libc/test/src/stdio/fgets_test.cpp
+46-39libc/test/src/stdio/rewind_test.cpp
+31-22libc/test/src/stdio/fgetc_unlocked_test.cpp
+28-20libc/test/src/stdio/fgetc_test.cpp
+23-18libc/test/src/stdio/fopen_test.cpp
+14-9libc/test/src/sys/socket/linux/shutdown_test.cpp
+212-1702 files not shown
+218-1708 files

LLVM/project 3b3a3c2llvm/runtimes CMakeLists.txt

[cmake][runtimes] Refactor passthrough option handling into a macro (#198504)

Deduplicates code and enables making fixes in just one place instead of two.
DeltaFile
+26-33llvm/runtimes/CMakeLists.txt
+26-331 files

LLVM/project c5ba595llvm/test/CodeGen/ARM 2012-08-27-CopyPhysRegCrash.ll

[ARM][test] Replace removed @llvm.arm.neon.vshiftn calls with lshr+trunc [NFC] (#198693)

@llvm.arm.neon.vshiftn was removed in 170daafe015f (2014), which
intentionally replaced the intrinsic with the plain shift+truncate IR
sequence. The 2012-08-27-CopyPhysRegCrash.ll regression test was added
before that change and still calls the removed intrinsic; the call
silently lowers to an external call because @llvm.arm.neon.vshiftn no
longer corresponds to any known intrinsic.

Rewrite the two call sites with the lshr+trunc form the removal commit
documents as the canonical replacement. The test only checks that
codegen does not crash, so behaviour is preserved.
DeltaFile
+4-4llvm/test/CodeGen/ARM/2012-08-27-CopyPhysRegCrash.ll
+4-41 files

LLVM/project 3ad91ceclang/lib/CIR/CodeGen CIRGenModule.cpp

crash on sycl tempAlloca
DeltaFile
+1-1clang/lib/CIR/CodeGen/CIRGenModule.cpp
+1-11 files

LLVM/project a88714blld/ELF/Arch LoongArch.cpp RISCV.cpp, lld/test/ELF loongarch-relocatable-align.s riscv-relocatable-align.s

[ELF] -r: Don't let a weaker offset-0 R_RISCV_ALIGN suppress ALIGN synthesis (#198147)

PR #151639 skipped synthesizing the section-start R_RISCV_ALIGN whenever
any R_RISCV_ALIGN existed at offset 0, regardless of its alignment. This
works with newer LLVM integrated assembler (#150816).

However, older MC and GNU Assembler as of today
(https://sourceware.org/bugzilla/show_bug.cgi?id=33236) can carry a weak
offset-0 R_RISCV_ALIGN (addend 2 => align 4) while its real alignment
requirement comes from a `.option norelax` .balign, which emits no
relocation.

Fix the condition to not suppress synthesis.

Link: https://sourceware.org/bugzilla/show_bug.cgi?id=33236#c4
DeltaFile
+25-0lld/test/ELF/loongarch-relocatable-align.s
+24-0lld/test/ELF/riscv-relocatable-align.s
+12-5lld/ELF/Arch/LoongArch.cpp
+12-5lld/ELF/Arch/RISCV.cpp
+73-104 files

LLVM/project 87fb6b5lldb/source/Plugins/Platform/WebAssembly PlatformWebInspectorWasm.cpp

[lldb] Recheck connection state in webinspector-wasm EnsureConnected (#198701)

m_remote_platform_sp can be non-null while the remote is disconnected
(PlatformWasm::ConnectRemote installs the pointer before the connect
call). Also check IsConnected() so a prior failed connect doesn't make
EnsureConnected falsely report success.
DeltaFile
+1-1lldb/source/Plugins/Platform/WebAssembly/PlatformWebInspectorWasm.cpp
+1-11 files

LLVM/project 6113e16clang-tools-extra/clangd/test non-existent.test, clang/lib/Parse Parser.cpp

[clang] Don't cutoff parsing when load C++ named module failed (#187858)

Since https://github.com/llvm/llvm-project/pull/173130, clang convert
module name pp-token sequence into a annot_module_name token for C++20
module/import directive. This PR follows the changes and correct the
module name handling in clangd.

This PR avoid parsing cutoff when hit an C++ named module loading.

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

Signed-off-by: yronglin <yronglin777 at gmail.com>
DeltaFile
+82-0clang-tools-extra/clangd/test/non-existent.test
+12-0clang/test/Modules/cxx20-fatal-module-loader-error.cpp
+7-1clang/lib/Parse/Parser.cpp
+101-13 files

LLVM/project d691b3dclang/lib/Tooling/Syntax Tokens.cpp, clang/unittests/Tooling/Syntax TokensTest.cpp

[clang][tooling] Handle C++20 annot_module_name in syntax tokens (#198544)

The token collector will ignore all the annotation tokens, but IIUC, the
annot_module_name shoulde not be ignored.

Signed-off-by: yronglin <yronglin777 at gmail.com>
DeltaFile
+31-3clang/unittests/Tooling/Syntax/TokensTest.cpp
+11-2clang/lib/Tooling/Syntax/Tokens.cpp
+42-52 files

LLVM/project f7fd42bllvm/test/tools/dsymutil/X86 modules.m

[dsymutil] Update modules test for divergence between the two linkers (#198661)

The parallel linker keeps DW_AT_GNU_dwo_id on linked CUs while the
classic linker drops it. Gate the four `CHECK-NOT: DW_AT_GNU_dwo_id`
assertions to a CLASSIC-only prefix so the test reflects the actual,
intended behavior of each linker.
DeltaFile
+9-10llvm/test/tools/dsymutil/X86/modules.m
+9-101 files

LLVM/project 97d8931llvm/include/llvm/CodeGen MachineFunction.h, llvm/lib/CodeGen MachineFunction.cpp

[AMDGPU][MC] Replace shifted registers in CFI instructions

Change-Id: I0d99e9fe43ec3b6fecac20531119956dca2e4e5c
DeltaFile
+67-67llvm/test/CodeGen/AMDGPU/sgpr-spill-overlap-wwm-reserve.mir
+33-0llvm/lib/MC/MCDwarf.cpp
+15-15llvm/test/CodeGen/AMDGPU/dwarf-multi-register-use-crash.ll
+10-0llvm/lib/CodeGen/MachineFunction.cpp
+4-4llvm/test/CodeGen/AMDGPU/debug-frame.ll
+4-0llvm/include/llvm/CodeGen/MachineFunction.h
+133-865 files not shown
+143-9011 files

LLVM/project 20dec1ellvm/lib/Target/AMDGPU SIFrameLowering.cpp SIMachineFunctionInfo.h, llvm/test/CodeGen/AMDGPU amdgpu-spill-cfi-saved-regs.ll

[AMDGPU] Implement -amdgpu-spill-cfi-saved-regs

These spills need special CFI anyway, so implementing them directly
where CFI is emitted avoids the need to invent a mechanism to track them
from ISel.

Change-Id: If4f34abb3a8e0e46b859a7c74ade21eff58c4047
Co-authored-by: Scott Linder scott.linder at amd.com
Co-authored-by: Venkata Ramanaiah Nalamothu VenkataRamanaiah.Nalamothu at amd.com
DeltaFile
+2,926-0llvm/test/CodeGen/AMDGPU/amdgpu-spill-cfi-saved-regs.ll
+12-0llvm/lib/Target/AMDGPU/SIFrameLowering.cpp
+10-0llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h
+9-0llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+2-0llvm/lib/Target/AMDGPU/SIRegisterInfo.h
+2,959-05 files

LLVM/project fff1235llvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll gfx-callable-argument-types.ll

[AMDGPU] Implement CFI for CSR spills

Introduce new SPILL pseudos to allow CFI to be generated for only CSR
spills, and to make ISA-instruction-level accurate information.

Other targets either generate slightly incorrect information or rely on
conventions for how spills are placed within the entry block. The
approach in this change produces larger unwind tables, with the
increased size being spent on additional DW_CFA_advance_location
instructions needed to describe the unwinding accurately.

Change-Id: I9b09646abd2ac4e56eddf5e9aeca1a5bebbd43dd
Co-authored-by: Scott Linder <scott.linder at amd.com>
Co-authored-by: Venkata Ramanaiah Nalamothu <VenkataRamanaiah.Nalamothu at amd.com>
DeltaFile
+3,568-2,598llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+1,912-1,913llvm/test/CodeGen/AMDGPU/gfx-callable-argument-types.ll
+2,700-12llvm/test/CodeGen/AMDGPU/accvgpr-spill-scc-clobber.mir
+631-631llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+505-510llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll
+394-399llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll
+9,710-6,063108 files not shown
+14,825-9,526114 files

LLVM/project 93f5fe8llvm/test/CodeGen/AMDGPU amdgcn.bitcast.1024bit.ll amdgcn.bitcast.960bit.ll

[AMDGPU] Use register pair for PC spill

Change-Id: Ibedeef926f7ff235a06de65a83087c151f66a416
DeltaFile
+4,331-4,331llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+1,742-1,740llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll
+1,562-1,560llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+1,462-1,460llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll
+1,238-1,236llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.832bit.ll
+1,030-1,028llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.768bit.ll
+11,365-11,35589 files not shown
+18,153-18,04495 files