[VPlan] Use collectEphemeralRecipesForVPlan in calculateRegUse (NFC) (#216047)
Update calculateRegisterUsageForPlan to use
collectEphemeralRecipesForVPlan instead of relying on IR-based set of
instructions.
[mlir] [memref] [transform] Add alloc_to_global op. (#211141)
This adds a new transform op that creates a `memref.global` op for
each provided `memref.alloc` and replaces `memref.alloc`s with
`memref.get_global`. It also creates a new helper function that contains
the shared logic between the existing `alloca_to_global` op and
`alloc_to_global`. It also checks whether `memref.alloc`s and
`memref.alloca`s are statically shaped since `memref.global` requires
statically shaped buffers.
[CIR] Implement __builtin_clear_padding (#216126)
__builtin_clear_padding is lowered as an operation, which keeps the list
of the padding sections so that it knows how to clear them later. Rather
than trying to get the casting/etc right earlier to do clearing, this
patch chooses to do the conversion to load/and/store operations during
LowerToLLVM. This also yields identical IR to OGCG, whereas attempts to
do it earlier caused divergence that seemed unnecessary and causes
difficulty in assuring they are compatible.
[CIR] Implement the 'rest' of the TLS Model types (#215380)
Functionally, the only difference between these models is the tag that
goes onto the variable in the LLVM-IR. This patch changes our "==
GeneralDynamic" checks to just be whether they have a TLS Model defined,
so all the previous logic still holds.
This patch DOES have to add the 'default' model to the module, as the
top-level TLS guard needs to have this model, even if the individual
variables are overridden by the tls_model attribute.
Like the previous inline-printing patch, this ensures we print the
module result attribute as an enum value instead an integral. This
requires some custom parse/printing here, but is pretty routine. We
can't convert GlobalOp without vastly changing how it prints these, as
there isn't really a 'assemblyFormat' that works for this printed as an
'attribute' and a keyword.
We ALSO had to change the name of the enum to be TLSModel, because MLIR
is inconsistent in tablegen where it gets the name from on an enum, so
it would pick up the wrong spelling sometimes.
[lldb] Make SBFile::operator bool explicit (#215819)
Every other SB class in the API declares `explicit operator bool()`.
SBFile was the only one with an implicit conversion, which in general is
not something we want.
[lldb][test] Don't include all SB API headers in TestMultithreaded (#215551)
This test compiles 9 C++ test files and uses the `generateSource`
function to inject includes for every single SB API header. The
`generateSource` call also sets `SOURCE_DIR` so the test knows its
current source directory.
This patch removes the need for `generateSource` by including the SB API
headers we actually need. SOURCE_DIR is now specified using an
environment variable in the test.
The motivation for this patch is that I want to avoid recompiling these
source files unless their source or the included headers change.
Currently, this test is one of the slowest in the test suite and needs
about half a minute to run. In the future, I want to at least avoid the
recompilation time for each test file.
Note that we still have another test that includes all SB API headers
normally and as a framework, so this does not remove test coverage.
[Offload][Driver] Split frontend CUDA/HIP language assumptions from backend device (#212373)
CUDA and HIP offloading currently assumes that the source language also
implies the device backend: CUDA maps to NVPTX/CUDA and HIP maps to
AMDGPU/HSA. That is too restrictive for the LLVM offload path, where the
language frontend and the device backend can be separate choices.
Using `-foffload-via-llvm` we can split the kernel language from backend
assumptions. When enabled, the driver suppresses the vendor
runtime/header paths, injects the LLVM-provided generic GPU device
headers and language runtime headers, and links the LLVM CUDA/HIP
runtime libraries from #211694 instead. It also provides tests for
#211694 since they require the frontend to run.
Assisted by GPT-5.5, checked and reviewed manually
Co-authored-by: Johannes Doerfert <jdoerfert.llvm at gmail.com>
Co-authored-by: Jonas Greifenhain <cadivus at daverkomp.de>
[clang-tidy] Add `readability-redundant-zero-initializer` (#209367)
Add a check that finds explicit single-element zero initializers of
arrays and rewrites them to empty braces, e.g. `char a[12] = {0};`
becomes `char a[12] = {};`. Empty-brace initialization zero-initializes
every element, so the explicit `{0}` is redundant. The check is only
enabled in C++ and in C23 or later.
The check is conservative and only rewrites a single-element `{0}` list
whose sole element is the integer literal `0` and whose array has an
explicit bound. It leaves alone, among others:
- arrays whose bound is deduced from the initializer (`char a[] = {0};`)
- multi-dimensional arrays (`int m[2][3] = {0};`)
- initializers with more than one element (`int a[3] = {0, 0};`);
- scalars and class/struct types
- zero written in another form such as `'\0'`, `0.0` or `nullptr`
Closes #209139
[2 lines not shown]
[X86] extractsubvector-load.ll - basic test coverage for various extractsubvector(load) patterns (#216156)
Shows some poor codegen for non-aligned subvector indices
Basic frozen load test coverage for #216115
[CIR] Address reviewer feedback
The comments on isEmptyFieldForABI and isEmptyRecordForABI were too verbose. Adapt the comments on classic's isEmptyField and isEmptyRecord.
Add flexible array member tests.
Assisted-by: Cursor / claude-opus-5
[NFC][analyzer] Clarify that ArrayBound only handles element regions (#216049)
The `security.ArrayBound` checker does not do anything when the value of
the expression that activated its callbacks isn't expressed as an
`ElementRegion`.
Previously this was a sneaky consequence of the logic in
`computeOffset`, but this commit highlights it with a straightforward
early return statement to ensure that the accessed element region is
available within the body of `ArrayBoundChecker::handleAccessExpr`.
(I intend to use this in a follow-up commit.)
devel/guile30-slib: Catch up with slib version in variable
This is kind of pointless, but choose consistency over thinking about
the real problem for now.