[DAG] Add trunc(select) narrowing tests (NFC) (#248034)
DAGCombiner::visitTRUNCATE narrows trunc(select c, a, b) to
select c, (trunc a), (trunc b) when truncating is free. These tests pin
its current output for #223763, which stops it for i8 on X86 with CMOV.
All test IR is what opt -O2 produces for x86-64, s390x and amdgcn with
their real datalayouts, so it is IR the backend can see. InstCombine
already narrows a trunc of a select with a constant arm, so that case
only comes from truncates the DAG creates, here a shift amount.
X86 (x86-64, i686 with and without CMOV):
- trunc_select_i8: computed arms of an i32 select truncated to i8. With
CMOV, LowerSELECT widens the i8 select with a MOVZX of each arm
computed in i8.
- trunc_select_i32: an i64 select truncated to i32, which has a CMOV of
its own width.
- trunc_select_i7: an illegal type, legalized to i8.
- trunc_select_shift_amount: a select of two constant shift amounts,
[13 lines not shown]
[ConstraintElim] A signed sub of operands with same signs cannot wrap (#247393)
If both operands are known non-negative, a - b is in [-INT_MAX,
INT_MAX]. If a is strictly negative and b is non-positive, the
difference lies in [INT_MIN, INT_MAX]. In either case, the subtraction
cannot wrap.
https://alive2.llvm.org/ce/z/jRVtjX
TableGen: Add \x escape to string literals
Accept \xHH in string literals, producing the character with the
hexadecimal value HH. This allows writing names that contain control
characters, such as the \01 prefix used to suppress symbol mangling. A
few edge cases in RuntimeLibcallsInfo need to do this (e.g., on Darwin
there is a function named "\01mcount").
Assisted-by: Claude
CloneFunction: Factor out pruned clone PHI and terminator helpers
Split the pruning cloner's terminator folding and PHI cleanup into
helper functions for readability and future re-use.
Assisted-by: Claude
[Clang][OpenMP] Use default address space for task and globalized pointers
The pointer to a task descriptor returned by __kmpc_omp_task_alloc,
and the pointer to a variable globalized with __kmpc_alloc_shared,
were cast to address space 0. This is fine for some targets (AMDGPU,
NVPTX) but wrong for SPIR-V, where address space 0 is private memory
and the default is address space 4. The patch switches to the default
address space instead, which fixes SPIR-V and implies no change to the
currently-working targets.
I can't test this on hardware, but it resolves the SPIR-V compilation
crash revealed by #245784/#247569.
Assisted-By: Claude
libc: memstream tests: convert asset_stream() to actual assertions
Just printing doesn't do anything useful here, use assertions to fail
the tests.
Reviewed by: ngie, rmoeller, siva
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D62321
binmiscctl: fix a crash and argument permutation in `add`
The 'oops' in this usage() call was pointed out by llm-postcr, but I
noticed the argument permutation while I was trying to test it. A
proper __printflike annotation on usage() points out another whoopsie
along the same lines.
Disabling argument permutation isn't strictly necessary because we
aren't expecting any non-option arguments after `add` peels off the
name, but being more strict makes us more likely to catch and properly
flag slight typos.
Reported by: llm-postcr
Differential Revision: https://reviews.freebsd.org/D62320
[libc] return -1 when v/swprintf truncate output (#245838)
Hello, this is my first pr for libc but I have done my best to read the
guidelines and policies. I look forward to making any changes or
improvements as needed :). AI Disclosure: no ai was used, but I did read
a previous pr for this issue which was later closed for being AI
generated. This change will fix #245060.
From the standard:
```
The swprintf function returns the number of wide characters written in the array, not
counting the terminating null wide character, or a negative value if an encoding error
occurred or if n or more wide characters were requested to be written.
```
```
The vswprintf function returns the number of wide characters written in the array, not
counting the terminating null wide character, or a negative value if an encoding error
occurred or if n or more wide characters were requested to be generated.
```
[12 lines not shown]
[RISCV][GISel] Add GlobalISel equivalents of the sewNsimm5 complex patterns (#247920)
Add GIComplexPatternEquiv records for sew8simm5 through sew64simm5 and
implement selectRVVSimm5 in the GlobalISel instruction selector,
mirroring RISCVDAGToDAGISel::selectRVVSimm5. The importer can now use
the patterns that need them, so constant splats that fit in a 5-bit
signed immediate select to vmv.v.i instead of li + vmv.v.x.
Part of #246831
[SLSR] Add tests for reuse of OR-based multiplies (NFC) (#247747)
Adds test for OR reuse which can expose gaps in SLSR for future
analysis. This is attempt to extract the test use cases exposed by
https://github.com/llvm/llvm-project/pull/240431 and the existing gaps
upstream.
Assisted-by: OpenAI Codex
Assisted-by: Claude
security/zeek: Update to 9.0.2
https://github.com/zeek/zeek/releases/tag/v9.0.2
This release fixes the following security issues:
- CRITICAL: packet_analysis/IP: Use-after-free due to tunneled IP
fragment key collisions
- CRITICAL: SMTP/BDAT: Use-after-free due BDAT holding a referencing
to a freed mail instance
- MEDIUM: DCE-RPC: Pipelined requests break opnum association allowing evasion
- MEDIUM: broker: Out-of-bounds write when unserializing invalid bloom filter
- MEDIUM: broker: Underflow and out-of-bounds write from inconsistent
incremental hash state
[25 lines not shown]
[GVN] Extend processFoldableCondBr to support switch
A switch with constant condition can also be folded. As a result, we
rename processFoldableCondBr to support switch. The logic of the
function is rewrite as switch can have multiple destinations. Instead
of recording something dead, we record the Live sucessor, and skip
same live BB.
splitCriticalEdges in here is also support merging same BB so that GVN
can reach converge earlier.
Assisted-by: Claude # Test