[PATCH] D60264: [ConstantRange] Add isNegative() and isNonNegative() methods
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 4 08:40:36 PDT 2019
lebedev.ri added inline comments.
================
Comment at: llvm/unittests/IR/ConstantRangeTest.cpp:1664
+ EXPECT_EQ(AllNonNegative, CR.isAllNonNegative());
+ });
+}
----------------
nikic wrote:
> lebedev.ri wrote:
> > Hmm, can we also check that
> > ```
> > if(!CR.isEmptySet() && !CR.isFullSet())
> > EXPECT_NE(AllNegative, AllNonNegative);
> > ```
> > ?
> >
> This doesn't hold in general, as AllNegative and AllNonNegative may both be false for ranges that cross zero (but are not necessarily full). E.g. `[-5, 6)` is neither negative nor non-negative.
Hmm, of course it is.
I believe i meant `EXPECT_FALSE(AllNegative && AllNonNegative);`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60264/new/
https://reviews.llvm.org/D60264
More information about the llvm-commits
mailing list