[PATCH] D13612: [IR] Add a `makeNoWrapRegion` method to `ConstantRange`

Nick Lewycky via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 12:51:30 PDT 2015


nlewycky added inline comments.

================
Comment at: lib/IR/ConstantRange.cpp:138-139
@@ +137,4 @@
+
+  assert((NoWrapKind == OBO::NoSignedWrap ||
+          NoWrapKind == OBO::NoUnsignedWrap) && "NoWrapKind invalid!");
+
----------------
Please sink this below the test for BinOp being Add. It's not a misuse of the API to call it with OBO::Exact or some other flag if the BinOp is not an add.

================
Comment at: lib/IR/ConstantRange.cpp:150
@@ +149,3 @@
+
+  if (NoWrapKind == OBO::NoUnsignedWrap)
+    return ConstantRange(APInt::getNullValue(BitWidth), -C);
----------------
Please handle the case where NoWrapKind = NoUnsignedWrap | NoSignedWrap.


http://reviews.llvm.org/D13612





More information about the llvm-commits mailing list