[CIR][DYNLIB] Make CIR/MLIR related symbols hidden in libclang-cpp.so. (#232409)
It was brought up on a different review that the cost of enabling
ClangIR by default was a significant runtime cost, even without
fclangir. From an instruction count, I found a ~8.5 million instruction
increase caused by the loader having to see all these symbols.
Reducing these gets us down to about a 300k overhead here, which reduces
the time measured on my machine of around 0.11% increase on a file
including std::vector, which feels reasonable. An empty TU overhead
looks to be in the high-1% increase due to the ~300k additional
instructions of loading.
AI disclosure: I used it extensively here, but I think I understand what
is going on, to the best of my ability to understand linking and CMake
(which is minimal :/).
[libcxx] fix missing `__get_locale_encoding()` for OpenBSD (#228306)
Fixes errors like this:
/home/alexrp/Sources/ziglang/zig-llvm23/lib/libcxx/src/text_encoding.cpp:34:43:
error: no member named '__get_locale_encoding' in namespace
'std::__locale'
34 | return
__make_text_encoding(__locale::__get_locale_encoding(static_cast<__locale::__locale_t>(0)));
| ^~~~~~~~~~~~~~~~~~~~~
/home/alexrp/Sources/ziglang/zig-llvm23/lib/libcxx/src/text_encoding.cpp:48:41:
error: no member named '__get_locale_encoding' in namespace
'std::__locale'
48 | return __make_text_encoding(__locale::__get_locale_encoding(__l));
| ^~~~~~~~~~~~~~~~~~~~~
2 errors generated.
[libc][printf] Fix %e/%g formatting in float320 algorithm (#232721)
Commit 509679cf9c9db71, updating arrays of char to a more general CharT,
removed a memset in the float320 code and replaced it with default
zero-initialization of the containing object. But the memset was to
`'0'`, not to `0`, so this changed the output. Restored the correct
initialization, this time using a for loop so that it will work even if
CharT is >1 byte.
[AArch64][llvm] Combine SVE AND-NOT operations into BIC for _m forms
Replace NOT followed by merging AND with BIC for expressions such as:
return svand_u32_m(pg, a, svnot_u32_x(pg, b));
Combine when NOT is the second operand and its predicate matches the AND
predicate or is all-active.
Use predicated BIC to preserve the AND's first operand in inactive
lanes. Use unpredicated BIC when the AND predicate is all-active.
Do not commute merging AND operands, since this would change inactive
results. Leave pairs with incompatible predicates unchanged.
This applies to all integer element widths. Update the pre-commit LLVM
expectations, including cases where combining would change the
result.
[AArch64][llvm] Combine SVE AND-NOT operations into BIC for _x forms
Replace NOT followed by AND with BIC for expressions such as:
return svand_u32_x(svptrue_b32(), a, svnot_u32_x(svptrue_b32(), b));
Combine ordinary AND with NOT when the NOT predicate is all-active or
its inactive values are undefined.
Also combine matching-predicate SVE AND_x-NOT pairs before lowering
discards the AND predicate. AND_x ignores inactive results, so the NOT's
inactive values do not need preserving.
This applies to all integer element widths. Update the pre-commit LLVM
expectations, including cases where combining would change the
result.
[AArch64][llvm] Add pre-commit tests for SVE AND-NOT combining
Add LLVM tests for expressions where NOT followed by AND could
use BIC. Record the existing assembly so the following changes show the
missed optimisations being fixed.
Cover _x and _m AND forms using all-active and runtime predicates. Test
_m forms across all integer element widths. Include NOT with defined
inactive values and reversed AND operands.
Also test cases that must remain as NOT followed by AND because
combining would change the values in inactive lanes.
[clang][ThreadSafety] Fix a crash on a capability expression calling a pointer to member (#231995)
`translateCXXMemberCallExpr` looks for calls to `get()` on smart
pointers through `CXXMemberCallExpr::getMethodDecl()`, which returns
null for a call through a pointer to member function, so a capability
expression such as `(g->*g->mu_of)()->Lock()` dereferenced null.
The call then reaches `translateCallExpr`, where its callee, a
pointer-to-member operator, is not translated and became the callee of a
`til::Call`. An `Undefined` compares equal to any other `Undefined`, so
such calls through different objects were taken for one capability, and
nested in a `Call` the `Undefined` escaped
`CapabilityExpr::isInvalid()`, so nothing was reported. Propagate the
`Undefined` as the result of the call instead, which the analysis
reports as "cannot resolve lock expression" like any other unsupported
expression.
Assisted-by: Claude Fable 5.1
[SLP][X86] Add pre-commit tests for merging bin-op input operands (#210004)
Add baseline SLP vectorizer tests covering the merge-input-operands
transform, including cases that exercise IR flag propagation (fast-math
flags, integer nsw/nuw wrap flags, and the exact flag on shifts) onto
the merged operand node. These checks reflect current (pre-transform)
codegen; a follow-up patch enables the transform and updates the checks
to show the delta.
Co-authored-by: Balakrishna Bandlapalli <bbandlap at gmail.com>
Co-authored-by: Cursor <cursoragent at cursor.com>
[clang][ThreadSafety] Fix a crash on a capability expression calling a pointer to member (#231995)
`translateCXXMemberCallExpr` looks for calls to `get()` on smart
pointers through `CXXMemberCallExpr::getMethodDecl()`, which returns
null for a call through a pointer to member function, so a capability
expression such as `(g->*g->mu_of)()->Lock()` dereferenced null.
The call then reaches `translateCallExpr`, where its callee, a
pointer-to-member operator, is not translated and became the callee of a
`til::Call`. An `Undefined` compares equal to any other `Undefined`, so
such calls through different objects were taken for one capability, and
nested in a `Call` the `Undefined` escaped
`CapabilityExpr::isInvalid()`, so nothing was reported. Propagate the
`Undefined` as the result of the call instead, which the analysis
reports as "cannot resolve lock expression" like any other unsupported
expression.
Assisted-by: Claude Fable 5.1
[clang][ThreadSafety] Resolve sibling members of function pointer fields against the called object (#231602)
d1e84bb9ad3b allowed thread safety attributes on function pointer
fields, but an attribute naming a sibling member of the struct was
translated without an implicit object, so for
struct Dev {
Mutex mu;
void (*lock)(void) ACQUIRE(mu);
};
`dev->lock()` did not acquire `dev->mu`. In C the field was translated
as a bare `mu` that matched no object's `mu`; in C++ the `this->mu` that
Sema builds was substituted with the placeholder `this` of the enclosing
function, so inside a member function of `Dev` a call through another
object was silently taken as a lock of the enclosing object's `mu`.
Use the base of the member access through which the field is called as
the implicit object for the attributes on that field. The member access
[6 lines not shown]
x11/xscreensaver: Update 6.16 => 6.17
Changelog:
* Added missing localization strings (largely auto-translated).
* X11: Localizations are being installed again.
* macOS, iOS, Android: Now localized.
* macOS: Possible workarounds for longstanding Apple bugs where the
legacyScreenSaver process would start using 100% CPU and savers would
never run again.
* macOS 14.6 or later and iOS 17.6 or later are now required, since
Xcode 6 can no longer build executables that work on older OSes.
https://www.jwz.org/xscreensaver/changelog.html
PR: 299379
Approved by: osa, vvd (Mentors, implicit)
[ScalarEvolution] Avoid duplicate range computation for singleton steps (#232653)
When the step range contains a single value, its signed minimum and
maximum are equal, so we can skip the second affine range calculation
and reuse the first result. This reduces compile-time instruction counts
by 0.27% for mafft and 0.14% for lencod at O3.
[Clang] Fix crash classifying a dependent call to a non-callable value (#220110)
Clang asserts in Type::castAs<FunctionType> (via
CallExpr::getCallReturnType) when a template argument contains a call
whose callee has already been substituted to a plain value while an
argument is still dependent, e.g.
```cpp
template <auto V> struct W {
static constexpr auto value = V;
template <class T> auto f(T) -> W<value(T::value)>;
};
template struct W<42>;
```
When W<42> is instantiated, the callee `value` becomes an int but
T::value is still dependent, so BuildCallExpr creates a dependent
CallExpr (the MayBeFunctionType guard from #139246 intentionally lets
DeclRefExpr callees through so the error is deferred to instantiation).
[17 lines not shown]
[mlir][TOSA] Fix folding of fp casts to bool (#232254)
Fold floating point splat casts to i1 using a nonzero comparison instead
of rounding to an integer.
Add regression test for signed zero and positive and negative fraction
values.
[SPIRV] Always preserve AuxData on AMD triples (#232068)
#227875 dropped `-spirv-preserve-auxdata` from the HIPAMD driver, but
the flag was still checked in some places within
`SPIRVAuxDataHandler.cpp`. In particular, `emitAuxDataStrings` was
checking it to preserve attributes and metadata for global variables and
functions. Without the flag being passed, some important attributes,
such as `convergent` are lost. This PR makes AMD triples behave as if
the flag was always passed. A complementary change is using
`OpExtInstWithForwardRefsKHR` for records targeting forward refs.
DeadMachineInstructionElim: Mark unread physreg defs dead
When DeadMachineInstructionElim deletes the only reader of a physreg
def, the def was left live. It already tracks liveness in its backward
walk, so mark non-reserved physreg defs that are not live afterward as
dead.
The newly dead $eflags/CC defs let MachineSink move some flag-setting
arithmetic, which accounts for the codegen changes.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>