[InstCombine] Treat `asin`, `asinh`, `atan` and `cbrt` as odd-functions (#227336)
Add `asin`, `asinh`, `atan` and `cbrt` into the odd-functions list. They
should be treated as odd-functions now.
For #227011
lib80211: fix build with eXpat 2.9.0
eXpat 2.9.0 deprecates XML_GetCurrentLineNumber() in favour of
XML_GetCurrentLineNumber64(). The new function behaves the same
as the old one but is not prone to 32 bit integer wrap-around.
[MachineOutliner] Attribute outlined calls to the candidate's last call (#229260)
An outlined call stands in for a whole candidate but can carry only one
debug location, so no choice is correct for every instruction it
replaces. Prioritize the location that keeps unwinding as if the code
were not outlined: a return address is symbolized at the preceding
instruction, so unwinding through a call in the candidate resolves the
caller frame at the outlined call. Using the candidate's first location
could attribute that frame to an unrelated inlined callee, as seen in
ASan reports.
Prefer the last call's location. A candidate ending in a call may be
outlined as a thunk whose tail call returns directly past the outlined
call, making the backtrace match the unoutlined code exactly. With
multiple calls, the location can still be exact for only one of them.
Keep the first location when the candidate has no call, its last call
has no line, or the replacement is a tail branch that nothing returns
to.
Follow-up to llvm/llvm-project#224189.
bsd.own.mk: Respect USE_FORT even if defined after bsd.own.mk.
Using (a chain of logic that boils down to)
.if ${USE_FORT:Uno} != "no"
CPPFLAGS+= -D_FORTIFY_SOURCE=2
.endif
expands USE_FORT eagerly, so if USE_FORT was not already defined before
including <bsd.own.mk>, it's too late after.
Using (a chain of logic that boils down to)
CPPFLAGS+= ${${USE_FORT:Uno} != "no":?-D_FORTIFY_SOURCE=2:}
expands USE_FORT lazily, so it's only when CPPFLAGS itself is expanded
-- usually in a recipe, after all variable assignments, prerequisite
lists, and .directives have been processed -- that USE_FORT is
expanded.
[9 lines not shown]
[AsmPrinter] Fix direct callee operand lookup in CallGraphSection (#218534)
In handleCallsiteForCallgraph, direct callee operand was assumed to
always be at index 0 (MI.getOperand(0)). While true for x86_64, on
ARM Thumb/Thumb-2 (e.g. tBL), operand 0 represent predicate condition
code not the callee operand. Use getCalleeOperand to correctly retrieve
the operand.
Assisted-by: Gemini
ssp.h: Stop creating references to useless __ssp_protected_* symbols.
The ssp wrappers are useful _only_ when they are actually used for
inline function call expansion; if the function is used for anything
else like a function pointer, only the underlying library symbol
should be used.
To pacify linker complaints about spurious references to
__ssp_protected_getcwd/read/readlink, we added equally spurious
definitions of those symbols to libc without understanding why; it
turns out it only happened because the ssp wrappers declared, e.g.:
extern inline read(...) __RENAME(__ssp_protected_read);
extern inline read(...) { <ssp check>; return __ssp_real_read(...); }
The declaration with __RENAME caused the compiler to generate
references, required by the linker to be resolved, to the symbol
`__ssp_protected_read' when compiling code that takes the address of
the function read() to pass around a function pointer. Instead, the
[15 lines not shown]
Merge tag 'wq-for-7.3-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue fixes from Tejun Heo:
- Fix a NULL dereference in the chained work check when a kworker
queues work on a draining or destroying workqueue outside work item
execution.
* tag 'wq-for-7.3-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
workqueue: Fix NULL current_pwq deref in chained work check
[WebKit Checkers] Allow a view into a temporary CanBorrow prvalue without a Borrow<T> (#229495)
Common example:
```
for (auto& x : copyToVector(y)) {
}
```
This is safe without any explicit Borrow<T> because it is syntactically
impossible to name the Vector, so we must have exclusive access to it,
with no other pointers/references/views that can invalidate it.
The one edge case to consider is that the iterator itself might hold a
pointer to the Vector, and vend an API that can invalidate the Vector.
(A pre-existing regression test covers this case.)
To decide that, `isSafeExpr` now also receives the sink type (the type
of the variable, parameter, or lambda capture that receives the value)
[2 lines not shown]
Merge tag 'cgroup-for-7.3-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fixes from Tejun Heo:
- During CPU offline, the active mask drops the CPU before cpuset
updates the effective CPUs, so a task placement in that window could
find no active CPU in the top cpuset and dereference NULL. Restore
the NULL check.
- The cpuset v2-mode test read the subsystem's root pointer, which is
stale during a cgroup filesystem rebind, and the hotplug handler
evaluated it before taking the cpuset mutex. Record the mode in a
flag and test it under the mutex.
* tag 'cgroup-for-7.3-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
cgroup/cpuset: Call is_in_v2_mode() after acquiring cpuset_mutex in cpuset_handle_hotplug()
cgroup/cpuset: Handle cpu hotplug race in guarantee_active_cpus()
cgroup/cpuset: Don't access cpuset_cgrp_subsys.root in is_in_v2_mode()
Add and enable editors/eh, version 1.9.0, to the packages collection
A minimalist version of vi(1). It is an example of the "Buffer Gap"
method outlined in the The Craft Of Text Editing used by many Emacs
style editors.
Create or read a text file to edit. Text files consists of lines of
printable UTF-8 text, tabs, or newline characters. A physical line
can be of arbitrary length and is delimited by either a newline or the
end of file. Tab stops are every eight columns. The behaviour of
non-printable characters may vary depending on the implementation of
the Curses library, stty(1) settings, or terminal emulator.
eh was the winner of IOCCC28, catalogued as 2024/howe
[CIR] Correct 'null' init for array types with non-zero init (#229543)
The member pointers are supposed to be initialized to -1, so an array of
them or a record of them needs to be initialized properly to -1. This
patch makes sure we look through array types/etc to get the correct
initialization.
Also, quite a few places were using 'getZeroAttr' when they meant 'null
init', so this changes that as well.
[RISCV][NFC] Simplify isSupportedStackID (#229117)
The switch case approach meant that we had to add a case every time a
new `TargetStackID` gets added. The original switch was added in
https://reviews.llvm.org/D94465 at which time I guess we had only a few
valid cases.
[CIR] Skip 'dead' branches when emitting an 'if' statement (#229553)
At one point, we actively decided not to skip these, as it would
possibly be useful for static-analysis. However, we're finding that this
is actually taken advantage of in quite a few places (particularly
things that call undefined things in the false branch), so we are
going revert our previous decision and do the FE level omission.
This functionality could potentially be restored in the future, but we
probably would want a CIRSimplify patch to do the dead-branch
elimination that runs all the time, but that would require better
constant folding in CIR.
Merge tag 'sched_ext-for-7.3-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext
Pull sched_ext fixes from Tejun Heo:
- Taking a CPU offline could hang, or stall until the watchdog ejected
the BPF scheduler, when tasks on the dying CPU were still held by the
scheduler or sitting on a user dispatch queue. Re-enqueue them onto
the local queue when the runqueue goes offline so that the CPU pushes
them off like the other sched classes.
- The sequence number guarding against stale dispatches was per
runqueue, so a task re-enqueued on another CPU could get the same
number and a dispatch meant for its earlier instance was applied to
the new one. Use a per-task counter.
- A task dispatched to another CPU's local queue got its ops.dequeue()
only when picked to run and flagged as a core-sched pick. Call it at
insertion like for same-CPU dispatches.
[5 lines not shown]
sem test: avoid ETIMEDOUT races in the EINTR test cases
timedwait and clockwait_absolute_intr_remaining arm a 50ms SIGALRM and then
wait until an absolute deadline only 100ms in the future.
On a loaded VM the signal can be delivered more than 50ms late, so the wait
times out first.
Approved by: imp
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D60347
[msan] Correctly handle llvm::fake_use (as a no-op) (#229591)
The fake_use intrinsic (used by -fextend-variable-liveness) was being
strictly handled (i.e., check that the parameter is fully initialized),
which led to false positives
(https://github.com/llvm/llvm-project/issues/225425). This patch solves
the issue by silently not instrumenting fake_use, since they are, by
definition, not real uses and therefore cannot lead to
use-of-uninitialized-memory.
Fixes: #225425
[libc][math] Improve accuracy for exp*f float-only implementations. (#227881)
Pure Estrin's scheme pushes the rounding errors a bit more than 1 ULP on
non-FMA targets for these functions.