[llvm] [KnownBits] Make nuw and nsw support in computeForAddSub optimal (PR #83382)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 2 05:42:40 PST 2024
================
@@ -2318,7 +2321,11 @@ static bool isNonZeroRecurrence(const PHINode *PN) {
static bool isNonZeroAdd(const APInt &DemandedElts, unsigned Depth,
const SimplifyQuery &Q, unsigned BitWidth, Value *X,
- Value *Y, bool NSW) {
+ Value *Y, bool NSW, bool NUW) {
+ if (NUW)
+ return isKnownNonZero(Y, DemandedElts, Depth, Q) ||
+ isKnownNonZero(X, DemandedElts, Depth, Q);
----------------
RKSimon wrote:
Separate refactor patch?
https://github.com/llvm/llvm-project/pull/83382
More information about the llvm-commits
mailing list