[docs][libFuzzer] Fix formatting and collapsed definition lists (#206709)
This PR fixes broken formatting and collapsed definition lists in the
libFuzzer documentation by adding missing blank lines.
Closes #206706
Signed-off-by: Anchels <mishtitov at gmail.com>
[AArch64][SVE] Lower extended v2i8 loads using SVE. (#217006)
Loads of v2i8 are promoted to v2i32, which requires two extend
operations; v2i8 -> v2i16, then v2i16 -> v2i32. This comes largely for
free when using SVE's extending loads.
[lldb][Windows] Silence unused variable warning on Windows on Arm (#221176)
<...>/llvm-project/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp(507,8):
warning: unused variable 'log' [-Wunused-variable]
507 | Log *log = GetLog(WindowsLog::Exception);
| ^~~
Move that line into the `#ifndef __aarch64__` block to fix this.
[LV] Use getMaxRuntimeElementCount for MaxPowerOf2RuntimeVF. (#221219)
Use new getMaxRuntimeElementCount to compute MaxPowerOf2RuntimeVF to
avoid overflow by performing computations in uint64_t.
This fixes an overflow in the test added in #219290. We now correctly
determine that a tail is needed for a low trip count loop.
PR: https://github.com/llvm/llvm-project/pull/221219
[clang][CIR][AArch64] Move and reformat SVE test (#220599)
Adapts SVE tests to match the approach that we took for Neon. In
particular, test are moved to:
* "clang/test/CodeGen/AArch64/sve"
There is no change in test coverage.
[X86] Fix eliminateFrameIndex dropping existing index register for huge frame offsets
When the frame offset does not fit in disp32 and the address mode already
uses an index register, the register-scavenging path overwrote the index
operand with the scratch register, silently dropping the index from the
effective address (and applying the stale scale to the frame offset).
Fold the offset into the base register with an LEA in this case instead.
Fixes #213960
Assisted-by: Cursor
Reviewers: RKSimon, qcolombet
Pull Request: https://github.com/llvm/llvm-project/pull/221016
[NFC] Stop relying on the LocationDescription conversion in unit tests. (#221004)
`LocationDescription` has an implicit conversion from a bare insertion
point, and it leaves DL default-constructed. `OpenMPIRBuilderTest`
depends on that in a number of places, either by naming an insertion
point directly or by handing `Builder.saveIP()` to an entry point that
takes a `LocationDescription`.
Spell out what each of those sites means instead. Where a live builder
is already sitting at the insertion point it is passed directly, and
where the test names an insertion point of its own the empty location is
written out, which is what it was getting before, so no test changes
behavior.
Co-authored-by: Cursor <cursoragent at cursor.com>
[CIR][CMake] Configure MLIR as a dependency-only project
ClangIR requires MLIR, but enabling CIR currently requires users to list MLIR
explicitly in LLVM_ENABLE_PROJECTS. That also attaches all MLIR build, install,
unit-test, and lit targets to the corresponding LLVM aggregates.
When Clang is selected and CLANG_ENABLE_CIR is enabled, record MLIR in
LLVM_DEPENDENCY_ONLY_PROJECTS. The common project setup normalizes this request
against LLVM_ENABLE_PROJECTS, so an explicit MLIR selection still takes
precedence while an implicit selection remains dependency-only.
This configures the MLIR targets used by CIR without changing
LLVM_ENABLE_PROJECTS or enabling MLIR's aggregate targets. Keep the existing
standalone ClangIR restriction, and continue to omit MLIR when CIR is disabled.
Assisted-by: Codex
[CMake] Add dependency-only project mode for Flang's MLIR
LLVM_ENABLE_PROJECTS historically treats projects enabled to satisfy another
project's dependency the same as projects selected by the user. Consequently,
enabling Flang attaches the complete MLIR project, install rules, and test
suites to LLVM's aggregate targets.
Record implicit dependencies in the internal-only
LLVM_DEPENDENCY_ONLY_PROJECTS list without changing LLVM_ENABLE_PROJECTS.
Normalize the list after collecting dependencies so duplicate requests are
removed and explicit project selections always take precedence.
Teach project setup to configure the union of both lists and add
dependency-only source directories with EXCLUDE_FROM_ALL. This keeps every
MLIR target available for normal dependency resolution while omitting MLIR-wide
build and install targets. Flang is the first user of this mode.
Let MLIR own its dependency-only test policy: configure test support libraries
for downstream consumers without creating MLIR unit tests or registering its
[3 lines not shown]
[clang-tidy][NFC] Convert check list to yaml format (#221411)
Yaml format was introduced in 19-20 release which is old enough to
safely transition our file to new version since we are on 23 release
already.
[CIR][CMake] Configure MLIR as a dependency-only project
ClangIR requires MLIR, but enabling CIR currently requires users to list MLIR
explicitly in LLVM_ENABLE_PROJECTS. That also attaches all MLIR build, install,
unit-test, and lit targets to the corresponding LLVM aggregates.
When Clang is selected and CLANG_ENABLE_CIR is enabled, record MLIR in
LLVM_DEPENDENCY_ONLY_PROJECTS unless it is already available. This configures
the MLIR targets used by CIR without changing LLVM_ENABLE_PROJECTS or enabling
MLIR's aggregate targets.
Keep explicit MLIR selections unchanged and retain the existing standalone
ClangIR restriction. Clang builds with CIR disabled continue to omit MLIR.
Assisted-by: Codex
[CMake] Add dependency-only project mode for Flang's MLIR
LLVM_ENABLE_PROJECTS historically treats projects enabled to satisfy another
project's dependency the same as projects selected by the user. Consequently,
enabling Flang attaches the complete MLIR project, install rules, and test
suites to LLVM's aggregate targets.
Record implicit dependencies in the internal-only
LLVM_DEPENDENCY_ONLY_PROJECTS list instead of changing LLVM_ENABLE_PROJECTS.
Teach project setup to configure the union of both lists and add dependency-only
source directories with EXCLUDE_FROM_ALL. Flang is the first user of this mode.
This keeps every MLIR target available for normal dependency resolution while
omitting the MLIR-wide build and install targets. Let MLIR own its
dependency-only test policy: configure test support libraries for downstream
consumers without creating MLIR unit tests or registering its lit suite.
Explicitly enabling MLIR preserves the existing behavior.
Assisted-by: Codex
[Clang][Driver] Final phase also determined by input (#218802)
Before this PR, `getFinalPhase` assumed that when no option is give then
the final phase will a linking step. This is objectively wrong: For
instance passing a header file as input (`-x c-header` or `-x
c++-header`) triggers precompilation, not linking. Other inputs that do
not have a link phase as specified by `Types.def`
are `.dxo`, `.ifs`, and `.hlsl` files.
Instead of defaulting to link in the absence of any action flag, this PR
uses the last phase that `Types.def` specifies for the given input
files. The effect of this is relevant when handling linking options
which are categorized as "input" like any other file.
Usually these should be filtered out if
there is no linking step. But, since `getFinalPhase` says there is a
linking flag, those are forwarded to the precompile handling which gets
confused with such "inputs". An accurate determination of the final
phase filters out those non-applicable linker options.
[8 lines not shown]
[CIR] Derive lowering attr names from cppClassName, not the def name
CIRLoweringEmitter built its CXX_ABI_ALWAYS_LEGAL_ATTRS entries with
GetOpCppClassName, which splits the TableGen def name at the first
underscore. That works only while every def is named CIR_<CppClassName>Attr.
When one is not, the emitter writes an `isa<>` for a class that does not
exist, and the failure lands as a compile error in generated code.
Attributes carry the authoritative name in cppClassName, which
GenerateAttrToValueVisitor was already reading. Factor that out as
GetAttrCppClassRef and use it for both attribute paths. GetOpCppClassName
stays for operations.
NFC, and checkable. No CIR attribute overrides cppClassName, so the generated
CIRLowering.inc is byte-identical.
[CIR] Move the CIR enums off the legacy EnumAttrInfo hierarchy
MLIR has two enum hierarchies. `EnumAttrInfo` doubles as an `IntegerAttr`
constraint, so every CIR enum had to clear `genSpecializedAttr` to say it did
not want one. `EnumInfo` describes a C++ enum and nothing more.
Derive the CIR bases from `I32Enum`, `I64Enum` and `I32BitEnum`, and widen
`CIR_EnumAttr` to the `EnumInfo` that upstream `EnumAttr` already takes. The
flag no longer exists to clear. `FPClassTestEnum` gets unquoted printing from
`BitEnumBase` rather than overriding `printBitEnumQuoted`, and
`CIR_KnownFuncKind` drops a `parameterPrinter` the generated `operator<<`
now covers, still spelling `#cir.func_identity<"std::find">`.
AMDGPU wraps an `I32Enum` in an `EnumAttr` with this same bracketed format.
Parsing moves to the generated `FieldParser`, whose diagnostic names the
accepted spellings, so two `expected-error` lines change. Generated attribute
code drops 16 KB as 28 inlined parsers collapse into it.
[CIR] Migrate the FPClassTest bit enum and unquote its flags
cir.is_fp_class printed its flags inconsistently. Single-bit values came out
bare, as in `fcSNan`, while group values and combinations came out quoted, as
in `"fcInf"` and `"fcSNan|fcNegInf"`. That comes from I32BitEnumAttr setting
printBitEnumQuoted, which EnumAttr.td keeps only for backwards compatibility.
Clearing the bit and using the `enum` directive selects the separator-aware
parser and printer, so every value now spells unquoted:
cir.is_fp_class %x, fcSNan|fcNegInf : (!cir.float) -> !cir.bool
The enum also drops its specialized IntegerAttr for a CIR_EnumAttr wrapper,
giving it the standalone spelling `#cir.fp_class<fcSNan|fcNegInf>`. This
changes operation syntax, so it updates 37 CHECK lines.
[CIR] Drop dead ceremony around the CIR enum attributes
Five things that no longer earn their place in the CIR enum attribute
machinery.
CIR_CleanupKindAttr carried three. Its cppClassName restated the default
AttrDef already derives. Its skipDefaultBuilders plus hand-written
AttrBuilder existed only to default $value to CleanupKind::All, which no
caller relies on, so the generated builders stayed suppressed for nothing.
And its summary and description restated the name, overriding the enum's own
"cleanup kind" that EnumAttr would otherwise inherit. The isNormal, isEH and
isNormalAndEH helpers stay.
CIR_TLSModelAttr's summary restated its name the same way, so only that goes.
CIR_DefaultValuedEnumParameter has never had a user.
NFC.
[mlir][tosa] Add F32 to F16 type narrowing pass (#218900)
Add `tosa-narrow-f32-to-f16`, extending the shared TOSA type narrowing
infrastructure with support for destructively converting F32 tensors,
scalar attributes, dense constants, and resource-backed constants to
F16.
The pass supports conservative and aggressive rewriting, optional
function-boundary conversion, and optional preservation of F32
accumulator types.
Add coverage for constant precision loss, function boundaries, regions,
dense resources, aggressive rewriting, and accumulator-type
preservation.
Signed-off-by: Davide Grohmann <davide.grohmann at arm.com>