From a92412ccb2b51f03a9bf6ed14d727405f81e2a30 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Wed, 22 Jan 2014 20:30:16 +0000 Subject: [PATCH] Get right cost for addrspacecast in cost model llvm-svn: 199833 --- lib/Analysis/CostModel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/CostModel.cpp b/lib/Analysis/CostModel.cpp index f9432584691..543977a376f 100644 --- a/lib/Analysis/CostModel.cpp +++ b/lib/Analysis/CostModel.cpp @@ -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); }