summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJingyue Wu <jingyue@google.com>2015-07-26 18:30:13 +0000
committerJingyue Wu <jingyue@google.com>2015-07-26 18:30:13 +0000
commit84879b71a93fe2059313885311422bcb779702f8 (patch)
treeba5d90f1d9e23672d6e8bdb4708a5675ac110b30 /llvm/lib
parentbf485f059cccef6b6ff90aa23ad8523688c8b189 (diff)
downloadbcm5719-llvm-84879b71a93fe2059313885311422bcb779702f8.tar.gz
bcm5719-llvm-84879b71a93fe2059313885311422bcb779702f8.zip
Revert r243250
breaks tests llvm-svn: 243251
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/CostModel.cpp6
-rw-r--r--llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp1
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/CostModel.cpp b/llvm/lib/Analysis/CostModel.cpp
index da790d74524..b529c1a70aa 100644
--- a/llvm/lib/Analysis/CostModel.cpp
+++ b/llvm/lib/Analysis/CostModel.cpp
@@ -383,8 +383,10 @@ unsigned CostModelAnalysis::getInstructionCost(const Instruction *I) const {
return -1;
switch (I->getOpcode()) {
- case Instruction::GetElementPtr:
- return TTI->getUserCost(I);
+ case Instruction::GetElementPtr:{
+ Type *ValTy = I->getOperand(0)->getType()->getPointerElementType();
+ return TTI->getAddressComputationCost(ValTy);
+ }
case Instruction::Ret:
case Instruction::PHI:
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index b2b886c4f11..6d9d417ef94 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -234,7 +234,6 @@ bool StraightLineStrengthReduce::isBasisFor(const Candidate &Basis,
Basis.CandidateKind == C.CandidateKind);
}
-// TODO: use TTI->getGEPCost.
static bool isGEPFoldable(GetElementPtrInst *GEP,
const TargetTransformInfo *TTI,
const DataLayout *DL) {
OpenPOWER on IntegriCloud