Get right cost for addrspacecast in cost model
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 22 Jan 2014 20:30:16 +0000 (20:30 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 22 Jan 2014 20:30:16 +0000 (20:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199833 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CostModel.cpp

index f9432584691d1c5b0236587d867451d3b5ac1a19..543977a376f9a93342fbde161a84f8cacd2c89c3 100644 (file)
@@ -439,7 +439,8 @@ unsigned CostModelAnalysis::getInstructionCost(const Instruction *I) const {
   case Instruction::UIToFP:
   case Instruction::Trunc:
   case Instruction::FPTrunc:
-  case Instruction::BitCast: {
+  case Instruction::BitCast:
+  case Instruction::AddrSpaceCast: {
     Type *SrcTy = I->getOperand(0)->getType();
     return TTI->getCastInstrCost(I->getOpcode(), I->getType(), SrcTy);
   }