X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FIR%2FConstantRange.h;h=fb596a3bf16e63bd8631739db69b1668dd551fe7;hb=HEAD;hp=4b76e926032befae5578b173d2eab403d08b9fe5;hpb=c36e746e9802fa1d5c36e6f98c8bc5cb440be59a;p=oota-llvm.git diff --git a/include/llvm/IR/ConstantRange.h b/include/llvm/IR/ConstantRange.h index 4b76e926032..fb596a3bf16 100644 --- a/include/llvm/IR/ConstantRange.h +++ b/include/llvm/IR/ConstantRange.h @@ -82,6 +82,17 @@ public: static ConstantRange makeSatisfyingICmpRegion(CmpInst::Predicate Pred, const ConstantRange &Other); + /// Return the largest range containing all X such that "X BinOpC C" does not + /// wrap (overflow). + /// + /// Example: + /// typedef OverflowingBinaryOperator OBO; + /// makeNoWrapRegion(Add, i8 1, OBO::NoSignedWrap) == [-128, 127) + /// makeNoWrapRegion(Add, i8 1, OBO::NoUnsignedWrap) == [0, -1) + /// makeNoWrapRegion(Add, i8 0, OBO::NoUnsignedWrap) == Full Set + static ConstantRange makeNoWrapRegion(Instruction::BinaryOps BinOp, + const APInt &C, unsigned NoWrapKind); + /// Return the lower value for this range. /// const APInt &getLower() const { return Lower; }