================
@@ -2720,6 +2720,22 @@ TEST_F(ConstantRangeTest, binaryAnd) {
EXPECT_EQ(R16_32.binaryAnd(R0_99), R0_32);
EXPECT_EQ(R0_99.binaryAnd(R16_32), R0_32);
+ // 'And' with leading bits are masked (with common leading bits stripped)
----------------
zsrkmyn wrote:
'And' op is tricky, since it operates regardless of the signedness and all
ranges can be treated as unsigned. E.g., a range (with bitwidth=8) `[1, -10)`
can be treated as `[1, 246)` because of the nature of 2's complement;
similarly, range `[-3, -1)` can be treated as `[253, 255)`; and results won't
be affected. And I think it's how `ConstantRange` designed.
I'll add a test anyway.
https://github.com/llvm/llvm-project/pull/120352
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits