[InstCombine] Fold comparisons of x & -x with 0 and 1 (#213709)
This folds equality comparisons of `x & -x` with zero and one:
- `(x & -x) == 0` to `x == 0`
- `(x & -x) != 0` to `x != 0`
- `(x & -x) == 1` to `trunc x to i1`
- `(x & -x) != 1` to `!(trunc x to i1)`
The fold supports scalar, fixed-vector, and scalable-vector integer
types wider than `i1`. The `!= 1` fold is limited
to one-use `and` instructions to avoid increasing the instruction count.
Alive2: https://alive2.llvm.org/ce/z/Zwy2hW
Fixes #213708
X86: Simplify the EH_LABEL Expand condition (#213130)
Re-express the opt-out handling of EH_LABEL. The special
case is 32-bit non-GNU Windows, and the net result is to skip
printing unused labels. Try to make this more comprehensible
to help figure out where this logic should really be.
I want to eliminate use of the TargetOptions::ExceptionModel,
which ideally wouldn't be needed in a TargetLowering
constructor.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[InstCombine] Simplify fractions when there is no overflow (#210516)
Use Greatest Common Factor to avoid making bigger immediates.
Alive2 Proof: https://alive2.llvm.org/ce/z/3gEVTV
Resolves #210452
vfs_mountroot: unmute console in interactive prompt
If boot_mute is set the system appears to hang during the mountroot
prompt. Temporarily unmute the console so the prompt is visible.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D58549
(cherry picked from commit e96f1cbd690e68594fc8812de634f43c6711aa97)
vfs_mountroot: unmute console in interactive prompt
If boot_mute is set the system appears to hang during the mountroot
prompt. Temporarily unmute the console so the prompt is visible.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D58549
(cherry picked from commit e96f1cbd690e68594fc8812de634f43c6711aa97)
[InstCombine] Fold cttz(mul X, OddC) -> cttz(X) (#214376)
InstCombine already turns cttz(X, false) into cttz(X, true) when a
dominating condition proves X != 0. Issue #213877 points out this fails
once X is multiplied by an odd constant: the reproducer's `mul i64 %x,
3`
carries no nsw/nuw, so isNonZeroMul can't prove the product is nonzero
and
the flag is never set.
Multiplying by an odd constant preserves the trailing-zero count, so add
cttz(mul X, OddC) -> cttz(X). Rewriting the operand back to X is what
unblocks the existing reasoning: the branch form (test0_odd_mul in
known-non-zero.ll) is then handled by the known-non-zero path in
foldCttzCtlz, and the select form by the existing relaxation in
foldSelectCttzCtlz.
cttz-only -- the identity does not hold for ctlz.
[4 lines not shown]
devel/gprbuild: Improve option DEBUG
devel/gprbuild:
* Currently options DEBUG is ${BROKEN} because of some warnings from
libgpr and between the Port and the GNAT tool-chain. Replace the
${BROKEN} statement with a new variable that is passed to the libgrp
do-build phase that attenuates the tool-chain warnings
PR: 296655
(cherry picked from commit b665e89e9a64a1bbf2250dbfc779e69627ecf1f3)