[VPlan] Only treat i8 GEPs by the step as pointer IV increments (#249386)
getOptimizableIVOf treated any GEP of a pointer induction by its step
value as the IV increment. The pointer induction step is in bytes, so a
GEP with a wider source element type, e.g.
getelementptr i32, ptr %iv, i64 4 for a 4-byte step, adds a multiple of
the step and its exit value was wrongly computed as the IV end value.
Require an i8 GEP.
[CI] Check Linux premerge build dependencies with Ninja
Run missingdeps at the end of monolithic-linux.sh, after project checks
and both runtime reconfigurations, so compiler dependencies have been
recorded. Include the selected check targets alongside all.
Use start-group to give the check a named log section, and capture its
output in ninja_missingdeps.log for artifact collection. Keep the check
in the shared Linux build script rather than a GitHub-only workflow
step.
Validated shell syntax, workflow YAML, and a whole-script harness with
real Ninja dependency checks. The check runs after all build phases,
records diagnostics, fails for a missing generator dependency, and
passes when that dependency is declared.
Assisted-by: Codex
[VPlan] Fix crash on select-conditioned partial reductions. (#249385)
transformToPartialReduction cast the select of the reduction update and
phi to VPInstruction, but a select from the original loop is a
VPWidenRecipe. Use VPSingleDefRecipe instead, and insert the partial
reduction at the select, where its condition is defined.
[CIR][flang][CMake] Migrate generated-header dependencies
Replace CIR's mlir-headers dependencies and Flang's global MLIR library
lists with actual library dependencies. Declare public header ownership
and keep source shards, bytecode and lowering tables private.
CIRLowering.inc is no longer generated by install-clang-headers; only
transform/lowering sources include it and each consumer lists
CIRLowering. clang_tablegen accepts PRIVATE_TARGET to create it without
registering a global Clang dependency, isolating its output from the
caller's TABLEGEN_OUTPUT. Use add_private_tablegen_target for bytecode
tables, source shards and FIR canonicalization patterns, keeping their
outputs out of later generation targets. Keep
CanonicalizationPatternsIncGen in flang-headers so the header install
still generates every installed .inc file. clangFrontendTool links CIR
libraries privately after creation to preserve LLVM component
visibility, reducing obj.clangInterpreter's prerequisite edges from 579
at the base to 535 and obj.clangFrontendTool's from 1710 to 888.
[21 lines not shown]
[MLIR][CMake] Stop depending on mlir-headers by default
Remove the default mlir-headers dependency from the dialect, conversion,
extension and translation library helpers. Keep the aggregate, its
registrations and explicit compatibility dependencies available;
mlir-generic-headers remains a default.
Replace redundant foreign generator edges with library links or
compile-only header owners. Add generator-to-generator ordering where
one generated header includes another. Keep requirements already covered
by generic headers or existing links. MLIRROCDLDialect, MLIRXeVMDialect
and MLIRSPIRVDialect retain private compile-only requirements on
MLIRGPUBase for GPU compilation attribute declarations.
MLIRRewrite drops its PDL generator dependencies; the PDL libraries it
links publish them. Remove redundant C API pass-generator dependencies.
Test aggregate independence for the dialect, conversion, extension and
translation helpers.
[6 lines not shown]
[MLIR][CMake] Stop depending on mlir-generic-headers by default
Remove the default mlir-generic-headers dependency from ordinary and
example libraries. Migrate generated-interface requirements to library
owners, including the 17 requirements that become necessary when the
generic default is removed. Keep the compatibility aggregate and
registrations.
MLIRIR also lists MLIRInferIntRangeInterfaceIncGen for Matchers.h. Add
the Transform/Interfaces generator ordering. MLIRDialectUtils uses the
ArithDialect owner for ReshapeOpsUtils.h. Forward MaskableOpInterface's
compile-only MaskingOpInterface dependency through the local helper so
directly compiled libraries receive a bridge too.
MLIRCAPIIR links MLIRInferTypeOpInterface privately. MLIRPass,
MLIRRewrite and MLIRRewritePDL drop their explicit DEPENDS
mlir-generic-headers.
Extend the release note, guide and aggregate-independence regression to
[3 lines not shown]
[MLIR][docs] Document the CMake infrastructure
Describe MLIR's TableGen, library, visibility, aggregation, installation
and generated-header conventions in one infrastructure guide. Explain
library owners, explicit generators, compile-only requirements and
add_private_tablegen_target for source-only generators.
Document raw-link bridge usage, generated-header ordering and
unsupported compile-only spellings. Describe the aggregate defaults as
they are today. Link the guide from CreatingADialect.md.
Assisted-by: Codex
[CMake] Propagate generated headers through link dependencies
llvm_add_library made object libraries wait for whole PUBLIC link
providers to obtain generated headers. Publish marked DEPENDS generators
through the LLVM_GENERATED_HEADERS transitive compile property instead,
and order obj.<name> after the evaluated closure through a
<name>.headers bridge target. PRIVATE and transitive compile
requirements participate without compiling provider objects.
Use COMPILE_ONLY for another library's headers without its
implementation. Keep these items build-local, and create a bridge for
directly compiled libraries only when such an item is present.
llvm_add_generated_header_bridge covers items added later. Existing
Windows PCH variants also wait for the owner's bridge. Executables
compiled through obj.<tool> receive a bridge too, without linking their
object libraries to providers.
Shared libraries republish the interfaces of unkeyed links and
components hidden by shared mode. Explicit PRIVATE component
[35 lines not shown]
[TargetParser][NFC] Move BasicSubtarget* into lib/ (#247094)
After #198433, there's nothing left in TargetParser.h that is needed for
outside users, it only exports BasicSubtarget* structs and a function
that is only used inside lib/TargetParser. Move the header into lib/.
Also rename it to BasicSubtarget to more accurately describe the
remaining content.
[Polly] Enable IRBuilder GEP canonicalization (#249378)
ParallelLoopGenerator::extractValuesFromStruct() took the type of the
loaded value from the result element type of the struct GEP, which is
now i8. Take it from the struct type instead.
Assisted-by: LLM
[X86] Truncate uitofp vXi64 to vXi32 if the upper 32 bits are known zero (#236194)
Without AVX512DQ, uitofp from vXi64 gets scalarized even when the upper
32 bits are known zero. combineUIntToFP sees the sign bit is zero and
turns it into sint_to_fp vXi64, but combineSIntToFP only narrows to
vXi32 when there are at least 33 sign bits, so we end up keeping the i64
conversion. I truncate the source to vXi32 first and convert from that
instead. With AVX512DQ the vXi64 conversion is already legal, so there I
only do it when the truncate is free, using the isTruncateFree change
from #249269.
Fixes #230152
---------
Co-authored-by: Simon Pilgrim <llvm-dev at redking.me.uk>
[LLD][NFC] Correct plugin test requirements (#249196)
Plugin tests require the plugin targets to be defined
(LLVM_INCLUDE_EXAMPLES), not that they are also built by default
(LLVM_BUILD_EXAMPLES). Adjust the conditions to match LLVM examples.
This will also cause these tests to run in several more CI
configurations, as LLVM_BUILD_EXAMPLES is usually off.
[Offload][OpenMP] Build TIMESCOPE profile details lazily (#246497)
The TIMESCOPE_*_IDENT macros constructed a SourceInfo from the ident_t
and concatenated the detail strings on every call, even when the time
trace profiler is disabled. Parsing the source location costs several
allocations plus string searches and integer conversions, which
dominates short runtime entry points. For example, a 'target data'
region with only 'use_device_addr' spent about half of its time there.
Pass the detail as a callback to llvm::TimeTraceScope, which only
invokes it when the profiler is enabled. The detail string is still
computed at scope entry, so the produced trace is unchanged.
On gfx90a, this reduces the cost of a 'use_device_addr' lookup in the
LCOMPILER-3239 reproducer from 1.47 us to 0.98 us per call.
Fixes: LCOMPILER-3239
Co-Authored-By: Claude <noreply at anthropic.com>
[2 lines not shown]
[FunctionAttrs] Don't build an access range for zero-size types (#249156)
`getArgumentAccessInfo` builds the range [Offset, Offset + Size) for a
load or store. For a zero-size type such as `{}`, both bounds are equal
and the ConstantRange constructor asserts. At offset 0 the range is
empty and a ConstantRangeList assertion fires instead.
This returns no range for zero-size types, like `GetConstantIntRange`
already does for zero-length memory intrinsics. A zero-size load is then
treated as an unknown access, the same as a zero-length memcpy source.
We could treat it as no access instead, but the complexity does not seem
worth it.
Fixes #225289.
Assisted-by: Claude Code (Opus 5.5)
[llvm-readobj][AMDGPU] Fix crash printing AMDGPU symbol types (#249193)
llvm-readelf --symbols and --hash-symbols ask the AMDGPU symbol type
table for its GNU name, but the table only has one name per entry. A
symbol of type STT_AMDGPU_HSA_KERNEL hits an assertion, or reads past
the table in a build without assertions.
Use the table's only name instead. Also print an unnamed OS-specific
type as a number in --hash-symbols, as --symbols does, instead of an
empty string.
Assisted-by: Claude Opus 5.5