@@ -330,10 +330,6 @@ extern cl::opt<std::string> ViewBlockFreqFuncName;
330330extern cl::opt<InstrProfCorrelator::ProfCorrelatorKind> ProfileCorrelate;
331331} // namespace llvm
332332
333- static cl::opt<bool >
334- PGOOldCFGHashing (" pgo-instr-old-cfg-hashing" , cl::init(false ), cl::Hidden,
335- cl::desc(" Use the old CFG function hashing" ));
336-
337333// Return a string describing the branch condition that can be
338334// used in static branch probability heuristics:
339335static std::string getBranchCondString (Instruction *TI) {
@@ -635,34 +631,25 @@ void FuncPGOInstrumentation<Edge, BBInfo>::computeCFGHash() {
635631 JC.update (Indexes);
636632
637633 JamCRC JCH;
638- if (PGOOldCFGHashing) {
639- // Hash format for context sensitive profile. Reserve 4 bits for other
640- // information.
641- FunctionHash = (uint64_t )SIVisitor.getNumOfSelectInsts () << 56 |
642- (uint64_t )ValueSites[IPVK_IndirectCallTarget].size () << 48 |
643- // (uint64_t)ValueSites[IPVK_MemOPSize].size() << 40 |
644- (uint64_t )MST.numEdges () << 32 | JC.getCRC ();
634+ // The higher 32 bits.
635+ auto updateJCH = [&JCH](uint64_t Num) {
636+ uint8_t Data[8 ];
637+ support::endian::write64le (Data, Num);
638+ JCH.update (Data);
639+ };
640+ updateJCH ((uint64_t )SIVisitor.getNumOfSelectInsts ());
641+ updateJCH ((uint64_t )ValueSites[IPVK_IndirectCallTarget].size ());
642+ updateJCH ((uint64_t )ValueSites[IPVK_MemOPSize].size ());
643+ if (BCI) {
644+ updateJCH (BCI->getInstrumentedBlocksHash ());
645645 } else {
646- // The higher 32 bits.
647- auto updateJCH = [&JCH](uint64_t Num) {
648- uint8_t Data[8 ];
649- support::endian::write64le (Data, Num);
650- JCH.update (Data);
651- };
652- updateJCH ((uint64_t )SIVisitor.getNumOfSelectInsts ());
653- updateJCH ((uint64_t )ValueSites[IPVK_IndirectCallTarget].size ());
654- updateJCH ((uint64_t )ValueSites[IPVK_MemOPSize].size ());
655- if (BCI) {
656- updateJCH (BCI->getInstrumentedBlocksHash ());
657- } else {
658- updateJCH ((uint64_t )MST.numEdges ());
659- }
660-
661- // Hash format for context sensitive profile. Reserve 4 bits for other
662- // information.
663- FunctionHash = (((uint64_t )JCH.getCRC ()) << 28 ) + JC.getCRC ();
646+ updateJCH ((uint64_t )MST.numEdges ());
664647 }
665648
649+ // Hash format for context sensitive profile. Reserve 4 bits for other
650+ // information.
651+ FunctionHash = (((uint64_t )JCH.getCRC ()) << 28 ) + JC.getCRC ();
652+
666653 // Reserve bit 60-63 for other information purpose.
667654 FunctionHash &= 0x0FFFFFFFFFFFFFFF ;
668655 if (IsCS)
@@ -672,10 +659,8 @@ void FuncPGOInstrumentation<Edge, BBInfo>::computeCFGHash() {
672659 << " , Selects = " << SIVisitor.getNumOfSelectInsts ()
673660 << " , Edges = " << MST.numEdges () << " , ICSites = "
674661 << ValueSites[IPVK_IndirectCallTarget].size ());
675- if (!PGOOldCFGHashing) {
676- LLVM_DEBUG (dbgs () << " , Memops = " << ValueSites[IPVK_MemOPSize].size ()
677- << " , High32 CRC = " << JCH.getCRC ());
678- }
662+ LLVM_DEBUG (dbgs () << " , Memops = " << ValueSites[IPVK_MemOPSize].size ()
663+ << " , High32 CRC = " << JCH.getCRC ());
679664 LLVM_DEBUG (dbgs () << " , Hash = " << FunctionHash << " \n " ;);
680665
681666 if (PGOTraceFuncHash != " -" && F.getName ().contains (PGOTraceFuncHash))
0 commit comments