llvm-project
a779fdff - [Support] Add KnownBits::isNonPositive() helper and exhaustive test coverage for sign predicates (#175284)

Commit
55 days ago
[Support] Add KnownBits::isNonPositive() helper and exhaustive test coverage for sign predicates (#175284) This patch adds: 1. KnownBits::isNonPositive() - Returns true if this value is known to be non-positive (i.e., the signed maximum value is <= 0). This is implemented using getSignedMaxValue().isNonPositive(). 2. SignPredicatesExhaustive test - An exhaustive test that validates the correctness of isNegative(), isNonNegative(), isStrictlyPositive(), isNonPositive(), and isNonZero() by iterating through all possible KnownBits combinations for 1-bit and 4-bit widths and verifying that the predicates return true if and only if all possible values represented by the KnownBits satisfy the predicate. Fixes #175203
Author
Parents
Loading