IR: Validate and document the "target-abi" module flag
The "target-abi" module flag is already emitted by clang for RISC-V and
consumed by the RISC-V and LoongArch backends, but it was neither validated
by the IR Verifier nor documented in LangRef. Add a Verifier check that the
flag's value operand is a non-empty string.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[AMDGPU] PromoteAlloca: split scalar accesses that span several elements
promoteAllocaToVector already splits a *vector* access across several
elements when it is a multiple of the element size, but a *scalar* access
had to be bitcastable to the element type, so an i64 load from an alloca
promoted to <8 x i32> was rejected as "not a supported access type" and
the object stayed in scratch.
Accept a scalar access that is a whole multiple of the element size and
route it through the existing subvector path, which already builds the
value from consecutive elements and bitcasts. Accesses with padding are
still rejected, since splitting those would put the pieces at the wrong
offsets, as are non-integer non-float types.
[AMDGPU] PromoteAlloca: flatten homogeneous structs to vectors
getVectorTypeForAlloca() peeled nested ArrayType and one inner
FixedVectorType, but stopped at any StructType. An alloca of an array of
structs was therefore rejected with "Cannot convert type to vector" and
fell back to scratch, even when the struct was a trivial wrapper around a
scalar.
Peel structs too, but only when every field has the same type and the
struct has no padding, so flattened elements keep the byte offsets the
surrounding index arithmetic assumes. Structs with differing field types
or with padding are left alone.
Simplify logic via suggestions from PR feedback. Add additional test cases, make tests a bit more complex so they don't fold into simple store of constant
[docs] Fix default Sphinx worker count (#217429)
I renamed the variable at the last minute, and the search and replace
didn't catch all instances. Follow-up to #217161 /
0e6f9b26868c37cfb27fdc99af0524ed78e1dfd8.
CodeGen: Consolidate target-abi validation
LoongArch and RISCV both implemented an error if the
"target-abi" module flag was inconsistent with the -target-abi
option flag. Consolidate these into one place, and change
from a fatal error to a nonfatal context error.
One untested incidental behavior change is for garbage names.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[LLD][MachO] Remove eh-frame test binaries (#217107)
Use `update_test_body.py` to generate `.yaml` files that can be
converted to `.o` files to be used in the test. This allows us to delete
the `eh-frame-{arm64,x86_64}-r.o` binaries, and makes it much easier to
update the data (note that it needs to run on a mac). I check the output
of `obj2yaml` and saw the only difference from the inline `.yaml` files
are the version numbers.
[docs] Parallelize Sphinx builds by default (#217161)
Sphinx doc builds are slow now that we're using the furo theme. We can
speed them up by using the sphinx-build -j flag. This adds and documents
two new cmake options:
1. `LLVM_PARALLEL_SPHINX_JOBS`: Controls the sphinx-build ninja pool
depth, just like LLVM_PARALLEL_LINK_JOBS does.
2. `LLVM_SPHINX_BUILD_JOBS`: Controls the sphinx-build -j flag, which
controls internal parallelism. Defaults to nproc+1/2.
This is imperfect because we may oversubscribe the CPU with tasks, but
doc build actions are usually on the critical path at the end of the
build, or they are in large, non-incremental batch build actions that
build all targets. This approximate approach seems reasonable.
3-run hyperfine comparison for clean docs-llvm-html builds, removing the
html output and doctree cache before each timing run:
[5 lines not shown]
Restore OpenMP 5.0 metadirective coverage
Restore the test invocation removed when the 5.2 coverage was added. The
existing pre-5.2 fallback spelling remains valid at OpenMP 5.0.
Validate metadirective replacement nesting
Track each reachable replacement with the effective enclosing directive
path that selects it. Validate selected directives and nested constructs
against those correlated paths instead of flattening replacements.
Reuse direct ORDERED, SCAN, BARRIER, worksharing, SIMD, MASTER, and
cancellation checks for selected variants, including parent-clause
restrictions and sink-vector lengths.
Move barrier rejection fully into semantics and add focused coverage for
valid and invalid replacement paths.
[flang] - Call _FortranAAssignSimple instead of _FortranAAssign for intrinsic-type array assignments.
This patch adds support for calling _FortranAAssignSimple, a faster-path for array assignments.
`_FortranAAssignSimple` is called when ALL the following conditions are true:
1. Intrinsic element type (not derived type)
2. Matching ranks (no scalar-to-array broadcasting)
3. Non-volatile
4. Not polymorphic
5. Not explicit-length character
6. Not temporary LHS
Otherwise, uses `_FortranAAssign` (or specialized variants like `_FortranAAssignPolymorphic`, `_FortranAAssignExplicitLengthCharacter`).
This is a (perhaps final) part of the fix for https://github.com/llvm/llvm-project/issues/203915
[profile] hoist length check before use of pointer (#217109)
If a truncated profile is passed into this endpoint (say, 1 byte), we
unconditionally do `((__llvm_profile_header
*)ProfileData)->BinaryIdsSize`, which reaches outside of the `char`
array passed to this function.
Hoisting the check prevents the out-of-bounds read.
[AMDGPU] PromoteAlloca: split scalar accesses that span several elements
promoteAllocaToVector already splits a *vector* access across several
elements when it is a multiple of the element size, but a *scalar* access
had to be bitcastable to the element type, so an i64 load from an alloca
promoted to <8 x i32> was rejected as "not a supported access type" and
the object stayed in scratch.
Accept a scalar access that is a whole multiple of the element size and
route it through the existing subvector path, which already builds the
value from consecutive elements and bitcasts. Accesses with padding are
still rejected, since splitting those would put the pieces at the wrong
offsets, as are non-integer non-float types.
[AMDGPU] PromoteAlloca: flatten homogeneous structs to vectors
getVectorTypeForAlloca() peeled nested ArrayType and one inner
FixedVectorType, but stopped at any StructType. An alloca of an array of
structs was therefore rejected with "Cannot convert type to vector" and
fell back to scratch, even when the struct was a trivial wrapper around a
scalar.
Peel structs too, but only when every field has the same type and the
struct has no padding, so flattened elements keep the byte offsets the
surrounding index arithmetic assumes. Structs with differing field types
or with padding are left alone.
Simplify logic via suggestions from PR feedback. Add additional test cases, make tests a bit more complex so they don't fold into simple store of constant