Skip to content

Commit ed0cdb2

Browse files
committed
[Constants] Remove unused isGEPWithNoNotionalOverIndexing() method
Since d56b0ad, this method is no longer used -- and shouldn't be used.
1 parent d56b0ad commit ed0cdb2

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

llvm/include/llvm/IR/Constants.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,13 +1196,6 @@ class ConstantExpr : public Constant {
11961196
/// and the getIndices() method may be used.
11971197
bool hasIndices() const;
11981198

1199-
/// Return true if this is a getelementptr expression and all
1200-
/// the index operands are compile-time known integers within the
1201-
/// corresponding notional static array extents. Note that this is
1202-
/// not equivalant to, a subset of, or a superset of the "inbounds"
1203-
/// property.
1204-
bool isGEPWithNoNotionalOverIndexing() const;
1205-
12061199
/// Select constant expr
12071200
///
12081201
/// \param OnlyIfReducedTy see \a getWithOperands() docs.

llvm/lib/IR/Constants.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,28 +1495,6 @@ bool ConstantExpr::isCompare() const {
14951495
return getOpcode() == Instruction::ICmp || getOpcode() == Instruction::FCmp;
14961496
}
14971497

1498-
bool ConstantExpr::isGEPWithNoNotionalOverIndexing() const {
1499-
if (getOpcode() != Instruction::GetElementPtr) return false;
1500-
1501-
gep_type_iterator GEPI = gep_type_begin(this), E = gep_type_end(this);
1502-
User::const_op_iterator OI = std::next(this->op_begin());
1503-
1504-
// The remaining indices may be compile-time known integers within the bounds
1505-
// of the corresponding notional static array types.
1506-
for (; GEPI != E; ++GEPI, ++OI) {
1507-
if (isa<UndefValue>(*OI))
1508-
continue;
1509-
auto *CI = dyn_cast<ConstantInt>(*OI);
1510-
if (!CI || (GEPI.isBoundedSequential() &&
1511-
(CI->getValue().getActiveBits() > 64 ||
1512-
CI->getZExtValue() >= GEPI.getSequentialNumElements())))
1513-
return false;
1514-
}
1515-
1516-
// All the indices checked out.
1517-
return true;
1518-
}
1519-
15201498
bool ConstantExpr::hasIndices() const {
15211499
return getOpcode() == Instruction::ExtractValue ||
15221500
getOpcode() == Instruction::InsertValue;

0 commit comments

Comments
 (0)