[Clang][counted_by] Honor counted_by in __bdos on direct struct access (#201161)
__builtin_dynamic_object_size on a flexible array member must consult
the 'counted_by' attribute even when the containing struct is accessed
directly (a local or global variable) rather than through a pointer
dereference. The pointer-deref form (p->fam) already worked because the
constant evaluator could not determine the LValue for an opaque
parameter and fell through to the counted_by-aware runtime path in
CGBuiltin. The direct form (af.fam, gaf.fam) was being folded by
tryEvaluateBuiltinObjectSize to a layout-derived size (e.g. trailing
struct padding for locals, trailing initializer data for globals)
silently bypassing emitCountedBySize.
Make the AST constant evaluator refuse to fold __bdos on the same
operands that CGBuiltin's __bdos lowering classifies as a counted_by
FAM access. The check runs after the existing negative-offset early
return so that obviously out-of-bounds operands like &p->array[-42]
still fold to 0, preserving the behavior the sanitizer-bounds test in
attr-counted-by.c (test35) relies on.
[25 lines not shown]
[clang-cl] Fix friend class warning on Windows (#201720)
clang-cl warned on "friend class CallInst;" because MSVC may resolve
that to "friend llvm::CallInst" instead of the sbox IR mirrored
hierarchy. Drop the class tag and refer to forward declared names
instead.
[Github] Make bazel-checks workflow validate shasums (#202405)
For some added security (although it's probably not super helpful here),
and consistency across the code base.
[SPIR-V] Allow bfloat vector atomics lowering without scalarization (#202083)
This is a workaround only for AMD triple - to use
SPV_NV_shader_atomic_fp16_vector for this lowering.
[WebAssembly] Don't stackify multi-def instructions (#200429)
This commit updates the `WebAssemblyRegStackify.cpp` pass to
specifically exclude attempting to stackify the first def of a multi-def
instruction. As the previous comments indicate this is possible to do in
some situations, but the current logic is incomplete and has led to
miscompilations such as #98323 and #199910. One option would be to make
the logic more robust, but in lieu of that in the meantime the change
here is to completely disable stackification in these situations. This
provides at least a "known working" base to build on later and fixes the
known regressions around this.
Closes #98323
Closes #199910
[clang][ssaf] Convert `JSONFormat` tests for `TUSummary` and `TUSummaryEncoding` to lit tests (#192187)
This change converts most of the `TUSummary` json tests in `TUSummaryTest.cpp` to use `lit`. Some tests require more care and will be addressed in future PRs.
[AMDGPU] Do not always add latency between LDSDMA -> S_WAIT_LDSDMA (#201942)
In loop bodies we typically see LDSDMA instructions prefetched an
iteration or more. Thus, we may have LDSDMA, followed by S_WAIT_LDSDMA
that is waiting on prior iteration LDSDMA. Currently, the scheduler
thinks there will be a long stall between this LDSDMA and S_WAIT_LDSDMA.
This adds some basic checking for LDSDMA and S_WAIT_LDSDMA in the same
region to avoid adding latency in cases where we are certain the
S_WAIT_LDSDMA does not correspond with the LDSDMA.
rc: Bail if /dev/null is not a device
On startup, check that /dev/null exists and is a character device.
Otherwise, one of two things will happen: either /dev is a writable
directory and we will immediately create /dev/null as a regular file
and dump garbage into it, or it does not and we will spit out a stream
of error messages about failing to create /dev/null.
PR: 295782
MFC after: 1 week
Reviewed by: jhb, emaste
Differential Revision: https://reviews.freebsd.org/D57447
(cherry picked from commit b5a96894f67a92f78f0641763eff1e0a46f2e036)
etcupdate: Make diff -l actually work
While here, remove unnecessary blank lines.
MFC after: 1 week
Fixes: 6d65c91b9a47 ("etcupdate: fix arguments order of diff command")
Reviewed by: Boris Lytochkin <lytboris at gmail.com>
Differential Revision: https://reviews.freebsd.org/D57330
(cherry picked from commit a85e39030f8c7faa3d5a33373389440de6f0fff7)
libarchive: Clean up the build configuration
* Move settings duplicated in libarchive, bsdcat, bsdcpio, bsdtar, and
bsdunzip into libarchive's Makefile.inc.
* Drop some CFLAGS that merely duplicated some of the contents of our
platform configuration header.
MFC after: 1 week
Reviewed by: mm
Differential Revision: https://reviews.freebsd.org/D57307
(cherry picked from commit eb3a0a74a069d0f294e1596504676459282bb308)
libarchive: Fix typo in sed command
MFC after: 1 week
Fixes: eb3a0a74a069 ("libarchive: Clean up the build configuration")
Reported by: Shawn Webb <shawn.webb at hardenedbsd.org>
[2 lines not shown]
rc: Bail if /dev/null is not a device
On startup, check that /dev/null exists and is a character device.
Otherwise, one of two things will happen: either /dev is a writable
directory and we will immediately create /dev/null as a regular file
and dump garbage into it, or it does not and we will spit out a stream
of error messages about failing to create /dev/null.
PR: 295782
MFC after: 1 week
Reviewed by: jhb, emaste
Differential Revision: https://reviews.freebsd.org/D57447
(cherry picked from commit b5a96894f67a92f78f0641763eff1e0a46f2e036)
libarchive: Clean up the build configuration
* Move settings duplicated in libarchive, bsdcat, bsdcpio, bsdtar, and
bsdunzip into libarchive's Makefile.inc.
* Drop some CFLAGS that merely duplicated some of the contents of our
platform configuration header.
MFC after: 1 week
Reviewed by: mm
Differential Revision: https://reviews.freebsd.org/D57307
(cherry picked from commit eb3a0a74a069d0f294e1596504676459282bb308)
libarchive: Fix typo in sed command
MFC after: 1 week
Fixes: eb3a0a74a069 ("libarchive: Clean up the build configuration")
Reported by: Shawn Webb <shawn.webb at hardenedbsd.org>
[2 lines not shown]
etcupdate: Make diff -l actually work
While here, remove unnecessary blank lines.
MFC after: 1 week
Fixes: 6d65c91b9a47 ("etcupdate: fix arguments order of diff command")
Reviewed by: Boris Lytochkin <lytboris at gmail.com>
Differential Revision: https://reviews.freebsd.org/D57330
(cherry picked from commit a85e39030f8c7faa3d5a33373389440de6f0fff7)
[lldb][NFC] Remove redundant TypeSystemClang.h includes (#202439)
TypeSystemClang.h includes a lot of other unique headers, and should not
be included unless needed.
[VPlan] Fix vplan printing for VPExpressionRecipe w/conditional reduction. (#198954)
This patch contains two parts.
- Add a new vplan-printing test which is duplicated from
vplan-printing-reductions.ll and force tail folding.
- Fix the printing of VPExpressionRecipe for conditional reductions.
Since the mask operand cannot be accessed directly through the reduction
recipe once folded, it need to be fetched from the expression recipe's
operands.
libalias: Serialize updates to the global instance list
libalias maintains a global list of all libalias handles. The list was
updated without any locking, but nothing prevents updates from running
concurrently.
MFC after: 1 week