[CIR] Fix address space of dest cleanup slot (#222628)
Make sure that flatten cfg creates new allocas for dest cleanup slot in
correct address space. This is important for address-space aware targets
like amdgpu.
[lldb][cmake] Accept config-mode packages in add_optional_dependency (#222976)
`add_optional_dependency` copies the caller-supplied `<found>` variable
after `find_package`, and callers name the Find module's result
variable, which is usually all-caps (`LIBXML2_FOUND`, `CURSES_FOUND`). A
package located in config mode only sets `<PackageName>_FOUND`
(`LibXml2_FOUND`), so the copy comes back empty and the dependency is
reported as missing and silently disabled even though `find_package`
succeeded.
Set the result variable to TRUE when either `${found}` or
`${package}_FOUND` is set, FALSE otherwise.
Behavior for module-mode finds is unchanged; only the config-mode case,
which previously always evaluated to false, is affected.
[IVDescriptors] Rename MonotonicDescriptor ConditionalInductionDescriptor (NFC) (#223707)
Rename `MonotonicDescriptor` to `ConditionalInductionDescriptor` to
acknowledge that the phi may wrap, so is not strictly monotonic.
Assisted-by: Codex
[libc] Fix fxdivi tests on 32-bit targets (#223675)
Guard saturation operands against overflow and correct boundary
expectations for the range and precision of 32-bit long.
Fixes issue introduced in a969579a9129891bccb63fcc69e76d74b299f322.
Assisted-by: Codex. Entirely done by the AI and reviewed by me.
dnscontrol: Update to 5.1.0
Changelog
Provider-specific changes:
f496a86: feat(p/CLOUDFLAREAPI): Normalize CF_WORKER_ROUTE TTL to avoid TTL-only corrections (#4871) (@cafferata)
b35d0cb: fix(p/AUTODNS): clear the legacy "main" record on zone update (#4881) (@dkorunic)
80299f7: fix(p/AUTODNS): send bare FQDN as MX value, not full RDATA (#4880) (@dkorunic)
65fe80a: fix(p/AUTODNS): transmit an MX preference of 0 (#4882) (@dkorunic)
aa20783: fix(p/CLOUDFLAREAPI): Preserve Single Redirect order. New redirects added to end of list. (#4869) (@KyleMit)
c29831e: fix(p/CNR): offer the debug mode levels as a list in init (#4879) (@cafferata)
df419c5: fix(p/DNSMADEEASY): ask the sandbox setting as a yes/no question in init (#4877) (@cafferata)
72a18fd: fix(p/INWX): ask the sandbox setting as a yes/no question in init (#4876) (@cafferata)
3b4078d: fix(p/TENCENTDNS): match package grades case-insensitively (#4884) (@Alice39s)
Bug fixes:
a32953c: fix: remove duplicate "(optional)" in init prompts and add ConfirmValue for yes/no fields (#4875) (@cafferata)
CI/CD:
05b5f9f: Build(deps): Bump joi from 18.2.3 to 18.2.9 (#4872) (@dependabot[bot])
f66211b: ci: adopt conventional commits (#4873) (@TomOnTime)
Other changes and improvements:
3ae38d7: HOSTINGDE: Fix SOA mailbox with a host being dropped (#4866) (@jonathan8devs)
[VPlan] Use frozen combined condition in early exit first-active-lane
Combined is used both to compute if an early exit was taken via VPInstruction::AnyOf, as well as the index of the early-exited lane in VPInstruction::FirstActiveLane.
Combined can have poison lanes past the exited lane, so the AnyOf uses freeze to prevent branching on poison. However FirstActiveLane on a vector with a poison lane is poison, so we need to also use the frozen version of Combined to prevent poison there.
[VPlan] Fix VPInstruction::AnyOf combine undoing freeze
There is an any-of combine for unrolled VPlans which does:
any-of (fcmp uno A, A), (fcmp uno B, B), ...-> any-of (fcmp uno A, B)
However any-of implicitly freezes each individual operand and this means we go from `freeze (fcmp uno A, A)` to `freeze (fcmp uno A, B)` which isn't sound: alive2.llvm.org/ce/z/UdQM7C
This causes miscompiles today with early exit loops, see the attached test case in single-early-exit-anyof-fold.ll.
This fixes it by explicitly modelling the freeze in VPlan. There are three places where we use AnyOf:
1) early exit loops: the freeze needs to be applied per-lane, so apply it to `(any-of (freeze (combined-conds-to-exit)))`
2) handleMaxMinNumReductions: If any lane of the reduction was poison in the scalar loop, the final result will be poison. We only need to freeze the result of AnyOf to prevent immediate UB when branching. Freezing individual operands blocks the any-of combine otherwise.
3) handleFindLastReductions: we need to freeze Cond itself since it's got multiple uses, but I plan on fixing this in a separate PR
[libc] Reject unsupported flags in fchmodat with ENOTSUP (#223165)
### Summary
The Linux kernel's `SYS_fchmodat` system call only takes 3 arguments
(`dirfd`, `pathname`, `mode`), but our syscall wrapper was passing a 4th
`flags` argument that the kernel simply dropped.
This PR cleans up the wrapper to pass the 3 arguments expected by the
kernel, and adds a check to `fchmodat` to return `-1` with `ENOTSUP`
whenever non-zero flags (like `AT_SYMLINK_NOFOLLOW`) are passed.
Fixes #223072
### Changes
- Cleaned up `linux_syscalls::fchmodat` to pass only 3 arguments to
`SYS_fchmodat`.
- Added a check in `fchmodat` entrypoint to set `libc_errno = ENOTSUP`
and return `-1` if `flags != 0`.
- Added `libc.hdr.errno_macros` to the CMake dependencies for `fchmodat`
[8 lines not shown]
[test][AggressiveInstCombine] Test type legality handling in `TruncInstCombine` (NFC) (#222930)
I noticed that this block of code that checks type legality in
`TruncInstCombine::getMinBitWidth` is not tested:
```
else { // MinBitWidth == TruncBitWidth
// In this case the expression can be evaluated with the trunc instruction
// destination type, and trunc instruction can be omitted. However, we
// should not perform the evaluation if the original type is a legal scalar
// type and the target type is illegal.
bool FromLegal = MinBitWidth == 1 || DL.isLegalInteger(OrigBitWidth);
bool ToLegal = MinBitWidth == 1 || DL.isLegalInteger(MinBitWidth);
if (!DstTy->isVectorTy() && FromLegal && !ToLegal)
return OrigBitWidth;
}
```
This commit adds tests.
mfiutil(8)/mrsasutil(8): display/parse enclosure by device ID (EID)
mfi_drive_name() built the "Exx:Syy" drive location string using
struct mfi_pd_info's encl_index field, the enclosure's firmware-
internal position index. Broadcom's own storcli/MegaCli tooling
instead leads with the enclosure's Device ID (EID) in its primary
drive listing; encl_index only shows up as "Position" in a detailed
per-enclosure view. Both numbers are raw, unmodified firmware values
already fetched into struct mfi_pd_info/mfi_pd_address, but only
encl_index was ever displayed or accepted as input, leading to
confusion when cross-referencing drive locations against storcli
output.
Switch mfi_drive_name() and mfi_lookup_drive() to use encl_device_id
instead, aligning FreeBSD's enclosure numbering with Broadcom's own
utilities. Since mrsasutil(8) is the same binary as mfiutil(8) under
a different name, this applies to both mfi(4) and mrsas(4) alike.
This is a user-visible behavior change: the numeric value of "xx" in
[8 lines not shown]
[IR][InstSimplify] Clarify poison elements in cttz.elts results in poison (#223935)
The generic expansion for cttz.elts in LegalizeVectorOps is
(reduce.umax (select input, step_vector, 0))
Because reductions produce poison if any element is poison, this will
also produce poison.
ConstantFolding currently has short circuiting behaviour, e.g.
`cttz.elts <0, 1, poison, poison> -> 1`, but we should probably make
this consistent with reductions and just return poison. This updates
LangRef and ConstantFolding to be more explicit about this.
[alpha.webkit.UncountedCallArgsChecker] Look through unique_ptr::get() when finding a pointer's origin (#223568)
Previously, the checker only looked through `operator->` and `operator*`
on `std::unique_ptr`, `UniqueRef` and `LazyUniqueRef` when walking a
call argument back to its origin. It didn't include `get()` and `ptr()`
on those types, which caused an unnecessary warning. This includes
`get()` and `ptr()` on those types such that they are recognized and are
consistent with ref-counted and checked pointers.
[clang-repl] Respect LLD's canRunAgain result (#223926)
Clang-Repl’s Wasm executor calls `lld::lldMain()` for every incremental
input, but currently ignores `Result.canRunAgain`.
Ordinary linker errors remain recoverable:
```text
retCode=1 canRunAgain=1
```
A fatal LLD error can instead return:
```text
retCode=1 canRunAgain=0
```
In that case, LLD’s state may no longer be safe. This patch follows
LLD’s standalone driver and calls `lld::exitLld()` rather than allowing
[5 lines not shown]