LLVM 20.0.0git
|
#include "llvm/IR/ConstantRange.h"
#include "llvm/ADT/APInt.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <optional>
Go to the source code of this file.
|
static |
Definition at line 1748 of file ConstantRange.cpp.
References llvm::BitWidth, computeShlNSWWithNegLHS(), computeShlNSWWithNNegLHS(), llvm::APInt::getAllOnes(), llvm::APInt::getZero(), llvm::APInt::isNegative(), llvm::APInt::isNonNegative(), LHS, RHS, llvm::ConstantRange::Signed, and llvm::ConstantRange::unionWith().
Referenced by llvm::ConstantRange::shlWithNoWrap().
|
static |
Definition at line 1729 of file ConstantRange.cpp.
References llvm::BitWidth, llvm::APInt::countLeadingOnes(), llvm::APInt::getBitWidth(), llvm::ConstantRange::getNonEmpty(), llvm::APInt::getSignMask(), llvm::APInt::shl(), and llvm::APInt::sshl_ov().
Referenced by computeShlNSW().
|
static |
Definition at line 1708 of file ConstantRange.cpp.
References llvm::BitWidth, llvm::APInt::countLeadingZeros(), llvm::APInt::getBitsSet(), llvm::APInt::getBitWidth(), llvm::ConstantRange::getNonEmpty(), llvm::APInt::sshl_ov(), and llvm::APIntOps::umax().
Referenced by computeShlNSW().
|
static |
Definition at line 1685 of file ConstantRange.cpp.
References llvm::BitWidth, llvm::APInt::countLeadingZeros(), llvm::APInt::getHighBitsSet(), llvm::ConstantRange::getNonEmpty(), LHS, RHS, llvm::APIntOps::umax(), and llvm::APInt::ushl_ov().
Referenced by llvm::ConstantRange::shlWithNoWrap().
|
static |
Estimate the 'bit-masked AND' operation's lower bound.
E.g., given two ranges as follows (single quotes are separators and have no meaning here),
LHS = [10'00101'1, ; LLo 10'10000'0] ; LHi RHS = [10'11111'0, ; RLo 10'11111'1] ; RHi
we know that the higher 2 bits of the result is always 10; and we also notice that RHS[1:6] are always 1, so the result[1:6] cannot be less than LHS[1:6] (i.e., 00101). Thus, the lower bound is 10'00101'0.
The algorithm is as follows,
Definition at line 1547 of file ConstantRange.cpp.
References llvm::BitWidth, llvm::APInt::getZero(), LHS, RHS, and llvm::APIntOps::umax().
Referenced by llvm::ConstantRange::binaryAnd(), and llvm::ConstantRange::binaryOr().
|
static |
Definition at line 561 of file ConstantRange.cpp.
References llvm::ConstantRange::isSignWrappedSet(), llvm::ConstantRange::isSizeStrictlySmallerThan(), llvm::ConstantRange::isWrappedSet(), llvm::ConstantRange::Signed, and llvm::ConstantRange::Unsigned.
Referenced by llvm::ConstantRange::intersectWith(), and llvm::ConstantRange::unionWith().
|
static |
Definition at line 2023 of file ConstantRange.cpp.
References assert(), llvm::BitWidth, llvm::APInt::getZero(), llvm::Lower, and llvm::Upper.
Referenced by llvm::ConstantRange::cttz().
|
static |
Definition at line 2091 of file ConstantRange.cpp.
References assert(), llvm::BitWidth, llvm::countl_zero(), llvm::Lower, and llvm::Upper.
Referenced by llvm::ConstantRange::ctpop().
|
static |
Exact mul nsw region for single element RHS.
Definition at line 291 of file ConstantRange.cpp.
References llvm::BitWidth, llvm::APInt::DOWN, llvm::ConstantRange::getNonEmpty(), llvm::APInt::getSignedMaxValue(), llvm::APInt::getSignedMinValue(), llvm::Lower, llvm::APIntOps::RoundingSDiv(), llvm::APInt::UP, and llvm::Upper.
Referenced by llvm::ConstantRange::makeGuaranteedNoWrapRegion().
|
static |
Exact mul nuw region for single element RHS.
Definition at line 278 of file ConstantRange.cpp.
References llvm::BitWidth, llvm::APInt::DOWN, llvm::APInt::getMaxValue(), llvm::APInt::getMinValue(), llvm::ConstantRange::getNonEmpty(), llvm::APIntOps::RoundingUDiv(), and llvm::APInt::UP.
Referenced by llvm::ConstantRange::makeGuaranteedNoWrapRegion().