[Constants] Remove unused isGEPWithNoNotionalOverIndexing() method

Since d56b0ad441, this method is
no longer used -- and shouldn't be used.
This commit is contained in:
Nikita Popov 2022-01-19 11:36:40 +01:00
parent d56b0ad441
commit ed0cdb2939
2 changed files with 0 additions and 29 deletions

View File

@ -1196,13 +1196,6 @@ public:
/// and the getIndices() method may be used.
bool hasIndices() const;
/// Return true if this is a getelementptr expression and all
/// the index operands are compile-time known integers within the
/// corresponding notional static array extents. Note that this is
/// not equivalant to, a subset of, or a superset of the "inbounds"
/// property.
bool isGEPWithNoNotionalOverIndexing() const;
/// Select constant expr
///
/// \param OnlyIfReducedTy see \a getWithOperands() docs.

View File

@ -1495,28 +1495,6 @@ bool ConstantExpr::isCompare() const {
return getOpcode() == Instruction::ICmp || getOpcode() == Instruction::FCmp;
}
bool ConstantExpr::isGEPWithNoNotionalOverIndexing() const {
if (getOpcode() != Instruction::GetElementPtr) return false;
gep_type_iterator GEPI = gep_type_begin(this), E = gep_type_end(this);
User::const_op_iterator OI = std::next(this->op_begin());
// The remaining indices may be compile-time known integers within the bounds
// of the corresponding notional static array types.
for (; GEPI != E; ++GEPI, ++OI) {
if (isa<UndefValue>(*OI))
continue;
auto *CI = dyn_cast<ConstantInt>(*OI);
if (!CI || (GEPI.isBoundedSequential() &&
(CI->getValue().getActiveBits() > 64 ||
CI->getZExtValue() >= GEPI.getSequentialNumElements())))
return false;
}
// All the indices checked out.
return true;
}
bool ConstantExpr::hasIndices() const {
return getOpcode() == Instruction::ExtractValue ||
getOpcode() == Instruction::InsertValue;