[MLGO] Fix build break as result of new InstructionCost (D91174)
authorMircea Trofin <mtrofin@google.com>
Sat, 12 Dec 2020 04:28:39 +0000 (20:28 -0800)
committerMircea Trofin <mtrofin@google.com>
Sat, 12 Dec 2020 04:28:39 +0000 (20:28 -0800)
llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp

index 2213cd8..3c90e82 100644 (file)
@@ -130,8 +130,8 @@ size_t getSize(Function &F, TargetTransformInfo &TTI) {
   size_t Ret = 0;
   for (const auto &BB : F)
     for (const auto &I : BB)
-      Ret += TTI.getInstructionCost(
-          &I, TargetTransformInfo::TargetCostKind::TCK_CodeSize);
+      Ret += *(TTI.getInstructionCost(
+          &I, TargetTransformInfo::TargetCostKind::TCK_CodeSize).getValue());
   return Ret;
 }