[PATCH] D60960: [ConstantRange] Add makeExactNoWrapRegion()

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 27 11:54:05 PDT 2019


sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.

> I got confused on the terminology

Any suggestions on how we can improve the terminology to be less confusing?



================
Comment at: llvm/include/llvm/IR/ConstantRange.h:127
 
-  /// Return the exact range containing all X such that "X BinOpC Y" is
-  /// guaranteed not to wrap (overflow) for all Y in Other.
+  /// Produce the largest range containing all X such that "X BinOp Y" is
+  /// guaranteed not to wrap (overflow) for *all* Y in Other. However, there may
----------------
Does this always return the *largest* such range?  (Just double-checking that this language is intentional.)


================
Comment at: llvm/include/llvm/IR/ConstantRange.h:147
 
+  /// Produce the exact range containing all X such that "X BinOp Y" is
+  /// guaranteed not to wrap. The converse also holds: If a value X is not
----------------
Up to you, but there is a standard way of describing this:  "Returns the range such that X is in returned range if and only if X binop Y does not overflow."


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60960/new/

https://reviews.llvm.org/D60960





More information about the llvm-commits mailing list