summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-10-13 14:04:21 +0000
committerDaniel Jasper <djasper@google.com>2017-10-13 14:04:21 +0000
commit3344a21236837f9920eca7439656a1127f937862 (patch)
treeb20e3f9322e813469e7916eef940a98eca57180e /llvm/lib/Transforms
parent9a26a7ec331e01fdf2a9438eff10d901420c1c27 (diff)
downloadbcm5719-llvm-3344a21236837f9920eca7439656a1127f937862.tar.gz
bcm5719-llvm-3344a21236837f9920eca7439656a1127f937862.zip
Revert r314923: "Recommit : Use the basic cost if a GEP is not used as addressing mode"
Significantly reduces performancei (~30%) of gipfeli (https://github.com/google/gipfeli) I have not yet managed to reproduce this regression with the open-source version of the benchmark on github, but will work with others to get a reproducer to you later today. llvm-svn: 315680
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/NaryReassociate.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
index 3d5a513e3d3..d0bfe360389 100644
--- a/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/NaryReassociate.cpp
@@ -264,7 +264,7 @@ static bool isGEPFoldable(GetElementPtrInst *GEP,
SmallVector<const Value*, 4> Indices;
for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I)
Indices.push_back(*I);
- return TTI->getGEPCost(cast<GEPOperator>(GEP),
+ return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(),
Indices) == TargetTransformInfo::TCC_Free;
}
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index 3f93eaecc5d..8b8d6590aa6 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -239,7 +239,7 @@ static bool isGEPFoldable(GetElementPtrInst *GEP,
SmallVector<const Value*, 4> Indices;
for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I)
Indices.push_back(*I);
- return TTI->getGEPCost(cast<GEPOperator>(GEP),
+ return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(),
Indices) == TargetTransformInfo::TCC_Free;
}
OpenPOWER on IntegriCloud