[ValueTracking] teach computeKnownBits that a fabs() clears sign bits
[oota-llvm.git] / lib / Analysis / CostModel.cpp
index b529c1a70aa3374ae0d40ff86f90c83872e2dc62..da790d745245cd079d44c6218686e705a8ee04b4 100644 (file)
@@ -383,10 +383,8 @@ 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::GetElementPtr:
+    return TTI->getUserCost(I);
 
   case Instruction::Ret:
   case Instruction::PHI: