IR: Split Metadata from Value
[oota-llvm.git] / lib / CodeGen / CodeGenPrepare.cpp
index 96e2d3d74deeffe5d78c930428ed79cdbcdb19c3..577c048ba60e20bae23efb98c88bee68fb828a27 100644 (file)
@@ -3810,8 +3810,10 @@ static bool extractBranchMetadata(BranchInst *BI,
   if (!ProfileData || ProfileData->getNumOperands() != 3)
     return false;
 
-  const auto *CITrue = dyn_cast<ConstantInt>(ProfileData->getOperand(1));
-  const auto *CIFalse = dyn_cast<ConstantInt>(ProfileData->getOperand(2));
+  const auto *CITrue =
+      mdconst::dyn_extract<ConstantInt>(ProfileData->getOperand(1));
+  const auto *CIFalse =
+      mdconst::dyn_extract<ConstantInt>(ProfileData->getOperand(2));
   if (!CITrue || !CIFalse)
     return false;