aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/InlineCost.cpp
diff options
context:
space:
mode:
authorKirill Naumov <knaumov@azul.com>2020-06-17 14:02:18 +0000
committerKirill Naumov <knaumov@azul.com>2020-06-17 14:02:18 +0000
commit39a4505e34387d9e9165127a4f2fd64223f1d833 (patch)
treeb0fb90b7c6c463314dab87028c7de704138b4435 /llvm/lib/Analysis/InlineCost.cpp
parent34fba68d80051e3c53e7843157c036f6d511ae03 (diff)
downloadllvm-39a4505e34387d9e9165127a4f2fd64223f1d833.zip
llvm-39a4505e34387d9e9165127a4f2fd64223f1d833.tar.gz
llvm-39a4505e34387d9e9165127a4f2fd64223f1d833.tar.bz2
Revert "[InlineCost] GetElementPtr with constant operands"
This reverts commit 34fba68d80051e3c53e7843157c036f6d511ae03.
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r--llvm/lib/Analysis/InlineCost.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 38e7160..0afc88d 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -110,10 +110,6 @@ static cl::opt<bool> InlineCallerSupersetNoBuiltin(
cl::desc("Allow inlining when caller has a superset of callee's nobuiltin "
"attributes."));
-static cl::opt<bool> DisableGEPConstOperand(
- "disable-gep-const-evaluation", cl::Hidden, cl::init(false),
- cl::desc("Disables evaluation of GetElementPtr with constant operands"));
-
namespace {
class InlineCostCallAnalyzer;
@@ -1007,16 +1003,6 @@ bool CallAnalyzer::visitGetElementPtr(GetElementPtrInst &I) {
return true;
};
- if (!DisableGEPConstOperand)
- if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) {
- SmallVector<Constant *, 2> Indices;
- for (unsigned int Index = 1 ; Index < COps.size() ; ++Index)
- Indices.push_back(COps[Index]);
- return ConstantExpr::getGetElementPtr(I.getSourceElementType(), COps[0],
- Indices, I.isInBounds());
- }))
- return true;
-
if ((I.isInBounds() && canFoldInboundsGEP(I)) || IsGEPOffsetConstant(I)) {
if (SROAArg)
SROAArgValues[&I] = SROAArg;