IR: Split Metadata from Value
[oota-llvm.git] / lib / Analysis / BranchProbabilityInfo.cpp
index bbd87505952216d88b8cad5f042b36e03ecf7288..2b39d47e5fafad801d674dab3c3da466c78d4f40 100644 (file)
@@ -196,7 +196,8 @@ bool BranchProbabilityInfo::calcMetadataWeights(BasicBlock *BB) {
   SmallVector<uint32_t, 2> Weights;
   Weights.reserve(TI->getNumSuccessors());
   for (unsigned i = 1, e = WeightsNode->getNumOperands(); i != e; ++i) {
-    ConstantInt *Weight = dyn_cast<ConstantInt>(WeightsNode->getOperand(i));
+    ConstantInt *Weight =
+        mdconst::dyn_extract<ConstantInt>(WeightsNode->getOperand(i));
     if (!Weight)
       return false;
     Weights.push_back(