[PATCH] D48399: [ConstantRange] Add support of mul in makeGuaranteedNoWrapRegion.

Tim Shen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 26 11:41:22 PDT 2018


timshen marked an inline comment as done.
timshen added inline comments.


================
Comment at: llvm/unittests/IR/ConstantRangeTest.cpp:1024
 
+TEST(ConstantRange, MakeGuaranteedNoWrapRegionMulSingleValue) {
+  typedef OverflowingBinaryOperator OBO;
----------------
sanjoy wrote:
> All of these tests would have passed without your change right (since earlier we'd return an empty range for multiplication)?
> 
> If yes, maybe add a couple of tests that check that we return non-trivial results (i.e. not empty sets) for some inputs?
> All of these tests would have passed without your change right (since earlier we'd return an empty range for multiplication)?

No they don't pass. These tests test the inverse cases too, e.g. "iff" instead of "if". Looking at `EXPECT_EQ(!Overflow, Range.contains(...));`, if Overflow is false and Range is empty, the test will fail.


https://reviews.llvm.org/D48399





More information about the llvm-commits mailing list