[flang] Fixed issues in nested LICM. (#192117)
First change is to check the hoisting safety for all nested
operations of the candidate. This prevents hoistings of
region operations as in the added test.
When hoisting operations from nested regions we have to
check every parent region for `canMoveOutOf`, otherwise,
illegal hoisting may happen. This second change is NFC,
because all operations that support `OperationMoveOpInterface`
currently also support `LoopLikeOpInterface` and their regions
are not considered for nested hoisting. Anyway, it is worth
fixing it.
[NFC][VPlan] Split `makeMemOpWideningDecisions` into subpasses
The idea is to have handling of strided memory operations (either from
https://github.com/llvm/llvm-project/pull/147297 or for VPlan-based
multiversioning for unit-strided accesses) done after some mandatory
processing has been performed (e.g., some types **must** be scalarized)
but before legacy CM's decision to widen (gather/scatter) or scalarize
has been committed.
And in longer term, we can uplift all other memory widening decision to
be done here directly at VPlan level. I expect this structure would also
be beneficial for that.
[clang] Fix assertion crash in CTAD for alias templates with non-dependent type (#191885)
When building deduction guides, clang assumes that the return type of
the deduction guide would always be a dependent type
(`TemplateSpecializationType`), but this is not true for invalid case,
where the alias RHS is a non-dependent class template specialization, it
is represented as a `RecordType` instead.
Fixes #190517.
[flang][cuda] Allow host variables to be defined in device subprograms under -gpu=unified (#192118)
When `-gpu=unified` (or `-gpu=mem:unified`) is enabled, host variables
should be definable in device subprograms because HMM/ATS makes all host
memory accessible from the GPU.
The definability check in `WhyNotDefinableBase` was unconditionally
rejecting host variables in device contexts. This fix skips that check
when `CudaUnified` is enabled.
[clang][cmake] Add check-clang-extra to bootstrap targets for Fuchsia (#192104)
Not having these prevents us from testing the clang-tool-extra targets
in our CI and multi stage builds.
[NFC][SPIRV] Re-factor feature map initialisation for AMDGCN flavoured SPIR-V (#192067)
AMDGCN flavoured SPIR-V must support the union of all AMDGCN features,
as we cannot early adjudicate on this or that feature's availability. We
were hand filling in the feature map, which was error prone and led to
constant grind as new features were added. This patch moves to a
programmatic approach where we iterate through all AMDGCN GPUs and
collect features, thus establishing the union. With this change AMDGCN
flavoured SPIR-V will automatically pick up new features as they come
along.
[flang][cuda] Fix invalid address space in addressof op conversion (#192111)
The change in lowering order introduced in
https://github.com/llvm/llvm-project/pull/183268 exposed an issue when
converting addressof op pointing to globals with different address
space. Look at the fir::GlobalOp when it has not been converted.
[CIR] Raise IntType max bitwidth to match LLVM IR (#191499)
Follow-up to #188113 per @erichkeane's feedback about the 128-bit cap.
CIR's IntType was hard-limited to 128 bits, which meant any _BitInt
wider than that hit an errorNYI. LLVM IR goes up to 2^23 (about 8
million bits), and there are real tests/users at those sizes. This
raises CIR's limit to match and drops the guard that was working around
it.
Tests: added a _BitInt(256) global to bitint.c and a 1024-bit round-trip
to bitint.cir.
Made with [Cursor](https://cursor.com)
[CIR] Add musttail thunks and covariant return null-check (#191255)
Implement variadic thunk emission via musttail and null-check
pointer returns in covariant thunk adjustment, matching classic
codegen behavior.
Adds musttail UnitAttr to cir.call/cir.try_call with lowering
to LLVM::MustTail.
Made with [Cursor](https://cursor.com)
Mark tests as unsupported on z/OS (#191843)
z/OS has a platform specific requirement to not allow asm statements at
file scope. These tests generate that message rather than the expected
IR. Mark the tests as unsupported on z/OS.
Load AST files as binary on z/OS (#191840)
The ast files need to be loaded as binary on z/OS to avoid translation.
Add the `IsText=false` option to all of the relevant file open calls.
[sanitizer] Make internal_close_range available on all POSIX platforms (#191971)
Make internal_close_range available on all POSIX platforms so callers
can use it without platform-specific #if guards. Platforms without
close_range return -1, letting callers fall back gracefully.
Currently only FreeBSD has a real implementation. A TODO is left for
adding Linux support (__NR_close_range, kernel 5.9+).
The Linux support will be added in
https://github.com/llvm/llvm-project/pull/191450.
[clang] Attempt to unbreak clang/test/Driver/serenity.cpp on bots (#192105)
The c++/v1 paths aren't found on bots, so remove them for now until this
is analyzed.
Match on `-isysroot` to get SYSROOT var instead.
Also remove what looks like one unintentional SYSROOT: capture for
crt0.o.
[LLDB][Docs] List available settings (#168245)
This PR adds a documentation page that lists all available settings. The
page is automatically generated.
Having the settings listed in the online documentation makes it easier
to search for users. It also has the advantage of being indexed by
search engines.
To generate the docs, we first generate JSON out of the TableGen
definitions with `-dump-json`.
Once all properties are available as JSON, a Markdown file with the
merged documentation (`settings.md`) is generated. I chose Markdown over
RST, because some descriptions already use backticks, which would become
references in RST.
Currently, enum names/descriptions are not visible, because they're
defined in C++. In the future, these could be moved to TableGen as well.
[GVN] Clean up `reportMayClobberedLoad` to use the dependency instruction (NFC) (#192103)
Minor opportunity to clean `reportMayClobberedLoad` routine, which was
previously receiving the entire `MemDepResult` object, though only using
the dependency instruction.
Co-authored-by: Momchil Velikov <momchil.velikov at arm.com>
[clang][cmake] Add check-clang-extra to bootstrap targets for Fuchsia
Not having these prevents us from testing the clang-tool-extra targets in
our CI, and multi stage builds.
[AArch64] Check Subtarget via STI in getInstSizeInBytes (#192089)
The InstSizes test (`llvm/unittests/Target/AArch64/InstSizes.cpp`)
destroys the Subtarget field early (`ST` created on the stack in
[`createInstrInfo`](https://github.com/llvm/llvm-project/blob/40a585e742ed6b28306d7511380079325ba1a003/llvm/unittests/Target/AArch64/InstSizes.cpp#L32)),
causing a use-after-free if it is used in `getInstSizeInBytes`. This
causes a failure when running the test with hwasan (reported by build
bot). To fix this, this PR switches to using `STI` instead of
`Subtarget` in `getInstSizeInBytes` for checking `isLFI`, which survives
for the lifetime of the test.
I think fixing the test itself (the root of the issue, as far as I can
tell) would be more involved. Perhaps I should open an issue for it
though?
I have tested the fix on an AArch64 machine with hwasan to confirm that
it resolves the issue.
[lit] Add an option to lit which ratelimits progressbar output. (#186479)
Add a new option --min-output-interval, which ratelimits updates to the
progress bar.
When running Lit with the full curses progressbar, it updates both the
bar, and the status text below on every test completion. Running
check-llvm on my laptop runs about 44k tests and takes about 260 seconds
for a release build. Or about 171 tests/second on average.
Moreover, when ssh'd to another host, this generates quite a bit of
traffic. Using tcpdump, I measured the traffic for a run of check-llvm
and -clang. With all updates, its about 8.7 megabytes. With a rate limit
of 5 update/sec, this came down to 175 kilobytes. This can be
significant on slow/metered connections.
This patch adds an option to limit lit's output to once per a given
interval. This only affects the progressbar and status message below,
not any log messages above. It also does not affect anything when not
[5 lines not shown]