[SandboxVec][LoadStoreVec] Support constant vectors of mixed types
createConstantVector() previously packed the constant store operands
as-is, which only worked when every store had the same element type.
Take the lane type from VecUtils::getCombinedVectorTypeFor() instead and
reinterpret each constant's bits as that type, going through an integer
of matching width via ptrtoint/inttoptr/bitcast. Constants wider than a
lane (e.g. an i64 in an <N x i32>) are split across several lanes in
memory order. Bail out when a constant cannot be reinterpreted, such as
a non-integral pointer or a relocatable address that needs splitting.
Also flatten vector-typed ConstantPointerNull into per-lane nulls, and
bail out on the remaining vector constants such as poison rather than
packing them into the result.
Co-authored-by: Cursor <cursoragent at cursor.com>
[Clang][Sema] Add fortify warnings for recv and recvfrom (#223520)
Add `-Wfortify-source` diagnostics for `recv` and `recvfrom` when the size argument exceeds the destination buffer size.
Part of #142230
Assisted-by: Gemini
[HLSL] Implement the SV_InstanceID semantic (#221091)
Fixes #212572
Adds type validation, stage restriction, and lowering for
`SV_InstanceID`.
- Type check rejects non-uint; DXIL accepts U32/U16, SPIR-V accepts U32
only (VUID-InstanceIndex-InstanceIndex-04265).
- Rejected all sigpoints but Vertex In.
- On SPIR-V, the variable is decorated with `BuiltIn InstanceIndex`
instead of a user-assigned Location.
- SPIR-V lowering loads from the `InstanceIndex` (ID 43) built-in; DXIL
lowering uses `dx.op.loadInput`.
- LIT tests for sema (wrong type, wrong stage, output direction) and
codegen (BuiltIn decoration, no Location).
@dnovillo @pow2clk
Assisted-by: LLM
[NFC][sanitizer] Allow fread in symbolizer (#225853)
Commit 3c63fcb246f3 (#212010) introduced `fread` usage in libc++
`std_stream.h`. Because libc++ is linked into the internal symbolizer,
`fread` is now referenced in `symbolizer.o`. Add `fread U` to
`global_symbols.txt` so symbol verification succeeds.
Assisted-by: Gemini
AMDGPU: Preserve dead carry-out when shrinking adds in SIFoldOperands (#225687)
The VOP3 form of add/sub with carry out are sometimes shrunk to the VOPC
form when the carry out is dead. Preserve this information by setting
the dead flag on the new instruction. This alleviates some implicit
dependence on LiveVariables' later recomputation of dead flags.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[libc++] Don't pass a path lvalue to DoNotOptimize in the filesystem benchmark (#225504)
BM_PathIterateOnceBackwards passes *I directly to DoNotOptimize.
However, libstdc++ returns a const lvalue reference to `path` from that
operation, which selects GoogleBenchmark's deprecated const-ref
overload.
Use the pattern used elsewhere in this file instead.
[compiler-rt] Add 'csan' library for the concurrency sanitizer
Summary:
Adds the runtime for the concurrency sanitizer, both CPU and GPU.
Fundamentally, this works using the following pseudocode:
```c
static u64 watchpoints[N]; // Hash-indexed, zero is empty.
// Emitted before the access, so we never trip on our own write.
void check_access(volatile void *addr, u32 size, u32 type) {
// Every access probes. A read conflicts only with a watched write, a
// write conflicts with either.
if (u64 *wp = find_watchpoint(addr, size, type))
consume(wp, this_pc()); // Hand our location to the owner.
if (!should_sample()) // Wave-uniform, 1-in-N chance.
return;
[17 lines not shown]
[LV] Add additional outer loop vectorization tests. (#225821)
Add test more test coverage for outer loop vectorization path, focusing
on various legality aspects, like supported instructions and memory
checks.
[lit][docs] Document %if conditional substitution in lit CommandGuide (#225683)
`%if ... %else` conditional substitutions (implemented in
`TestRunner.py` and mentioned in `TestingGuide.md`) were missing from
the `SUBSTITUTIONS` table and `available_features` description in
`llvm/docs/CommandGuide/lit.md`. Add `%if` to the base substitutions
table and note that `available_features` can be used in `%if`
conditions.
Signed-off-by: Ingo Müller <ingomueller at google.com>
[Clang] Add support for the `-fsanitize=concurrency` runtime
Summary:
Add the frontend sanitizer kind, function attributes, pass pipeline
integration, predefined macro, driver handling, and documentation for
ConcurrencySanitizer.
stat(2): Document st_bsdflags and SFBSD_NAMEDATTR
Those are FreeBSD-specific member and flag still better to be
documented.
Reviewed by: kib
Sponsored by: Sippy Software, Inc.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D59915
vmimage.subr: Include dangling symlinks in images
When creating VM images, we filter the METALOG file created by pkg(8)
when installing non-base packages, rejecting any lines which correspond
to files which don't exist; this solves a problem which arose when a
package was installed and then deinstalled (or upgraded) later in the
image-building process.
Unfortunately [ -e ... ] follows symlinks and is not basedir-aware, so
an absolute symlink which is valid *inside* the image is omitted from
the image if it points to something which isn't present in the build
host system.
Replace [ -e ... ] with [ -e ... ] || [ -L ... ] so that symlinks are
included even if dangling.
While I'm here, add quoting in case future paths become problematic.
Sponsored by: Amazon
[3 lines not shown]
ec2-desktop: Fix shell expansion in ec2_setpass
Using a backtick inside a backtick-expansion isn't a good idea; switch
instead to using $( ... ).
Fixes: a9710349513f ("EC2: Add desktop flavour")
Sponsored by: Amazon
(cherry picked from commit 28cad382a2bb5fc398bd11f8e7b3637ad6c03334)
ec2-desktop: Don't enable firstboot_pkgs
We don't have any packages to install by default when the instance
first boots, so (as with the "small" flavour) don't enable the
firstboot_pkgs script. If someone wants to launch a desktop with
packages autoinstalled at first boot, they can enable the script at
the same time as they provide the list of packages.
Sponsored by: Amazon
(cherry picked from commit eca31490322f181a415c14c6bf03e656e81fb4aa)
EC2: Add desktop flavour
Desktop AMIs have xrdp enabled and boot to a KDE desktop; they are
as compatible as possible with EC2 Windows AMIs, setting a random
password and printing it to the console in encrypted format to be
retrieved using the EC2 GetPasswordData API.
Two rc.d scripts are included in this commit which will not exist
in the long term: ec2_addpass will become part of the ec2-scripts
package, and ec2_desktop_extras will go away once its functionality
is included elsewhere.
MFC After: 1 month
Relnotes: yes
Sponsored by: Amazon
(cherry picked from commit a9710349513f4c6ccb8bcff34fa9ea186fae6114)
hwpmc: hwpmc: record page size to fix analysis in some case
This fixes a bug where a binary linked using max-page-size=0x200000
can result in a bogus relocation offset when running on a system
with a smaller page size. This causes samples to fall outside
the image mapping or be translated to the wrong address (resulting
in symbol resolution, or incorrect symbol resolution). We noticed
this at Netflix because we run a patchset enabling 16k pages on
amd64 and have been compiling userspace with a 2MB page size.
Since we started doing this profiling userspace binaries has been
wonky.
Reviewed by: ali_mashtizadeh.com
Differential Revision: https://reviews.freebsd.org/D59771
Sponsored by: Netflix
[SLP]Pair small sign-aware reduction groups only if both signs have one
The small-group check of the flattened fsub/fneg fadd reductions
used whenever any leaf was negated, vectorizing 2-wide parts that
have no opposite-sign part to combine with via the vector fsub.
Allow it only if both signs have a group of at least 2 values.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/225881