diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-22 08:36:05 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-22 08:36:05 +0000 |
commit | 5299e25f502131483c4555efa641b93bad81a893 (patch) | |
tree | 3eaf4cb7b365551d7c5fdac97b498e87995c648e /llvm/lib/IR/ConstantRange.cpp | |
parent | f902250fc13bdcd2dbdb733304f1eed743613eb9 (diff) | |
download | bcm5719-llvm-5299e25f502131483c4555efa641b93bad81a893.tar.gz bcm5719-llvm-5299e25f502131483c4555efa641b93bad81a893.zip |
[ConstantRange] Rename make{Guaranteed -> Exact}NoWrapRegion() NFC
Following D60632 makeGuaranteedNoWrapRegion() always returns an
exact nowrap region. Rename the function accordingly. This is in
line with the naming of makeExactICmpRegion().
llvm-svn: 358875
Diffstat (limited to 'llvm/lib/IR/ConstantRange.cpp')
-rw-r--r-- | llvm/lib/IR/ConstantRange.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp index b2bdd0abd9c..3e1d7e471f1 100644 --- a/llvm/lib/IR/ConstantRange.cpp +++ b/llvm/lib/IR/ConstantRange.cpp @@ -181,9 +181,9 @@ bool ConstantRange::getEquivalentICmp(CmpInst::Predicate &Pred, } ConstantRange -ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp, - const ConstantRange &Other, - unsigned NoWrapKind) { +ConstantRange::makeExactNoWrapRegion(Instruction::BinaryOps BinOp, + const ConstantRange &Other, + unsigned NoWrapKind) { using OBO = OverflowingBinaryOperator; // Computes the intersection of CR0 and CR1. It is different from @@ -262,7 +262,7 @@ ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp, return Result; case Instruction::Mul: { - // Equivalent to calling makeGuaranteedNoWrapRegion() on [V, V+1). + // Equivalent to calling makeExactNoWrapRegion() on [V, V+1). const bool Unsigned = NoWrapKind == OBO::NoUnsignedWrap; const auto makeSingleValueRegion = [Unsigned, BitWidth](APInt V) -> ConstantRange { @@ -841,10 +841,9 @@ ConstantRange::add(const ConstantRange &Other) const { ConstantRange ConstantRange::addWithNoSignedWrap(const APInt &Other) const { // Calculate the subset of this range such that "X + Other" is // guaranteed not to wrap (overflow) for all X in this subset. - // makeGuaranteedNoWrapRegion will produce an exact NSW range. - auto NSWRange = ConstantRange::makeGuaranteedNoWrapRegion(BinaryOperator::Add, - ConstantRange(Other), - OverflowingBinaryOperator::NoSignedWrap); + auto NSWRange = ConstantRange::makeExactNoWrapRegion( + BinaryOperator::Add, ConstantRange(Other), + OverflowingBinaryOperator::NoSignedWrap); auto NSWConstrainedRange = intersectWith(NSWRange); return NSWConstrainedRange.add(ConstantRange(Other)); |