@@ -1342,51 +1342,6 @@ MDNode *mayHaveValueProfileOfKind(const Instruction &Inst,
1342
1342
return MD;
1343
1343
}
1344
1344
1345
- static bool getValueProfDataFromInstImpl (const MDNode *const MD,
1346
- const uint32_t MaxNumDataWant,
1347
- InstrProfValueData ValueData[],
1348
- uint32_t &ActualNumValueData,
1349
- uint64_t &TotalC, bool GetNoICPValue) {
1350
- const unsigned NOps = MD->getNumOperands ();
1351
- // Get total count
1352
- ConstantInt *TotalCInt = mdconst::dyn_extract<ConstantInt>(MD->getOperand (2 ));
1353
- if (!TotalCInt)
1354
- return false ;
1355
- TotalC = TotalCInt->getZExtValue ();
1356
- ActualNumValueData = 0 ;
1357
-
1358
- for (unsigned I = 3 ; I < NOps; I += 2 ) {
1359
- if (ActualNumValueData >= MaxNumDataWant)
1360
- break ;
1361
- ConstantInt *Value = mdconst::dyn_extract<ConstantInt>(MD->getOperand (I));
1362
- ConstantInt *Count =
1363
- mdconst::dyn_extract<ConstantInt>(MD->getOperand (I + 1 ));
1364
- if (!Value || !Count)
1365
- return false ;
1366
- uint64_t CntValue = Count->getZExtValue ();
1367
- if (!GetNoICPValue && (CntValue == NOMORE_ICP_MAGICNUM))
1368
- continue ;
1369
- ValueData[ActualNumValueData].Value = Value->getZExtValue ();
1370
- ValueData[ActualNumValueData].Count = CntValue;
1371
- ActualNumValueData++;
1372
- }
1373
- return true ;
1374
- }
1375
-
1376
- std::unique_ptr<InstrProfValueData[]>
1377
- getValueProfDataFromInst (const Instruction &Inst, InstrProfValueKind ValueKind,
1378
- uint32_t MaxNumValueData, uint32_t &ActualNumValueData,
1379
- uint64_t &TotalC, bool GetNoICPValue) {
1380
- MDNode *MD = mayHaveValueProfileOfKind (Inst, ValueKind);
1381
- if (!MD)
1382
- return nullptr ;
1383
- auto ValueDataArray = std::make_unique<InstrProfValueData[]>(MaxNumValueData);
1384
- if (!getValueProfDataFromInstImpl (MD, MaxNumValueData, ValueDataArray.get (),
1385
- ActualNumValueData, TotalC, GetNoICPValue))
1386
- return nullptr ;
1387
- return ValueDataArray;
1388
- }
1389
-
1390
1345
SmallVector<InstrProfValueData, 4 >
1391
1346
getValueProfDataFromInst (const Instruction &Inst, InstrProfValueKind ValueKind,
1392
1347
uint32_t MaxNumValueData, uint64_t &TotalC,
0 commit comments