LLVM/project 9b1e3e0 — utils/bazel/llvm-project-overlay/libc BUILD.bazel, utils/bazel/llvm-project-overlay/libc/src/string BUILD.bazel

[bazel] Add rules for remaining string.h functions (#245367)

Additionally, add the corresponding aliases.

Assisted-by: Claude Fable 5.2
DeltaFile
+36-0utils/bazel/llvm-project-overlay/libc/src/string/BUILD.bazel
+15-0utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+51-02 files

LLVM/project a84dba7 — llvm/lib/Target/SystemZ SystemZScheduleZEC12.td SystemZScheduleZ196.td

[SystemZ] Add missing CC def to TRANSLATE EXTENDED (TRE)

TRE sets the condition code (0: operand processed, 1: test character
found, 3: CPU-determined amount processed), but its definition did not
list CC as an implicit def.

Adding the def raises TRE's write count from two to three, so update the
TRE scheduling entries for z196 through z17 to match (as for CU41/CU42).

Assisted by: IBM Bob
DeltaFile
+1-1llvm/lib/Target/SystemZ/SystemZScheduleZEC12.td
+1-1llvm/lib/Target/SystemZ/SystemZScheduleZ196.td
+1-1llvm/lib/Target/SystemZ/SystemZScheduleZ17.td
+1-1llvm/lib/Target/SystemZ/SystemZScheduleZ16.td
+1-1llvm/lib/Target/SystemZ/SystemZScheduleZ15.td
+1-1llvm/lib/Target/SystemZ/SystemZScheduleZ14.td
+6-62 files not shown
+8-88 files

LLVM/project 179060f — flang/include/flang/Optimizer/Analysis AliasAnalysis.h, flang/lib/Optimizer/Analysis AliasAnalysis.cpp

[flang] Let FIR AA calls access the data of descriptor arguments (#244452)

getCallModRef finds whether a call may access a variable through its
arguments with alias(arg, var). When the argument is the address of a
descriptor, e.g. an allocatable passed to an allocatable dummy, alias()
answers NoAlias for the data that the descriptor describes, because the
address of a descriptor does not alias the address of data. So getModRef
answered NoModRef for the data of an allocatable across a call that may
modify it, and LICM could hoist a read of the data out of a loop that
passes the descriptor to such a call.

An argument that is the address of a descriptor now also passes the data
that the descriptor describes. getCallModRef builds the source of that
data as getSource() does for a fir.box_addr of a fir.load of the
argument, and compares it with the source of the variable using the part
of alias() that compares the sources, which moves into aliasSources().
The intent of the dummy applies to the data as well.

Assisted-by: AI
DeltaFile
+192-0flang/test/Analysis/AliasAnalysis/modref-call-descriptor-argument.fir
+81-0flang/test/Transforms/licm-descriptor-argument.fir
+58-11flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
+17-0flang/include/flang/Optimizer/Analysis/AliasAnalysis.h
+348-114 files

LLVM/project 9893dee — flang/lib/Optimizer/Analysis AliasAnalysis.cpp, flang/test/Analysis/AliasAnalysis modref-call-no-symbol-lookups.fir modref-call-globals.f90

[flang] A call may access a saved local through another instance of its procedure (#244077)

`fir::AliasAnalysis::getModRef` assumed that a call to a Fortran
procedure cannot access a saved local variable other than through its
arguments, unless the variable is a TARGET or is used in an internal
procedure. That is wrong when the call may invoke the procedure that
owns the variable: all the instances of a procedure share its saved
local variables (F2023 8.5.16), so the other instance may read or write
the variable. For example, LICM hoisted the load of `x` out of the loop
below, and the program printed 0 instead of 6 at `-O1` and above:

```fortran
module m
contains
  recursive subroutine work(nested, total)
    logical, intent(in) :: nested
    integer, intent(out) :: total
    integer, save :: x
    integer :: i

    [62 lines not shown]
DeltaFile
+403-0flang/test/Analysis/AliasAnalysis/modref-call-saved-locals.fir
+93-0flang/test/Transforms/licm-saved-local.fir
+77-3flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
+44-2flang/test/Analysis/AliasAnalysis/modref-call-globals.f90
+6-4flang/test/Analysis/AliasAnalysis/modref-call-no-symbol-lookups.fir
+623-95 files

LLVM/project bd8b484 — llvm/lib/CodeGen/GlobalISel IRTranslator.cpp, llvm/test/CodeGen/AArch64 mops-dead-nzcv.ll

[GlobalISel] Use Info.size from getTgtMemIntrinsic for the memory type (#242433)

Handle every value of Info.size like SelectionDAGBuilder does, instead
of always using the size of memVT:
- An unknown size creates an unknown-size MachineMemOperand. Previously
      llvm.aarch64.mops.memset.tag was described as a 1-byte store.
- A known size that differs from memVT uses a scalar of that size. This
changes PowerPC, which reports a 31-byte access for llvm.ppc.vsx.lxvd2x,
      llvm.ppc.altivec.stvx and related intrinsics.
    - A size that matches memVT keeps the type of memVT.

---------

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+38-0llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-unknown-size-memop.ll
+33-0llvm/test/CodeGen/PowerPC/GlobalISel/irtranslator-tgt-mem-intrinsic-size.ll
+16-3llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+1-1llvm/test/CodeGen/AArch64/mops-dead-nzcv.ll
+88-44 files

LLVM/project 9054099 — lld/MachO ConcatOutputSection.cpp InputFiles.cpp, lld/test/MachO arm64-thunk-unsorted-relocs.s

[lld][MachO] Fix branch extension thunks for ld -r inputs (#243818)

TextOutputSection::finalize() walked each section's relocations
backwards to visit its branches by ascending offset, asserting the
descending order compilers emit. Object files from ld -r do not follow
it, which failed the link with a misleading "thunk range overrun" error.

Sort the relocations of sections that are out of order while parsing
them, so that finalize() can rely on that order.
DeltaFile
+78-0lld/test/MachO/arm64-thunk-unsorted-relocs.s
+12-0lld/MachO/InputFiles.cpp
+2-5lld/MachO/ConcatOutputSection.cpp
+92-53 files

LLVM/project 1d9f44a — llvm/test/CodeGen/Mips dsp-vec-bitcast.ll

fixup! [Mips] Fix DSP bitcasts between v2i16 and v4i8
DeltaFile
+21-37llvm/test/CodeGen/Mips/dsp-vec-bitcast.ll
+21-371 files

LLVM/project c994aa8 — clang/docs ReleaseNotes.md, clang/include/clang/Basic DiagnosticParseKinds.td

[CUDA][clang] Remove parenthesized #pragma unroll warning (#244791)

nvcc accepts both `#pragma unroll N` and `#pragma unroll (N)` and
generates identical code, and the CUDA C++ Programming Guide
documents the parenthesized form.

The `-Wcuda-compat` warning matched pre-CUDA-8.0 `nvcc` behavior, when
the  unroll factor had to be a literal. CUDA 8.0 added support for integral
constant expressions, so the warning is obsolete.

Assisted-By Claude
DeltaFile
+48-0clang/test/Parser/pragma-unroll-cuda.cu
+0-13clang/test/Parser/warn-cuda-compat.cu
+7-0clang/docs/ReleaseNotes.md
+0-6clang/lib/Parse/ParsePragma.cpp
+0-5clang/include/clang/Basic/DiagnosticParseKinds.td
+55-245 files

LLVM/project ec61778 — mlir/lib/Dialect/Vector/IR VectorOps.cpp, mlir/test/Dialect/Vector canonicalize.mlir

[mlir][vector] Do not fold contiguous gather/scatter on non-unit strides

Assisted-by: Claude Opus 5.5
DeltaFile
+44-0mlir/test/Dialect/Vector/canonicalize.mlir
+12-2mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+56-22 files

LLVM/project 0ccd67c — mlir/include/mlir/Dialect/Vector/IR VectorOps.h, mlir/lib/Conversion/VectorToLLVM ConvertVectorToLLVM.cpp

[mlir][vector] Allow single-element strided load/store in LLVM lowering (#241579)

The verifier allows a non-unit stride in the most minor memref dim when
`vector.load`/`vector.store` accesses a single element. The LLVM
lowering still asserts unit stride, so this crashes
`-convert-vector-to-llvm`:

```mlir
func.func @f(%m: memref<4xf32, strided<[3]>>, %i: index) -> vector<1xf32> {
  %0 = vector.load %m[%i] : memref<4xf32, strided<[3]>>, vector<1xf32>
  return %0 : vector<1xf32>
}
```

This patch moves the verifier condition into
`vector::isValidLoadStoreMemRefLayout` and uses it in both places, so
they cannot diverge again.

Fixes #239720
DeltaFile
+58-0mlir/test/Conversion/VectorToLLVM/vector-load-store-to-llvm.mlir
+9-5mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+5-6mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
+5-0mlir/include/mlir/Dialect/Vector/IR/VectorOps.h
+77-114 files

LLVM/project b36bb5e — llvm/test/MC/AMDGPU gfx13_asm_vop2.s gfx12_asm_vop2.s

[AMDGPU][AsmParser] Pre-commit tests for v_pk_fmac_f16 fp inline constants. NFC (#245422)

Add GFX11/GFX12/GFX13 MC tests for v_pk_fmac_f16 with fp literal tokens
that are f16 inline constants (0.5, -1.0), a non-inlinable fp value
(1.5), an integer literal (0x3800), and an explicit lit(0.5). The check
lines reflect current behavior, where 0.5 and -1.0 are encoded as 32-bit
literals.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+12-0llvm/test/MC/AMDGPU/gfx13_asm_vop2.s
+12-0llvm/test/MC/AMDGPU/gfx12_asm_vop2.s
+12-0llvm/test/MC/AMDGPU/gfx12_asm_vop2-fake16.s
+12-0llvm/test/MC/AMDGPU/gfx11_asm_vop2.s
+12-0llvm/test/MC/AMDGPU/gfx11_asm_vop2-fake16.s
+60-05 files

LLVM/project dd88a5a — clang/lib/Format UnwrappedLineParser.h UnwrappedLineParser.cpp, clang/unittests/Format BracesInserterTest.cpp

[clang-format] Fix InsertBraces rebinding an else in a preprocessor branch (#239414)

Don't insert braces around a body ending in an `if` whose `else` may
appear in a preprocessor branch skipped in the current formatting pass.
Inserting those braces can attach the `else` to a different `if` or
leave it without a matching `if`.

Fixes #239332.
DeltaFile
+186-0clang/unittests/Format/BracesInserterTest.cpp
+107-1clang/lib/Format/UnwrappedLineParser.cpp
+4-0clang/lib/Format/UnwrappedLineParser.h
+297-13 files

LLVM/project 21a4398 — clang/lib/AST ExprConstant.cpp, clang/lib/AST/ByteCode InterpBuiltin.cpp

[clang] Add __builtin_iseqsig (#244875)

Add the __builtin_iseqsig builtin that GCC provides for the C23
iseqsig macro. It takes two real floating-point arguments, with the
usual arithmetic conversions like the other comparison builtins
(__builtin_isless and friends), and returns whether they compare
equal. Unlike those builtins it is a signaling comparison, so emit it
with CreateFCmpS: a constrained fcmps when FP exceptions are modeled,
and a plain fcmp oeq otherwise, the same as ==.

When FP exceptions are modeled, don't constant fold it outside of a
constant context if an operand is a NaN, as for the comparison
operators, so that "invalid" is still raised.

Like GCC's builtin, it does not set errno. A C library can use it to
implement iseqsig when math_errhandling does not include MATH_ERRNO.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+73-0clang/test/CodeGen/builtin-iseqsig.c
+47-0clang/test/Sema/builtin-iseqsig.c
+13-1clang/lib/AST/ExprConstant.cpp
+13-0clang/lib/AST/ByteCode/InterpBuiltin.cpp
+11-0clang/test/CodeGen/fpconstrained-cmp-float.c
+11-0clang/test/CodeGen/fpconstrained-cmp-double.c
+168-16 files not shown
+203-812 files

LLVM/project 0db5011 — lld/MachO SectionPriorities.cpp, lld/test/MachO order-file.s

[lld/mac] Make order file handling look more like in the ELF port (#242735)

I made a PR to port #241470 to ELF (#242729). In doing so, I realized
that the ELF port's approach of getting symbols from the symbol table
and just local symbols from files is both faster (we don't need to
process symbols that make it into the symbol table many times) and more
correct (it allows handling symbols that aren't in any files, such as
alias symbols. Xcode's ld supports listing those in order_files. We used
to not support that, now we do). So switch to ELF's approach.

In a sense, ports #242729 back to MachO.

Linking Chromium Framework on an M4 Max, with Chromium's order file (5
symbols):

    "Sort segments and sections" (median of 7): 41 ms -> 31 ms
Total link (hyperfine, 15 runs): 4.022 s +- 0.046 s -> 4.016 s +- 0.037
s
    User time: 7.58 s -> 7.52 s

    [9 lines not shown]
DeltaFile
+24-10lld/MachO/SectionPriorities.cpp
+15-0lld/test/MachO/order-file.s
+39-102 files

LLVM/project 692e05a — lld/ELF Writer.cpp

[lld/ELF] Look up --symbol-ordering-file symbols in parallel (#242729)

This ports #241470 to ELF.

It uses parallelForEachFineGrained() though, something I'll port back to
MachO :)

Linking Chromium on an M4 Max, with a synthetic ordering file with 6
symbols:

    "Sort sections" time trace scope (median of 7): 108 ms -> 24 ms
    Total link (hyperfine, median of 15): 2.936 s -> 2.855 s

With a synthetic ordering file listing all 1.56M defined symbols of the
output:

    "Sort sections" time trace scope (median of 7): 467 ms -> 183 ms
    Total link (hyperfine, median of 15): 3.437 s -> 3.151 s

No behavior change.
DeltaFile
+35-22lld/ELF/Writer.cpp
+35-221 files

LLVM/project 2fcb2d3 — llvm/lib/Target/SPIRV SPIRVLegalizeResourceBinding.cpp SPIRVLowerResourceNames.cpp, llvm/test/CodeGen/SPIRV/hlsl-resources resource-names.ll

[hlsl][spirv] Dont emit string constants for resource names (#243531)

Resource intrinsics (handlefrombinding, handlefromimplicitbinding) take
const char * arguments which get lowered in backend into byte arrays in
the final spirv module. These should be ignored except to provide the
literal to OpName instructions.

Add a pass intentionally before SPIRVRemoveUnusedResources and
SPIRVLegalizeResourceBinding, which converts handle intrinsics to
variants taking a metadata arg for the name instead. This lets us avoid
emitting actual constants in the spirv, which requires int8 capability,
and simplifies, for example, string global removal in the unused
resources pass, and lowering of heap resources to handlefrombinding.

It would be preferable to emit these metadata variants from Clang, but
this is not currently possible due to handlefrombinding generation
taking place in generated initializers, eg __createFromBinding, so a
string arg must be passed initially.


    [2 lines not shown]
DeltaFile
+121-0llvm/lib/Target/SPIRV/SPIRVLowerResourceNames.cpp
+23-66llvm/lib/Target/SPIRV/SPIRVLegalizeResourceBinding.cpp
+65-0llvm/test/CodeGen/SPIRV/hlsl-resources/resource-names.ll
+53-0llvm/test/Transforms/EarlyCSE/SPIRV/resource-name-metadata.ll
+14-16llvm/test/CodeGen/SPIRV/pointers/structured-buffer-access.ll
+11-11llvm/test/CodeGen/SPIRV/passes/SPIRVLegalizeRegisterBinding-Heap.ll
+287-9328 files not shown
+414-16734 files

LLVM/project 96f70b1 — llvm/include/llvm/CodeGen MachineInstr.h, llvm/lib/CodeGen CalcSpillWeights.cpp MachineInstr.cpp

Move the later folding fixes to their own PRs

1d50fec74e60 added more fixes for folding inline asm register operands
to this PR. They're split into the PRs stacked on this one, one fix
each, to keep this one to the tied operand fix that was reviewed.

This reverts commit 1d50fec74e601c10811a0d58c37a392b2a1ba146.

Assisted-by: Claude Opus 5.5
DeltaFile
+48-197llvm/test/CodeGen/X86/greedy-inline-asm-fold.mir
+51-102llvm/lib/CodeGen/TargetInstrInfo.cpp
+0-100llvm/test/CodeGen/X86/peephole-inline-asm-fold.mir
+19-37llvm/lib/CodeGen/MachineInstr.cpp
+5-13llvm/lib/CodeGen/CalcSpillWeights.cpp
+2-9llvm/include/llvm/CodeGen/MachineInstr.h
+125-4584 files not shown
+130-47110 files

LLVM/project db31b5f — llvm/test/CodeGen/X86 greedy-inline-asm-fold.mir

Test a tie whose def moves when a folded operand is before it

Folding a "+rm" pair before a "+r" pair moves the "+r" pair's def, so
both ends of its tie get new indices. The other tests only moved the
use.

Assisted-by: Claude Opus 5.5
DeltaFile
+51-0llvm/test/CodeGen/X86/greedy-inline-asm-fold.mir
+51-01 files

LLVM/project 6f27fb1 — llvm/include/llvm/CodeGen MachineInstr.h, llvm/lib/CodeGen CalcSpillWeights.cpp MachineInstr.cpp

[CodeGen] Fix more hazards in folding inline asm register operands

Nothing in tree marks an inline asm operand foldable until #229632, so
these were found by a review of the stack rather than by tests:

- The spill weights took a register to be foldable into an asm if any one
  of its operands there was foldable, while the folder needs all of them
  to be. One value passed to an "rm" and an "r" operand could then get
  spilled, not folded, and reloaded into a register the asm didn't have.
  Add MachineInstr::mayFoldInlineAsmReg(), true if every operand of a
  register in an asm can be folded, and use it in the folder,
  CalcSpillWeights, and InlineSpiller.
- The folder now folds every operand of the register, including an undef
  use that InlineSpiller leaves out of the operands it passes, which was
  left behind still referring to the spilled register.
- InlineSpiller rematerialized a value passed to a foldable operand (e.g.
  a constant) into a register right before the asm, which the asm may not
  have had. It's spilled and folded instead.
- An asm that can fold a register no longer adds to the register's spill

    [18 lines not shown]
DeltaFile
+197-48llvm/test/CodeGen/X86/greedy-inline-asm-fold.mir
+101-50llvm/lib/CodeGen/TargetInstrInfo.cpp
+100-0llvm/test/CodeGen/X86/peephole-inline-asm-fold.mir
+38-20llvm/lib/CodeGen/MachineInstr.cpp
+13-5llvm/lib/CodeGen/CalcSpillWeights.cpp
+9-2llvm/include/llvm/CodeGen/MachineInstr.h
+458-1254 files not shown
+471-13010 files

LLVM/project 71185ac — llvm/lib/CodeGen TargetInstrInfo.cpp MachineInstr.cpp

Move folding register checks into mayFoldInlineAsmRegOp so that it's available everywhere.
DeltaFile
+9-0llvm/lib/CodeGen/MachineInstr.cpp
+1-7llvm/lib/CodeGen/TargetInstrInfo.cpp
+10-72 files

LLVM/project 1c7846b — llvm/test/CodeGen/X86 greedy-inline-asm-fold.mir

[TargetInstrInfo] Address review: autogenerate greedy-inline-asm-fold.mir checks

Generate the checks with update_mir_test_checks.py so that the spills and
reloads around each folded inline asm are verified, not just the INLINEASM
itself. Fix the "=r" comment to describe the C "+r" operand, note that which
"+rm" pair greedy folds is its own choice, and add a "+&rm" case on an
uninitialized value showing that folding a pair whose tied use is undef
stores to the slot without loading from it.

Assisted-by: Claude Opus 5.5
DeltaFile
+94-8llvm/test/CodeGen/X86/greedy-inline-asm-fold.mir
+94-81 files

LLVM/project 5f2ba1b — llvm/test/CodeGen/X86 greedy-inline-asm-fold.mir

[TargetInstrInfo] Address review: write the two-register flag symbolically

Now that the operand count of an inline asm flag can be written in MIR, use
"reguse:GR64 foldable ops:2" instead of an immediate whose register class ID
changes whenever a register class is added. Regenerate the checks, which
now print the five operands of each x86 memory reference as "ops:5".

Assisted-by: Claude Opus 5.5
DeltaFile
+10-12llvm/test/CodeGen/X86/greedy-inline-asm-fold.mir
+10-121 files

LLVM/project 45ee0ac — llvm/lib/CodeGen TargetInstrInfo.cpp, llvm/test/CodeGen/X86 greedy-inline-asm-fold.mir

[TargetInstrInfo] Address review: don't fold one register of a multi-register operand

A memory operand replaces exactly one register, so return nullptr for a
folded operand whose flag holds more than one, rather than relying on an
assert that release builds drop. Also assert that every folded operand
holds the same register, and say that a caller folding a def whose tied use
is another register must store that register's value into the slot.

Test both the new bail-out and folding a rematerialized load into two "rm"
operands, which takes the fold-a-load path.

Assisted-by: Claude Opus 5.5
DeltaFile
+72-0llvm/test/CodeGen/X86/greedy-inline-asm-fold.mir
+11-1llvm/lib/CodeGen/TargetInstrInfo.cpp
+83-12 files

LLVM/project e7463f2 — llvm/lib/CodeGen TargetInstrInfo.cpp, llvm/test/CodeGen/X86 greedy-inline-asm-fold.mir

[TargetInstrInfo] Fix folding inline asm operands next to tied operands

foldInlineAsmMemOperand() swapped a register operand for the target's
memory operands with MachineInstr::removeOperand(), which asserts when a
later operand is tied, because moving it would break the tie. Inline asm
lists every input after every output, so folding any operand that comes
before another tied pair asserted, e.g. an "rm" input followed by the
input of a "+r" operand, or one of two "+rm" operands. Without
assertions, the moved operands kept stale tie indices. Untie the
operands, rebuild the operand list, and re-tie the remaining pairs at
their new positions.

It also gave up when the register appears in more than one operand, e.g.
one value passed to two "rm" operands, which left the greedy allocator
unable to spill that value at all. Fold every such operand into the
stack slot.

Finally, take MayLoad from the folded operands rather than from every
read of the register: a folded def whose tied use is another virtual

    [9 lines not shown]
DeltaFile
+85-32llvm/lib/CodeGen/TargetInstrInfo.cpp
+108-0llvm/test/CodeGen/X86/greedy-inline-asm-fold.mir
+193-322 files

LLVM/project 2b8db1d — llvm/lib/CodeGen TargetInstrInfo.cpp

Include STLExtras.h for the range helpers

foldInlineAsmMemOperands uses is_contained, min_element, drop_begin,
and enumerate from STLExtras.h, which the file got only through other
headers.

Assisted-by: Claude Opus 5.5
DeltaFile
+1-0llvm/lib/CodeGen/TargetInstrInfo.cpp
+1-01 files

LLVM/project b2137c2 — llvm/lib/CodeGen TargetInstrInfo.cpp

Use drop_begin() for the operands after the first folded one

Assisted-by: Claude Opus 5.5
DeltaFile
+1-2llvm/lib/CodeGen/TargetInstrInfo.cpp
+1-21 files

LLVM/project 39c3bed — llvm/lib/CodeGen TargetInstrInfo.cpp

Update llvm/lib/CodeGen/TargetInstrInfo.cpp

Co-authored-by: Nick Desaulniers <ndesaulniers at google.com>
DeltaFile
+1-1llvm/lib/CodeGen/TargetInstrInfo.cpp
+1-11 files

LLVM/project 5ca1266 — llvm/include/llvm/CodeGen MachineInstr.h, llvm/lib/CodeGen MachineInstr.cpp

[TargetInstrInfo] Address review: don't fold a subregister that isn't at the start of the slot

A folded operand refers to the start of the stack slot, which holds the
whole register, so a subregister is only there if it's at bit offset 0 on a
little-endian target. Folding x86's sub_8bit_hi read byte 0 instead of byte
1. Folding several operands at once made this worse: two operands holding
different subregisters of one value (e.g. "Qm"(lo), "Qm"(hi)) both read
byte 0.

Check the subregister in mayFoldInlineAsmRegOp, so the spill weights agree
with what folds. A tied def is covered too, since its tied use has the same
subregister.

Assisted-by: Claude Opus 5.5
DeltaFile
+112-0llvm/test/CodeGen/X86/greedy-inline-asm-fold.mir
+11-0llvm/lib/CodeGen/MachineInstr.cpp
+2-1llvm/include/llvm/CodeGen/MachineInstr.h
+125-13 files

LLVM/project d68056c — llvm/include/llvm/IR InlineAsm.h, llvm/lib/CodeGen TargetInstrInfo.cpp MachineInstr.cpp

[MIR] Round-trip the "func" kind of inline asm operand flags (#237461)

An x86 inline asm call or jmp whose target is a function, given as a "p"
operand or as a "*m" operand that ISel turns into an address, gets a
flag of kind Func. Like a Mem flag, it carries a memory constraint. But
getKindName() returned "mem" for it, and the MIR printer printed the
constraint only for a Mem flag. So this:

  call void asm sideeffect "call ${0:P}", "p,~{dirflag},~{fpsr},~{flags}"(ptr @g)

was printed as:

  INLINEASM &"call ${0:P}", sideeffect attdialect, mem ops:5, target-flags(x86-plt) @g, 1, $noreg, 0, $noreg, ...

which parses back as a Mem flag with no constraint. Printing that again
hits llvm_unreachable, and the asm printer asserts in
PrintMemReference() instead of emitting "callq g at PLT".
MachineInstr::print() also printed the constraint as a register class
(e.g. "mem:GR8_NOREX").

    [8 lines not shown]
DeltaFile
+135-0llvm/unittests/Target/X86/InlineAsmOperandCommentTest.cpp
+38-0llvm/test/CodeGen/MIR/X86/inline-asm-func-kind.ll
+4-2llvm/include/llvm/IR/InlineAsm.h
+3-2llvm/lib/CodeGen/TargetInstrInfo.cpp
+3-2llvm/lib/CodeGen/MachineInstr.cpp
+2-1llvm/lib/CodeGen/MIRParser/MIParser.cpp
+185-72 files not shown
+187-88 files

LLVM/project f0f5939 — lld/test/ELF/lto non-prevailing-comdat-member.ll, llvm/lib/LTO LTO.cpp

[LTO] Check COMDAT key before marking the group non-prevailing (#222568)

Regular LTO currently adds a COMDAT into NonPrevailingComdats when
any member of the group is non-prevailing. This is not correct when
the member is not the COMDAT key.

The problem can be reproduced with the following code.
lto-dtor-comdat.h:
```
  struct Base {
    virtual ~Base() {}
  };

  template <int N> struct Derived final : Base {
    ~Derived() {}
  };
```
d0.cc:
```

    [44 lines not shown]
DeltaFile
+90-0llvm/test/LTO/Resolution/X86/non-prevailing-comdat-member.ll
+45-0lld/test/ELF/lto/non-prevailing-comdat-member.ll
+6-3llvm/lib/LTO/LTO.cpp
+141-33 files