ΒΆunsigned int ComputeNumSignBits(
const llvm::Value* Op,
const llvm::DataLayout& DL,
unsigned int Depth = 0,
llvm::AssumptionCache* AC = nullptr,
const llvm::Instruction* CxtI = nullptr,
const llvm::DominatorTree* DT = nullptr,
bool UseInstrInfo = true)
unsigned int ComputeNumSignBits(
const llvm::Value* Op,
const llvm::DataLayout& DL,
unsigned int Depth = 0,
llvm::AssumptionCache* AC = nullptr,
const llvm::Instruction* CxtI = nullptr,
const llvm::DominatorTree* DT = nullptr,
bool UseInstrInfo = true)
Description
Return the number of times the sign bit of the register is replicated into the other bits. We know that at least 1 bit is always equal to the sign bit (itself), but other cases can give us information. For example, immediately after an "ashr X, 2", we know that the top 3 bits are all equal to each other, so we return 3. For vectors, return the number of sign bits for the vector element with the mininum number of known sign bits.
Declared at: llvm/include/llvm/Analysis/ValueTracking.h:171
Parameters
- const llvm::Value* Op
- const llvm::DataLayout& DL
- unsigned int Depth = 0
- llvm::AssumptionCache* AC = nullptr
- const llvm::Instruction* CxtI = nullptr
- const llvm::DominatorTree* DT = nullptr
- bool UseInstrInfo = true