[lldb][Fortran] Addressed feedback about code styling and changed one of the tests to contain different types in arguments and return type, not just integers
[lldb][Fortran] Added llvm RTTI support to FortranFunction, renamed variable names in functions, GetFunctionType static function to get function type pointer and addressed feedback about code style
[HLSL] Migrate pre-commit HLSL CI to Windows (and off Beanz's closet Mac) (#230639)
Pre-commit validation of HLSL and DirectX changes includes a run of
[offload test suite](https://github.com/llvm/offload-test-suite), which
currently executes on a Mac laptop in Beanz' closet. This change updates
the pipeline to run on a self-hosted Windows runner, with software GPU
offload coverage through D3D12 WARP.
The original pipeline was running `check-llvm` and `check-clang` test
groups. Since DirectX has become an official LLVM target this is no
longer necessary. The HLSL & DirectX tests that are included in the
`check-llvm`/`check-clang` groups are already being run by existing
pre-commit CIs.
The pipeline now executes only offload tests suite runtime tests on WARP
and plus the LLVM `dxil-dis` tool tests, which only depend on `llc`,
`llvm-objcopy` and the 'filecheck` tools from the LLVM build.
Fixes llvm/wg-hlsl#477
[lld-macho] Require a 64-bit host for arm64e-auth-pointer.s (#238623)
The test's far.o case needs a 4 GiB zerofill section, but lld keeps
section sizes in size_t, so on 32-bit hosts the section is empty, _far
isn't far, and the expected error never comes. This broke
clang-armv8-lld-2stage. Like dead-strip.s, require llvm-64-bits.
Fixes https://lab.llvm.org/buildbot/#/builders/122/builds/329
Assisted-by: Claude
[Clang][BPF] Preserve every subscript of multi-dimensional array members (#237589)
A member access is relocated with CO-RE either inside
`__builtin_preserve_access_index()` or through the preserve_access_index
attribute on the record. For an array member with more than one
subscript, the builtin works, but the attribute does not. With
```
#define __pai __attribute__((preserve_access_index))
struct S { long x; int y; } __pai;
union V { long l; struct S m[2][3]; } __pai;
struct T {
struct S a[2][3];
union V g[3][2];
struct S (*q)[3];
struct S *p[3];
struct S v[2][3][4];
} __pai;
```
the relocations for `t->a[1][2].y` are:
[63 lines not shown]
[MLIR][SCF] Handle empty ranges in mlir::loopUnrollByFactor. (#237094)
## TL; DR
This patches fixes empty ranges such as $[42, 0; 4]$ in
`mlir::loopUnrollByFactor`
According to the SCF documentation, the precondition is
> Lower bound, upper bound, and step are interpreted as signed integers
by default, or as unsigned integers if the unsignedCmp unit attribute is
present. The step is required to be strictly positive.
However, even though in the case that lower bound, upper bound, and step
are all positive, we can construct an empty range such as $[42, 0; 4]$,
which leads to wrong behavior as reported in triton-lang/triton/issues/12525
[Flang] [Driver] Add -fplt and -fno-plt options (#235622)
The option is supported in clang and not in flang. This commit adds this
support. -fno-plt makes external calls use GOT indirection instead of
the PLT. The driver forwards it only for ELF x86 and AArch64, and the
default remains PLT.
[DirectX] Port DXContainerGlobals to NewPM
Standard NewPM pass porting. There are a lot of function_refs because
this pass uses a lot of Analyses. I don't think there is a cleaner way
to do this.
Reviewers: bogner
Pull Request: https://github.com/llvm/llvm-project/pull/238167
[lld][MachO] Fix missing class name when merging categories into a class (#237948)
mergeCategoriesIntoBaseClass preset extInfo.baseClass, so
parseCatInfoToExtInfo skipped the branch that set baseClassName, and the
symbols of the merged lists were named without the class. Set the name
at both sites.
[Clang][SYCL] Reject an unknown offload architecture on a SPIR-V target (#229249)
Diagnose an unknown `--offload-arch` on a SPIR-V target for SYCL.
Previously, with `--offload-targets=spirv64-unknown-unknown`, any
`--offload-arch` value was accepted, so a typo such as `xe-pcv` silently
created a job for a device that does not exist. For SYCL on a plain
SPIR-V target, `spirv32-unknown-unknown` or `spirv64-unknown-unknown`,
`--offload-arch` and `--no-offload-arch` must now name an Intel GPU or
CPU, an IGCA target or `generic`. Anything else is an error, as it
already is for CUDA and HIP, including a numeric name for a GPU that is
not listed, such as `xe_40.11.0`, and a name with target features, such
as `xe-pvc:foo`.
An Intel name or IGCA target is also an error on any other SPIR-V
target, e.g. "the target architecture 'igca_20ca' is not supported by
the target 'spirv64-amd-amdhsa'".
[ci] Collect profiles in the LLVM test-suite LNT runs on Linux (#237439)
Run the test-suite with `--use-perf all` on Linux, which collects
profiling data and submits it to LNT. Bump both machines since the
version of the test suite also changes.
Assisted by Claude
[InlineCost] Ask TTI whether unsimplified vector and bool binops are free (#233841)
visitBinaryOperator charged every unsimplified binary operator without
consulting TTI, unlike casts, GEPs and other instructions. Return
TCC_Free from TTI::getInstructionCost as visitCastInst does.
This is an amended reland of #232397 attempting to workaround the
compile-time hit that led to the revert #232907.
It is different in two ways. First, it is now restricted to binary
operators.
Compares are left out because very few compare are currently counted as
free,
yet this is where we started to spend the majority of the queries.
Second, for binops, we query TTI only about vector and boolean
operations as this is where the majority of high-impact free operations
is.
[mlir][Presburger] NFC: use eliminateVarUsingEquality in existing callers
Replace the eliminateFromConstraint helper with the new
IntMatrix::eliminateColumnUsingRow / IntegerRelation::eliminateVarUsingEquality
primitives in gaussianEliminateVars, gaussianEliminate and
removeRedundantLocalVars, and delete it. Add an overload of
eliminateVarUsingEquality that takes the index of one of the relation's
own equalities as the pivot and skips that row.
[mlir][Presburger] Add helpers for eliminating a variable using an equality
Add IntMatrix::eliminateColumnUsingRow, which eliminates a column from a
row using a pivot row with a positive multiplier on the row (a port of
ISL's isl_seq_elim), and IntegerRelation::eliminateVarUsingEquality,
which applies it to every equality and inequality of a relation (a port
of ISL's eliminate_var_using_equality).
Use them in reduceUsingEqualities in place of the file-local
eliminateColumnUsingEquality helper. These are intended as the shared
primitive behind the existing hand-rolled elimination loops (e.g. in
gaussianEliminateVars, gaussianEliminate and removeRedundantLocalVars),
which can be migrated separately.
[mlir][Presburger] Add IntegerRelation::reduceUsingEqualities helper
Add a protected helper that rewrites all constraints of a relation using
the equalities of another relation in the same space, without changing
the intersection of the two. This is a port of ISL's
isl_basic_set_reduce_using_equalities together with
project_onto_involved: the equalities are first projected onto the
variables that occur in the relation being reduced, so that no new
variables (in particular, no locals of the other relation) are
introduced, and each remaining equality is then used to eliminate its
last variable with a non-zero coefficient from every constraint, so that
later variables (locals) are eliminated in favor of earlier ones.
This is a building block for context-based simplification (gist) and is
exercised by the gist tests added in a follow-up commit, since there is
no existing pattern for unit-testing protected members of
IntegerRelation.
[MemProf] Handle local aliases in ThinLTO indirect tail-call cloning (#238190)
Indirect call targets in value profile metadata may come from
instrumentation PGO, keyed by PGOFuncName, or from SamplePGO and MemProf
synthesized targets, keyed by the binary symbol name (i.e. unprefixed
for locals), independent of the build's FDO mode. During the thin link,
updateValueInfoForIndirectCalls translates unprefixed local target GUIDs
to the local's actual ValueInfo, which then keys any MemProf callsite
record synthesized for a missing tail-call frame.
In distributed ThinLTO backends, the summary index omits original-name
mappings, so findIndirectTailCallCallsite reconstructs them from the
module's definitions via InstrProfSymtab. This failed for local aliases:
InstrProfSymtab does not index GlobalAliases, and an imported copy of an
alias (a Function created by replaceAliasWithAliasee) retains the
aliasee's !guid, so it was indexed under the aliasee's GUID rather than
the alias's, and could also shadow the aliasee's own function when both
were in the module. As a result, synthesized records targeting local
aliases were missed, leaving callers uncloned with undefined .memprof.*
[26 lines not shown]