[flang][cuda] Save function result descriptor before function exit (#223484)
The cuf.free was called before the AbstractResult pass spies the result
over the passed argument. Make sure the result is saved before the
descriptor is freed.
zstream: report invalid record context without assertions
Stream framing and BEGIN payload size depend on the input. Report
invalid values as ordinary errors with the record offset instead of
terminating through VERIFY assertions.
Reject oversized BEGIN payloads before allocating or reading them.
Track compound-stream conclusions explicitly so valid compound sends
remain accepted while stray END records and records after a conclusion
are rejected.
Add ZTS coverage for malformed streams in both byte orders and for
valid compound streams.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Garth Snyder <garth at garthsnyder.com>
Signed-off-by: Matthias Goergens <matthias.goergens at gmail.com>
Closes #19097
zfs_ctldir: make .zfs/snapshot/<name> btime the snapshot creation time
Before the automount, '.zfs/snapshot/<name>' is a placeholder inode
using simple_dir_inode_operations, which has no getattr, so statx(2)
reports no birth time. Once mounted, it is the snapshot's root
directory and reports that directory's crtime, i.e. the dataset
creation time. A consumer therefore gets either no birth time or the
dataset creation time, never the snapshot's, and the answer changes
when the snapshot is automounted.
Report the snapshot creation time as stx_btime consistently in both
states, so it can be read with a plain statx(2) on the path. Give
the placeholder its own inode_operations with a getattr that returns
the creation time zfsctl_inode_alloc() already stores, and override
the birth time of a mounted snapshot's root in zfs_getattr_fast()
next to the existing inode number override. The STATX_BTIME copy
moves from zpl_getattr() into zfs_getattr_fast() so the override is
not overwritten. Add snapdir_stat_btime to ZTS.
[3 lines not shown]
[mlir][acc] Add data directive codegen to ACCToLLVM (#223043)
Extends the acc to LLVM conversion with codegen for the OpenACC data
constructs - data, enter data, exit data and update. Each construct
becomes calls to the libacctarget data entry points that establish the
mappings its clauses ask for and tear them down again, on the queue its
async clause selects and after the wait its wait clause asks for. As
with the executable directives, these runtime APIs are not yet
finalized; the draft proposal can be found at
https://github.com/llvm/llvm-project/pull/197894.
A mapping is handed to the runtime as parallel argument arrays holding
one entry per mapped object, together with a descriptor for the objects
whose extent or layout cannot be stated as a size. The descriptor
layouts are declared next to the entry points they are passed to, as
they are equally part of the runtime interface.
Clause handling the data constructs share with the executable
directives, such as async, wait and if, now lives in the common
[2 lines not shown]
[TTI] Keep ParamTys and Arguments matching for variadic intrinsics. (#223693)
For variadic functions, the function's argument types do not include any
variadic arguments.
Always push types of arguments in to ParamTys, so sizes of ParamTys and
Arguments match.
PR: https://github.com/llvm/llvm-project/pull/223693
[bazel][libc] Be explicit about pic/nopic in startup_rules.bzl
Currently, this implementation gets object files from `OuputGroupInfo.compilation_outputs`, which isn't very well documented any will often just choose the PIC variant: [`cc_helper.bzl`](https://github.com/bazelbuild/rules_cc/blob/661b75de668c3b673f5550e0340e134ccf923956/cc/common/cc_helper.bzl#L192).
This PR updates `merge_relocatable_object` to propagate both pic/nopic variants of the merged object, and updates `libc_startup_object` to be explicit about its choice of pic/nopic.
The exact choice of how to handle pic/nopic may need to be updated in the future, but the changes in this PR is better than just using compilation_outputs verbatim.
[test][bazel][libc] Allow LLVM-libc tests to be run in full-build mode
This PR makes the required changes to run LLVM-libc full build tests in Bazel. After this PR, most tests pass:
```
bazel test @llvm-project//libc/test/... --config=ci --@llvm-project//libc:build_mode=full --keep_going
Executed 680 out of 853 tests: 681 tests pass and 172 fail to build.
```
Follow on PRs will fix specific tests that are failing (lots of missing deps etc).
This PR mostly involves propagating the correct dependencies and compiler/linker options from [`add_libc_hermetic`](https://github.com/llvm/llvm-project/blob/4098f568c46e06b6df470111868b4c165dd80f4d/libc/cmake/modules/LLVMLibCTestRules.cmake#L750). Slightly more involved changes:
- `BazelFilePath.cpp` also had to be fixed so that it doesn't depend on the non-namespaced `getenv` function. This PR models after https://github.com/llvm/llvm-project/commit/ee407f7e7069cccfdc1815de07e17cebf83d19f9 in order to conditionally use LLVM-libc's getenv under full-build mode.
- All tests have a dependency against `crt1.o` when run under full-build. This PR updates `merge_relocatable_object` so it also exposes a `CcInfo` with the merged object file and its transitive deps. In order to do so, this PR also makes the logic a little more careful about PIC vs non-PIC deps.