[llvm] ed0cdb2 - [Constants] Remove unused isGEPWithNoNotionalOverIndexing() method
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 19 02:43:06 PST 2022
Author: Nikita Popov
Date: 2022-01-19T11:36:40+01:00
New Revision: ed0cdb29397ecd7d03579b846360906081d80aea
URL: https://github.com/llvm/llvm-project/commit/ed0cdb29397ecd7d03579b846360906081d80aea
DIFF: https://github.com/llvm/llvm-project/commit/ed0cdb29397ecd7d03579b846360906081d80aea.diff
LOG: [Constants] Remove unused isGEPWithNoNotionalOverIndexing() method
Since d56b0ad441a34ae6c353c823969397b451f053a6, this method is
no longer used -- and shouldn't be used.
Added:
Modified:
llvm/include/llvm/IR/Constants.h
llvm/lib/IR/Constants.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
index 65d4538616284..fb884912b318b 100644
--- a/llvm/include/llvm/IR/Constants.h
+++ b/llvm/include/llvm/IR/Constants.h
@@ -1196,13 +1196,6 @@ class ConstantExpr : public Constant {
/// 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.
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 8fb17f6163ea1..e031f889caf69 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -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;
More information about the llvm-commits
mailing list