aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/CostModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/CostModel.cpp')
-rw-r--r--lib/Analysis/CostModel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/CostModel.cpp b/lib/Analysis/CostModel.cpp
index 1784512..8435e39 100644
--- a/lib/Analysis/CostModel.cpp
+++ b/lib/Analysis/CostModel.cpp
@@ -85,6 +85,11 @@ unsigned CostModelAnalysis::getInstructionCost(const Instruction *I) const {
return -1;
switch (I->getOpcode()) {
+ case Instruction::GetElementPtr:{
+ Type *ValTy = I->getOperand(0)->getType()->getPointerElementType();
+ return TTI->getAddressComputationCost(ValTy);
+ }
+
case Instruction::Ret:
case Instruction::PHI:
case Instruction::Br: {