[NVPTX] add truncating store action for v2i32 to v2i1 (#235390)
expand action for `v2i32` to `v2i1` truncating stores was never set, so
they hit a scalar-only path in `LegalizeStoreOps` and crashed.
added it and the repro as a test.
fixes #235365.
[IndVarSimplify] Use context to prove a narrow IV def non-negative
When IndVars widens an IV, it checks for each narrow def (the IV and
values computed from it) whether it is non-negative on every iteration.
If it is, zext and sext of it are equal. Then when IndVars widens IV's
users, they can use both the sext and zext of it.
Now ask SCEV about def non-negativity using its context.
This allows it to infer facts from the dominating guards and assumes.
Assisted-By: Claude
[IndVarSimplify][SCEV][NFC] Add tests for LFTR losing the constant max trip count
When IndVars rewrites a loop exit like i >s C, where i starts at a
variable start, to i + 1 == smax(start, C + 1), SCEV's constant max
backedge-taken count of the loop gets worse: C - SINT_MIN before the
rewrite, all ones after it.
Add tests where those counts could be improved.
Assisted-By: Claude
fix(gisel): Keep ashr of sext_inreg and update checks
G_TRUNC roots now pass narrowed demand into the G_ASHR case, which turned
ashr(sext_inreg X, W), C into lshr whenever the top C bits were
undemanded. SelectionDAG folds that pair into a single sra by C + BW - W
before the same check, so it keeps the arithmetic shift. Use the folded
amount here too. This keeps AArch64 sbfx selection (neon-dotreduce.ll and
sext.ll no longer churn).
Regenerate the remaining AArch64 and AMDGPU checks affected by the new
TRUNC/XOR/SELECT roots.
[Offload][Omp] Compute getBlockLimit through liboffload (#236400)
Add two new device properties accessible through liboffload:
LAUNCH_MAX_NUM_WORK_GROUPS (max blocks) and LAUNCH_MAX_GRID_SIZE (max
total work-items). Using them compute the getBlockLimit in libomptarget
in a backend agnostic way.
Remove getBlockLimit from the Plugin Interface as it's no longer needed.
Assisted by Claude.
[libc] Use a syscall wrapper for `epoll_pwait` (#236382)
This PR move `epoll_pwait` behind the centralized syscall wrappers,
following `libc/docs/dev/syscall_wrapper_refactor.md`.
pf: Clear only the part of the packet descriptor that is read first
pf_init_pdesc() cleared the whole structure, 336 bytes on amd64, for
every packet and twice for a forwarded one. kif, m, pf_mtag, act and
the SCTP job list are set before they are read, so move them to the end
and clear only the 240 bytes before them. On amd64 that also stays
below the 256 bytes from which memset() switches to rep stosb.
Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60948
[libc] Use a syscall wrapper for `epoll_create` (#236381)
This PR move `epoll_create` behind the centralized syscall wrappers,
following `libc/docs/dev/syscall_wrapper_refactor.md`.
[mlir] Move bufferization external models into their own libraries
Prior to this PR the external models for `BufferizableOpInterface`,
`BufferDeallocationOpInterface`, `BufferViewFlowOpInterface` and
`AllocationOpInterface` lived in each dialect's Transforms library. Every
user of an unrelated transform therefore depended on the Bufferization
dialect and transforms.
This PR moves each model into its own `MLIR<Dialect><Interface>Impl` library
such that only users of those library requires dependent libraries to be built.
In particular, the Arith, ControlFlow, GPU, MLProgram, SCF and Shape Transforms
libraries no longer link MLIRBufferizationDialect or
MLIRBufferizationTransforms and MLIRTensorTransforms no longer links
MLIRLinalgDialect. This gives 104 targets a smaller link closure, e.g.
MLIRControlFlowTransforms (-22 libraries), MLIRMLProgramTransforms (-20),
MLIRSCFTransforms (-8) and MLIRTensorTransforms (-7).
The Linalg model and the Func model in MLIRBufferizationTransforms stay
where they are for now as the require more mechanical changes.
[6 lines not shown]
[IndVarSimplify][SCEV][NFC] Add tests for LFTR losing the constant max trip count
When IndVars rewrites a loop exit like i >s C, where i starts at a
variable start, to i + 1 == smax(start, C + 1), SCEV's constant max
backedge-taken count of the loop gets worse: C - SINT_MIN before the
rewrite, all ones after it.
Add tests where those counts could be improved.
Assisted-By: Claude
[IndVarSimplify][NFC] Add tests for widening users of a non-negative IV
IndVars widens users of a non-negative IV with both sext and zext of the
IV, but doesn't use guards on the IV start to prove it is non-negative.
Add tests for it, and for the same loops with the IV start known to be
non-negative from !range, which are already widened.
Assisted-By: Claude
[SystemZ] [HLASM] Print address constant type with value of size (#236296)
Currently the address constant type is emitted as `AD` which has
implicit value of size 8. This is to change to print the address
constant type with implicit or explicit value for the real size.
[IndVarSimplify][SCEV][NFC] Add tests for LFTR losing the constant max trip count
When IndVars rewrites a loop exit like i >s C, where i starts at a
variable start, to i + 1 == smax(start, C + 1), SCEV's constant max
backedge-taken count of the loop gets worse: C - SINT_MIN before the
rewrite, all ones after it.
Add tests where those counts could be improved.
Assisted-By: Claude