mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 03:46:07 +00:00
[KnownBits] Check for conflict-freedom in exhaustive tests
And make sure udiv() Exact does not produce conflicts.
This commit is contained in:
parent
577b163277
commit
d4bfc144ea
@ -839,6 +839,8 @@ KnownBits KnownBits::udiv(const KnownBits &LHS, const KnownBits &RHS,
|
||||
Known.Zero.setBit(0);
|
||||
// Odd / Even -> impossible
|
||||
// Even / Even -> unknown
|
||||
if (Known.hasConflict())
|
||||
Known.setAllZero();
|
||||
}
|
||||
|
||||
return Known;
|
||||
|
@ -79,6 +79,7 @@ static void testUnaryOpExhaustive(
|
||||
}
|
||||
});
|
||||
|
||||
EXPECT_TRUE(!Computed.hasConflict());
|
||||
EXPECT_TRUE(isCorrect(Exact, Computed, Known));
|
||||
// We generally don't want to return conflicting known bits, even if it is
|
||||
// legal for always poison results.
|
||||
@ -110,6 +111,7 @@ static void testBinaryOpExhaustive(
|
||||
});
|
||||
});
|
||||
|
||||
EXPECT_TRUE(!Computed.hasConflict());
|
||||
EXPECT_TRUE(isCorrect(Exact, Computed, {Known1, Known2}));
|
||||
// We generally don't want to return conflicting known bits, even if it is
|
||||
// legal for always poison results.
|
||||
|
Loading…
x
Reference in New Issue
Block a user