[llvm] r199833 - Get right cost for addrspacecast in cost model

Matt Arsenault Matthew.Arsenault at amd.com
Wed Jan 22 12:30:17 PST 2014


Author: arsenm
Date: Wed Jan 22 14:30:16 2014
New Revision: 199833

URL: http://llvm.org/viewvc/llvm-project?rev=199833&view=rev
Log:
Get right cost for addrspacecast in cost model

Modified:
    llvm/trunk/lib/Analysis/CostModel.cpp

Modified: llvm/trunk/lib/Analysis/CostModel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/CostModel.cpp?rev=199833&r1=199832&r2=199833&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/CostModel.cpp (original)
+++ llvm/trunk/lib/Analysis/CostModel.cpp Wed Jan 22 14:30:16 2014
@@ -439,7 +439,8 @@ unsigned CostModelAnalysis::getInstructi
   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);
   }





More information about the llvm-commits mailing list