-------------------------------------------------------------------------------- I1 cache: 65536 B, 64 B, 4-way associative D1 cache: 32768 B, 64 B, 8-way associative LL cache: 67108864 B, 64 B, 64-way associative Command: /usr/home/liquid/.rustup/toolchains/w-profiling/bin/rustc --crate-name wasm_bindgen_backend --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=eab203eb0bc2ffe7 -C extra-filename=-eab203eb0bc2ffe7 --out-dir /usr/home/liquid/tmp/.tmp02duG6/target/release/deps -L dependency=/usr/home/liquid/tmp/.tmp02duG6/target/release/deps --extern bumpalo=/usr/home/liquid/tmp/.tmp02duG6/target/release/deps/libbumpalo-e86bbc7d0104615d.rmeta --extern lazy_static=/usr/home/liquid/tmp/.tmp02duG6/target/release/deps/liblazy_static-c9b30744bdc7504c.rmeta --extern log=/usr/home/liquid/tmp/.tmp02duG6/target/release/deps/liblog-66ade8caaf0ded5f.rmeta --extern proc_macro2=/usr/home/liquid/tmp/.tmp02duG6/target/release/deps/libproc_macro2-4e3d2e7aa03cf1cd.rmeta --extern quote=/usr/home/liquid/tmp/.tmp02duG6/target/release/deps/libquote-89fea366a8a699dc.rmeta --extern syn=/usr/home/liquid/tmp/.tmp02duG6/target/release/deps/libsyn-d946e5b9bbb04fe6.rmeta --extern wasm_bindgen_shared=/usr/home/liquid/tmp/.tmp02duG6/target/release/deps/libwasm_bindgen_shared-da576ae45b13040f.rmeta -Adeprecated -Aunknown-lints -Zincremental-verify-ich Data file: results/cgout-w-profiling-wasm-bindgen-backend-0.2.79-Opt-Full Events recorded: Ir Events shown: Ir Event sort order: Ir Thresholds: 0.1 Include dirs: User annotated: Auto-annotation: on -------------------------------------------------------------------------------- Ir -------------------------------------------------------------------------------- 63,256,874,808 (100.0%) PROGRAM TOTALS -------------------------------------------------------------------------------- Ir file:function -------------------------------------------------------------------------------- 1,648,186,410 ( 2.61%) ./malloc/malloc.c:_int_free 1,637,430,366 ( 2.59%) ./malloc/malloc.c:_int_malloc 1,435,001,561 ( 2.27%) ???:llvm::InstCombinerImpl::run() 1,069,096,535 ( 1.69%) ./malloc/malloc.c:malloc 1,052,767,177 ( 1.66%) ???:combineInstructionsOverFunction(llvm::Function&, llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::OptimizationRemarkEmitter&, llvm::BlockFrequencyInfo*, llvm::ProfileSummaryInfo*, unsigned int, llvm::LoopInfo*) 972,269,083 ( 1.54%) ???:llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOpt::Level) 699,115,717 ( 1.11%) ???:llvm::DomTreeBuilder::SemiNCAInfo >::CalculateFromScratch(llvm::DominatorTreeBase&, llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpdateInfo*) 541,417,823 ( 0.86%) ???:SimplifyICmpInst(unsigned int, llvm::Value*, llvm::Value*, llvm::SimplifyQuery const&, unsigned int) [clone .llvm.1619516508949622737] 539,923,385 ( 0.85%) ???:llvm::ValueHandleBase::AddToUseList() 537,121,104 ( 0.85%) ./malloc/malloc.c:free 527,626,132 ( 0.83%) ./string/../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:__memset_avx2_erms 516,648,097 ( 0.82%) ???:llvm::removeUnreachableBlocks(llvm::Function&, llvm::DomTreeUpdater*, llvm::MemorySSAUpdater*) 507,567,882 ( 0.80%) ???:llvm::DomTreeBuilder::SemiNCAInfo >::runSemiNCA(llvm::DominatorTreeBase&, unsigned int) 493,760,574 ( 0.78%) ???:llvm::TargetLibraryInfoImpl::getLibFunc(llvm::Function const&, llvm::LibFunc&) const 485,099,947 ( 0.77%) ???:llvm::AnalysisManager::invalidate(llvm::Function&, llvm::PreservedAnalyses const&) 457,578,374 ( 0.72%) ???:computeKnownBits(llvm::Value const*, llvm::KnownBits&, unsigned int, (anonymous namespace)::Query const&) [clone .llvm.15619146473165121143] 437,704,582 ( 0.69%) ???:llvm::LiveVariables::runOnBlock(llvm::MachineBasicBlock*, unsigned int) 433,850,974 ( 0.69%) ./string/../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S:__memcmp_avx2_movbe 433,490,748 ( 0.69%) ???:llvm::FPPassManager::runOnFunction(llvm::Function&) 429,979,929 ( 0.68%) ???:llvm::AnalysisManager::getResultImpl(llvm::AnalysisKey*, llvm::Function&) 402,879,605 ( 0.64%) ???:llvm::FindFunctionBackedges(llvm::Function const&, llvm::SmallVectorImpl >&) 387,502,574 ( 0.61%) ???:llvm::ScalarEvolution::getAddExpr(llvm::SmallVectorImpl&, llvm::SCEV::NoWrapFlags, unsigned int) 371,383,009 ( 0.59%) ???:(anonymous namespace)::LazyValueInfoImpl::solve() [clone .llvm.4316243980339171764] 370,754,590 ( 0.59%) ???:llvm::DataLayout::getAlignment(llvm::Type*, bool) const 356,485,859 ( 0.56%) ???:llvm::simplifyCFG(llvm::BasicBlock*, llvm::TargetTransformInfo const&, llvm::DomTreeUpdater*, llvm::SimplifyCFGOptions const&, llvm::ArrayRef) 352,509,657 ( 0.56%) ???:llvm::SimplifyInstruction(llvm::Instruction*, llvm::SimplifyQuery const&, llvm::OptimizationRemarkEmitter*) 350,282,166 ( 0.55%) ???:bool llvm::DenseMapBase*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::detail::DenseMapPair<(anonymous namespace)::SimpleValue, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*> >, (anonymous namespace)::SimpleValue, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*, llvm::DenseMapInfo<(anonymous namespace)::SimpleValue>, llvm::detail::DenseMapPair<(anonymous namespace)::SimpleValue, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*> >::LookupBucketFor<(anonymous namespace)::SimpleValue>((anonymous namespace)::SimpleValue const&, llvm::detail::DenseMapPair<(anonymous namespace)::SimpleValue, llvm::ScopedHashTableVal<(anonymous namespace)::SimpleValue, llvm::Value*>*> const*&) const 349,259,564 ( 0.55%) ???:computeKnownBits(llvm::Value const*, llvm::APInt const&, llvm::KnownBits&, unsigned int, (anonymous namespace)::Query const&) 341,371,453 ( 0.54%) ???:llvm::DataLayout::getTypeSizeInBits(llvm::Type*) const 331,926,443 ( 0.52%) ???:computeKnownBitsFromOperator(llvm::Operator const*, llvm::APInt const&, llvm::KnownBits&, unsigned int, (anonymous namespace)::Query const&) 323,811,272 ( 0.51%) ???:llvm::isNonEscapingLocalObject(llvm::Value const*, llvm::SmallDenseMap, llvm::detail::DenseMapPair >*) 305,099,868 ( 0.48%) ???:llvm::BitstreamCursor::readRecord(unsigned int, llvm::SmallVectorImpl&, llvm::StringRef*) 304,098,584 ( 0.48%) ???:llvm::MemorySSA::buildMemorySSA(llvm::BatchAAResults&) 299,604,766 ( 0.47%) ???:llvm::LoopBase::verifyLoop() const 298,249,525 ( 0.47%) ???:runCVP(llvm::Module&) [clone .llvm.11785992503873176614] 282,120,084 ( 0.45%) ???:llvm::InstCombinerImpl::visitICmpInst(llvm::ICmpInst&) 276,445,788 ( 0.44%) ???:llvm::LiveIntervals::HMEditor::updateAllRanges(llvm::MachineInstr*) 275,104,922 ( 0.43%) ???:(anonymous namespace)::MachineCopyPropagation::runOnMachineFunction(llvm::MachineFunction&) 263,542,636 ( 0.42%) ./malloc/malloc.c:malloc_consolidate 261,114,880 ( 0.41%) ./string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms 259,786,991 ( 0.41%) ???:(anonymous namespace)::LazyValueInfoImpl::getEdgeValue(llvm::Value*, llvm::BasicBlock*, llvm::BasicBlock*, llvm::Instruction*) [clone .llvm.4316243980339171764] 258,152,749 ( 0.41%) ???:llvm::GVN::processBlock(llvm::BasicBlock*) 254,347,357 ( 0.40%) ???:(anonymous namespace)::CallAnalyzer::analyze() 254,032,461 ( 0.40%) ???:(anonymous namespace)::DeadMachineInstructionElim::eliminateDeadMI(llvm::MachineFunction&) 248,013,961 ( 0.39%) ???:llvm::ScalarEvolution::getMulExpr(llvm::SmallVectorImpl&, llvm::SCEV::NoWrapFlags, unsigned int) 240,950,507 ( 0.38%) ???:llvm::PopulateLoopsDFS::traverse(llvm::BasicBlock*) 239,735,012 ( 0.38%) ???:llvm::LoopInfoBase::analyze(llvm::DominatorTreeBase const&) 238,723,488 ( 0.38%) ???:llvm::BasicAAResult::alias(llvm::MemoryLocation const&, llvm::MemoryLocation const&, llvm::AAQueryInfo&) 238,590,315 ( 0.38%) ???:llvm::InstCombinerImpl::visitCallInst(llvm::CallInst&) 237,866,023 ( 0.38%) ???:llvm::IDFCalculatorBase::calculate(llvm::SmallVectorImpl&) 235,601,213 ( 0.37%) ???:isKnownNonZero(llvm::Value const*, llvm::APInt const&, unsigned int, (anonymous namespace)::Query const&) [clone .llvm.15619146473165121143] 233,686,723 ( 0.37%) ???:llvm::SmallPtrSetImplBase::insert_imp_big(void const*) 232,343,712 ( 0.37%) ???:llvm::DomTreeBuilder::SemiNCAInfo >::FindRoots(llvm::DominatorTreeBase const&, llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpdateInfo*) 229,932,944 ( 0.36%) ???:computeKnownBitsFromAssume(llvm::Value const*, llvm::KnownBits&, unsigned int, (anonymous namespace)::Query const&) 221,066,148 ( 0.35%) ???:llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) 216,443,275 ( 0.34%) ???:llvm::SimplifyGEPInst(llvm::Type*, llvm::ArrayRef, llvm::SimplifyQuery const&) 205,713,550 ( 0.33%) ???:llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*) 203,787,892 ( 0.32%) ???:llvm::ScalarEvolution::getSCEV(llvm::Value*) 203,281,962 ( 0.32%) ???:llvm::LiveVariables::HandleRegMask(llvm::MachineOperand const&) 201,342,399 ( 0.32%) ???:llvm::ScalarEvolution::getRangeRef(llvm::SCEV const*, llvm::ScalarEvolution::RangeSignHint) 198,827,091 ( 0.31%) ???:llvm::Value::stripAndAccumulateConstantOffsets(llvm::DataLayout const&, llvm::APInt&, bool, llvm::function_ref) const 197,590,726 ( 0.31%) ???:llvm::AttributeList::addAttributes(llvm::LLVMContext&, unsigned int, llvm::AttrBuilder const&) const 192,709,901 ( 0.30%) ???:llvm::DomTreeBuilder::SemiNCAInfo >::CalculateFromScratch(llvm::DominatorTreeBase&, llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpdateInfo*) 189,566,961 ( 0.30%) ???:llvm::InstCombinerImpl::visitLoadInst(llvm::LoadInst&) 189,141,469 ( 0.30%) ???:llvm::MemoryDependenceResults::getNonLocalPointerDepFromBB(llvm::Instruction*, llvm::PHITransAddr const&, llvm::MemoryLocation const&, bool, llvm::BasicBlock*, llvm::SmallVectorImpl&, llvm::DenseMap, llvm::detail::DenseMapPair >&, bool, bool) 188,477,311 ( 0.30%) /tmp/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/../../../../gcc-5.5.0/libstdc++-v3/libsupc++/new_op.cc:operator new(unsigned long) 179,049,228 ( 0.28%) ???:(anonymous namespace)::EarlyCSE::run() [clone .llvm.7062997131228810369] 177,055,386 ( 0.28%) ???:llvm::JumpThreadingPass::processBlock(llvm::BasicBlock*) 176,904,258 ( 0.28%) ???:llvm::DomTreeBuilder::SemiNCAInfo >::runSemiNCA(llvm::DominatorTreeBase&, unsigned int) 174,784,339 ( 0.28%) ???:llvm::Type::isSizedDerivedType(llvm::SmallPtrSetImpl*) const 174,564,887 ( 0.28%) ???:(anonymous namespace)::AggressiveDeadCodeElimination::performDeadCodeElimination() 174,542,248 ( 0.28%) ???:llvm::BlockFrequencyInfoImpl::initializeRPOT() 174,289,509 ( 0.28%) ???:llvm::TargetLoweringBase::getTypeConversion(llvm::LLVMContext&, llvm::EVT) const 174,252,124 ( 0.28%) ???:llvm::ScheduleDAGSDNodes::BuildSchedUnits() 172,155,791 ( 0.27%) ???:llvm::InlineFunction(llvm::CallBase&, llvm::InlineFunctionInfo&, llvm::AAResults*, bool, llvm::Function*) 171,206,274 ( 0.27%) ???:llvm::MemorySSA::OptimizeUses::optimizeUses() 169,755,343 ( 0.27%) ???:llvm::BlockFrequencyInfoImpl::tryToComputeMassInFunction() 168,973,208 ( 0.27%) ./malloc/malloc.c:unlink_chunk.constprop.0 167,304,129 ( 0.26%) ???:(anonymous namespace)::SimplifyCFGOpt::simplifyCondBranch(llvm::BranchInst*, llvm::IRBuilder&) 165,453,170 ( 0.26%) ???:llvm::LivePhysRegs::stepBackward(llvm::MachineInstr const&) 159,251,643 ( 0.25%) ???:llvm::MachineInstr::addOperand(llvm::MachineFunction&, llvm::MachineOperand const&) 156,961,822 ( 0.25%) ???:(anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) 152,809,735 ( 0.24%) ???:llvm::LoopBase::getExitBlocks(llvm::SmallVectorImpl&) const 147,761,328 ( 0.23%) ???:std::back_insert_iterator > > std::__copy_move_a2, false, llvm::GraphTraits >, std::back_insert_iterator > > >(llvm::po_iterator, false, llvm::GraphTraits >, llvm::po_iterator, false, llvm::GraphTraits >, std::back_insert_iterator > >) 142,916,177 ( 0.23%) ???:std::back_insert_iterator > > std::__copy_move_a, false, llvm::GraphTraits >, std::back_insert_iterator > > >(llvm::po_iterator, false, llvm::GraphTraits >, llvm::po_iterator, false, llvm::GraphTraits >, std::back_insert_iterator > >) 142,798,749 ( 0.23%) ???:runImpl(llvm::Function&, llvm::LazyValueInfo*, llvm::DominatorTree*, llvm::SimplifyQuery const&) [clone .llvm.16011871802505272439] 141,550,846 ( 0.22%) ???:llvm::InterferenceCache::Entry::update(unsigned int) 140,560,850 ( 0.22%) ???:llvm::BlockFrequencyInfoImplBase::finalizeMetrics() 139,603,065 ( 0.22%) ???:llvm::DemandedBits::isInstructionDead(llvm::Instruction*) 138,019,397 ( 0.22%) ???:llvm::X86InstrInfo::analyzeBranch(llvm::MachineBasicBlock&, llvm::MachineBasicBlock*&, llvm::MachineBasicBlock*&, llvm::SmallVectorImpl&, bool) const 138,005,976 ( 0.22%) ???:(anonymous namespace)::Verifier::visitInstruction(llvm::Instruction&) 134,477,505 ( 0.21%) ???:llvm::ScalarEvolution::getAddRecExpr(llvm::SmallVectorImpl&, llvm::Loop const*, llvm::SCEV::NoWrapFlags) 132,627,833 ( 0.21%) ???:llvm::BranchProbabilityInfo::SccInfo::SccInfo(llvm::Function const&) 131,341,821 ( 0.21%) ???:llvm::ScalarEvolution::forgetValue(llvm::Value*) 131,333,338 ( 0.21%) ???:llvm::ConstantFoldTerminator(llvm::BasicBlock*, bool, llvm::TargetLibraryInfo const*, llvm::DomTreeUpdater*) 127,863,645 ( 0.20%) ???:(anonymous namespace)::eliminateDeadStores(llvm::Function&, llvm::AAResults&, llvm::MemorySSA&, llvm::DominatorTree&, llvm::PostDominatorTree&, llvm::TargetLibraryInfo const&, llvm::LoopInfo const&) [clone .llvm.5769264623867638418] 126,135,420 ( 0.20%) ???:llvm::DomTreeBuilder::SemiNCAInfo >::runSemiNCA(llvm::DominatorTreeBase&, unsigned int) 125,197,923 ( 0.20%) ???:llvm::SSAUpdater::GetValueAtEndOfBlockInternal(llvm::BasicBlock*) 124,896,749 ( 0.20%) ???:llvm::InstCombinerImpl::visitBitCast(llvm::BitCastInst&) 124,506,460 ( 0.20%) ???:llvm::AttributeSetNode::get(llvm::LLVMContext&, llvm::AttrBuilder const&) 124,142,231 ( 0.20%) ???:llvm::LivePhysRegs::addPristines(llvm::MachineFunction const&) 120,704,524 ( 0.19%) ???:llvm::BasicAAResult::getModRefInfo(llvm::CallBase const*, llvm::MemoryLocation const&, llvm::AAQueryInfo&) 120,556,762 ( 0.19%) ???:llvm::DAGTypeLegalizer::run() 118,307,900 ( 0.19%) ./string/../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S:__memset_avx2_unaligned_erms 118,067,573 ( 0.19%) ???:(anonymous namespace)::PruningFunctionCloner::CloneBlock(llvm::BasicBlock const*, llvm::ilist_iterator, false, true>, std::vector >&) 117,376,714 ( 0.19%) ???:llvm::BranchProbabilityInfo::calculate(llvm::Function const&, llvm::LoopInfo const&, llvm::TargetLibraryInfo const*, llvm::DominatorTree*, llvm::PostDominatorTree*) 116,731,495 ( 0.18%) ???:llvm::ReassociatePass::BuildRankMap(llvm::Function&, llvm::ReversePostOrderTraversal >&) 115,572,432 ( 0.18%) ???:llvm::SelectionDAG::Legalize() 115,515,590 ( 0.18%) ???:llvm::TargetTransformInfo::Model::getUserCost(llvm::User const*, llvm::ArrayRef, llvm::TargetTransformInfo::TargetCostKind) 113,895,790 ( 0.18%) ???:llvm::BranchProbabilityInfo::setEdgeProbability(llvm::BasicBlock const*, llvm::SmallVectorImpl const&) 113,680,123 ( 0.18%) ???:llvm::FoldingSetBase::FindNodeOrInsertPos(llvm::FoldingSetNodeID const&, void*&, llvm::FoldingSetBase::FoldingSetInfo const&) 113,362,971 ( 0.18%) ???:(anonymous namespace)::JoinVals::computeAssignment(unsigned int, (anonymous namespace)::JoinVals&) 111,960,931 ( 0.18%) ???:updateCGAndAnalysisManagerForPass(llvm::LazyCallGraph&, llvm::LazyCallGraph::SCC&, llvm::LazyCallGraph::Node&, llvm::AnalysisManager&, llvm::CGSCCUpdateResult&, llvm::AnalysisManager&, bool) [clone .llvm.5426518467876156712] 111,304,961 ( 0.18%) ???:llvm::ReachingDefAnalysis::enterBasicBlock(llvm::MachineBasicBlock*) 110,820,232 ( 0.18%) ???:llvm::BranchProbabilityInfo::calcEstimatedHeuristics(llvm::BasicBlock const*) 110,200,660 ( 0.17%) ???:(anonymous namespace)::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*) [clone .llvm.8386621111310650999] 110,197,650 ( 0.17%) ???:llvm::AttributeList::get(llvm::LLVMContext&, llvm::ArrayRef) 106,188,787 ( 0.17%) ???:(anonymous namespace)::LazyValueInfoImpl::getValueInBlock(llvm::Value*, llvm::BasicBlock*, llvm::Instruction*) [clone .llvm.4316243980339171764] 105,252,814 ( 0.17%) ???:llvm::AAResults::Model::getModRefBehavior(llvm::CallBase const*) 105,155,118 ( 0.17%) ???:llvm::LoopBase::hasDedicatedExits() const 104,913,150 ( 0.17%) ???:llvm::ScalarEvolution::getOrCreateAddExpr(llvm::ArrayRef, llvm::SCEV::NoWrapFlags) 104,212,121 ( 0.16%) ???:llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool, bool, llvm::DenseMap, llvm::detail::DenseMapPair >&) 103,494,591 ( 0.16%) ???:llvm::coro::declaresIntrinsics(llvm::Module const&, std::initializer_list) 103,453,124 ( 0.16%) ???:llvm::BlockFrequencyInfoImplBase::distributeMass(llvm::BlockFrequencyInfoImplBase::BlockNode const&, llvm::BlockFrequencyInfoImplBase::LoopData*, llvm::BlockFrequencyInfoImplBase::Distribution&) 102,797,990 ( 0.16%) ???:llvm::FoldBranchToCommonDest(llvm::BranchInst*, llvm::DomTreeUpdater*, llvm::MemorySSAUpdater*, llvm::TargetTransformInfo const*, unsigned int) 101,977,528 ( 0.16%) ???:llvm::DomTreeBuilder::SemiNCAInfo >::CalculateFromScratch(llvm::DominatorTreeBase&, llvm::DomTreeBuilder::SemiNCAInfo >::BatchUpdateInfo*) 101,252,994 ( 0.16%) ???:(anonymous namespace)::MachineBlockPlacement::buildChain(llvm::MachineBasicBlock const*, (anonymous namespace)::BlockChain&, llvm::SmallSetVector*) 101,070,352 ( 0.16%) ???:llvm::InstCombinerImpl::visitInvokeInst(llvm::InvokeInst&) 99,030,388 ( 0.16%) ???:llvm::ReachingDefAnalysis::traverse() 98,058,442 ( 0.16%) ???:llvm::SelectionDAG::MorphNodeTo(llvm::SDNode*, unsigned int, llvm::SDVTList, llvm::ArrayRef) 97,886,508 ( 0.15%) ???:llvm::Loop::isRecursivelyLCSSAForm(llvm::DominatorTree const&, llvm::LoopInfo const&) const 95,440,972 ( 0.15%) ???:llvm::ConstantRange::makeExactICmpRegion(llvm::CmpInst::Predicate, llvm::APInt const&) 95,339,899 ( 0.15%) ???:llvm::Loop::isLCSSAForm(llvm::DominatorTree const&) const 94,667,062 ( 0.15%) ./string/../sysdeps/x86_64/multiarch/strcmp-avx2.S:__strncmp_avx2 94,135,346 ( 0.15%) ???:llvm::BranchProbabilityInfo::computeEestimateBlockWeight(llvm::Function const&, llvm::DominatorTree*, llvm::PostDominatorTree*) 92,445,015 ( 0.15%) ???:llvm::AAResults::Model::pointsToConstantMemory(llvm::MemoryLocation const&, llvm::AAQueryInfo&, bool) 91,550,520 ( 0.14%) ???:llvm::SelectionDAG::getConstant(llvm::ConstantInt const&, llvm::SDLoc const&, llvm::EVT, bool, bool) 90,337,107 ( 0.14%) ???:llvm::detail::PassModel>, llvm::PreservedAnalyses, llvm::AnalysisManager>::run(llvm::Function&, llvm::AnalysisManager&) 90,119,891 ( 0.14%) ???:llvm::AAResults::getModRefInfo(llvm::Instruction const*, llvm::Optional const&, llvm::AAQueryInfo&) 89,805,016 ( 0.14%) ???:??? 89,040,297 ( 0.14%) ???:llvm::ScalarEvolution::addToLoopUseLists(llvm::SCEV const*) 88,539,921 ( 0.14%) ???:std::back_insert_iterator > > std::__copy_move_a, false, llvm::GraphTraits >, std::back_insert_iterator > > >(llvm::po_iterator, false, llvm::GraphTraits >, llvm::po_iterator, false, llvm::GraphTraits >, std::back_insert_iterator > >) 86,142,188 ( 0.14%) ???:llvm::InstCombinerImpl::SimplifyDemandedUseBits(llvm::Value*, llvm::APInt, llvm::KnownBits&, unsigned int, llvm::Instruction*) 85,784,100 ( 0.14%) ???:llvm::LazyCallGraph::removeDeadFunction(llvm::Function&) 85,437,038 ( 0.14%) ???:llvm::InstCombinerImpl::visitPHINode(llvm::PHINode&) 85,303,884 ( 0.13%) ???:llvm::PMDataManager::verifyPreservedAnalysis(llvm::Pass*) 84,983,164 ( 0.13%) ???:(anonymous namespace)::ScheduleDAGRRList::Schedule() [clone .llvm.6953762222372402862] 83,345,800 ( 0.13%) ???:llvm::MergeBlockIntoPredecessor(llvm::BasicBlock*, llvm::DomTreeUpdater*, llvm::LoopInfo*, llvm::MemorySSAUpdater*, llvm::MemoryDependenceResults*, bool) 82,148,287 ( 0.13%) ???:llvm::SCCPInstVisitor::solve() 81,881,268 ( 0.13%) ???:llvm::X86TargetMachine::getSubtargetImpl(llvm::Function const&) const 81,545,321 ( 0.13%) ???:llvm::SCCPInstVisitor::visitTerminator(llvm::Instruction&) 81,453,861 ( 0.13%) ???:llvm::GVN::performPRE(llvm::Function&) 81,217,909 ( 0.13%) ???:llvm::JumpThreadingPass::runImpl(llvm::Function&, llvm::TargetLibraryInfo*, llvm::LazyValueInfo*, llvm::AAResults*, llvm::DomTreeUpdater*, bool, std::unique_ptr >, std::unique_ptr >) 80,966,850 ( 0.13%) ???:(anonymous namespace)::RegisterCoalescer::joinCopy(llvm::MachineInstr*, bool&) 80,603,573 ( 0.13%) ???:llvm::MachineInstr::isIdenticalTo(llvm::MachineInstr const&, llvm::MachineInstr::MICheckType) const 79,191,650 ( 0.13%) ???:llvm::DomTreeBuilder::SemiNCAInfo >::attachNewSubtree(llvm::DominatorTreeBase&, llvm::DomTreeNodeBase*) 78,663,300 ( 0.12%) ???:llvm::SROA::runOnAlloca(llvm::AllocaInst&) 78,513,590 ( 0.12%) ???:(anonymous namespace)::CVPLatticeFunc::ComputeInstructionState(llvm::Instruction&, llvm::DenseMap, llvm::PointerIntPairInfo > >, (anonymous namespace)::CVPLatticeVal, llvm::DenseMapInfo, llvm::PointerIntPairInfo > > >, llvm::detail::DenseMapPair, llvm::PointerIntPairInfo > >, (anonymous namespace)::CVPLatticeVal> >&, llvm::SparseSolver, llvm::PointerIntPairInfo > >, (anonymous namespace)::CVPLatticeVal, llvm::LatticeKeyInfo, llvm::PointerIntPairInfo > > > >&) 77,965,862 ( 0.12%) ???:(anonymous namespace)::StackColoring::runOnMachineFunction(llvm::MachineFunction&) 77,643,284 ( 0.12%) ???:llvm::DenseMapBase, std::unique_ptr<(anonymous namespace)::LazyValueInfoCache::BlockCacheEntry, std::default_delete<(anonymous namespace)::LazyValueInfoCache::BlockCacheEntry> >, llvm::DenseMapInfo >, llvm::detail::DenseMapPair, std::unique_ptr<(anonymous namespace)::LazyValueInfoCache::BlockCacheEntry, std::default_delete<(anonymous namespace)::LazyValueInfoCache::BlockCacheEntry> > > >, llvm::PoisoningVH, std::unique_ptr<(anonymous namespace)::LazyValueInfoCache::BlockCacheEntry, std::default_delete<(anonymous namespace)::LazyValueInfoCache::BlockCacheEntry> >, llvm::DenseMapInfo >, llvm::detail::DenseMapPair, std::unique_ptr<(anonymous namespace)::LazyValueInfoCache::BlockCacheEntry, std::default_delete<(anonymous namespace)::LazyValueInfoCache::BlockCacheEntry> > > >::destroyAll() [clone .llvm.4316243980339171764] 76,875,039 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_expand/src/mbe/macro_parser.rs:rustc_expand::mbe::macro_parser::parse_tt 75,633,364 ( 0.12%) ???:llvm::DenseMapBase >::InfoRec, llvm::DenseMapInfo, llvm::detail::DenseMapPair >::InfoRec> >, llvm::BasicBlock*, llvm::DomTreeBuilder::SemiNCAInfo >::InfoRec, llvm::DenseMapInfo, llvm::detail::DenseMapPair >::InfoRec> >::moveFromOldBuckets(llvm::detail::DenseMapPair >::InfoRec>*, llvm::detail::DenseMapPair >::InfoRec>*) 75,262,717 ( 0.12%) ???:CompareSCEVComplexity(llvm::EquivalenceClasses&, llvm::EquivalenceClasses&, llvm::LoopInfo const*, llvm::SCEV const*, llvm::SCEV const*, llvm::DominatorTree&, unsigned int) 73,845,936 ( 0.12%) ???:llvm::formLCSSAForInstructions(llvm::SmallVectorImpl&, llvm::DominatorTree const&, llvm::LoopInfo const&, llvm::ScalarEvolution*, llvm::IRBuilderBase&, llvm::SmallVectorImpl*) 73,581,050 ( 0.12%) ???:llvm::PHITransAddr::PHITranslateSubExpr(llvm::Value*, llvm::BasicBlock*, llvm::BasicBlock*, llvm::DominatorTree const*) 73,235,345 ( 0.12%) ???:llvm::ConstantRange::multiply(llvm::ConstantRange const&) const 72,429,271 ( 0.11%) ???:llvm::LiveRangeUpdater::flush() 72,311,723 ( 0.11%) ???:llvm::SelectionDAG::computeKnownBits(llvm::SDValue, llvm::APInt const&, unsigned int) const 71,805,796 ( 0.11%) ???:llvm::LiveRange::extendInBlock(llvm::ArrayRef, llvm::SlotIndex, llvm::SlotIndex) 71,798,566 ( 0.11%) ./string/../sysdeps/x86_64/multiarch/memchr-avx2.S:__memchr_avx2 71,465,501 ( 0.11%) ???:(anonymous namespace)::ClobberWalker::addSearches(llvm::MemoryPhi*, llvm::SmallVectorImpl&, unsigned int) 71,100,709 ( 0.11%) ./string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_sse2_unaligned_erms 68,543,372 ( 0.11%) ???:llvm::ScalarEvolution::forgetSymbolicName(llvm::Instruction*, llvm::SCEV const*) 67,840,413 ( 0.11%) ./stdlib/msort.c:msort_with_tmp.part.0 66,502,602 ( 0.11%) ???:(anonymous namespace)::MachineCSE::runOnMachineFunction(llvm::MachineFunction&) 66,244,935 ( 0.10%) ???:llvm::Instruction::~Instruction() 66,071,560 ( 0.10%) ???:llvm::sinkRegion(llvm::DomTreeNodeBase*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::BlockFrequencyInfo*, llvm::TargetLibraryInfo*, llvm::TargetTransformInfo*, llvm::Loop*, llvm::AliasSetTracker*, llvm::MemorySSAUpdater*, llvm::ICFLoopSafetyInfo*, llvm::SinkAndHoistLICMFlags&, llvm::OptimizationRemarkEmitter*) 65,240,770 ( 0.10%) ???:llvm::hash_value(llvm::MachineOperand const&) 64,982,018 ( 0.10%) ???:llvm::ScalarEvolution::isImpliedCond(llvm::CmpInst::Predicate, llvm::SCEV const*, llvm::SCEV const*, llvm::Value const*, bool, llvm::Instruction const*) 64,932,464 ( 0.10%) ???:unsigned int llvm::DomTreeBuilder::SemiNCAInfo >::runDFS(llvm::MachineBasicBlock*, unsigned int, bool (*)(llvm::MachineBasicBlock*, llvm::MachineBasicBlock*), unsigned int, llvm::DenseMap, llvm::detail::DenseMapPair > const*) 64,519,946 ( 0.10%) ???:(anonymous namespace)::LiveRangeShrink::runOnMachineFunction(llvm::MachineFunction&) 63,572,127 ( 0.10%) ???:llvm::BranchFolder::OptimizeFunction(llvm::MachineFunction&, llvm::TargetInstrInfo const*, llvm::TargetRegisterInfo const*, llvm::MachineLoopInfo*, bool) -------------------------------------------------------------------------------- -- Auto-annotated source: /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_expand/src/mbe/macro_parser.rs -------------------------------------------------------------------------------- Ir -- line 90 ---------------------------------------- . use std::collections::hash_map::Entry::{Occupied, Vacant}; . use std::mem; . use std::ops::{Deref, DerefMut}; . . // To avoid costly uniqueness checks, we require that `MatchSeq` always has a nonempty body. . . /// Either a sequence of token trees or a single one. This is used as the representation of the . /// sequence of tokens that make up a matcher. 731,608 ( 0.00%) #[derive(Clone)] . enum TokenTreeOrTokenTreeSlice<'tt> { 375 ( 0.00%) Tt(TokenTree), 180,098 ( 0.00%) TtSeq(&'tt [TokenTree]), . } . . impl<'tt> TokenTreeOrTokenTreeSlice<'tt> { . /// Returns the number of constituent top-level token trees of `self` (top-level in that it . /// will not recursively descend into subtrees). . fn len(&self) -> usize { 3,729,084 ( 0.01%) match *self { 832,428 ( 0.00%) TtSeq(ref v) => v.len(), . Tt(ref tt) => tt.len(), . } . } . . /// The `index`-th token tree of `self`. . fn get_tt(&self, index: usize) -> TokenTree { 804,088 ( 0.00%) match *self { 2,576,856 ( 0.00%) TtSeq(ref v) => v[index].clone(), 903,900 ( 0.00%) Tt(ref tt) => tt.get_tt(index), . } . } . } . . /// An unzipping of `TokenTree`s... see the `stack` field of `MatcherPos`. . /// . /// This is used by `inner_parse_loop` to keep track of delimited submatchers that we have . /// descended into. 113,588 ( 0.00%) #[derive(Clone)] . struct MatcherTtFrame<'tt> { . /// The "parent" matcher that we are descending into. . elts: TokenTreeOrTokenTreeSlice<'tt>, . /// The position of the "dot" in `elts` at the time we descended. 56,794 ( 0.00%) idx: usize, . } . . type NamedMatchVec = SmallVec<[NamedMatch; 4]>; . . /// Represents a single "position" (aka "matcher position", aka "item"), as . /// described in the module documentation. . /// . /// Here: -- line 140 ---------------------------------------- -- line 147 ---------------------------------------- . /// position refers to. . /// . /// It is important to distinguish these two lifetimes because we have a . /// `SmallVec>` below, and the destructor of . /// that is considered to possibly access the data from its elements (it lacks . /// a `#[may_dangle]` attribute). As a result, the compiler needs to know that . /// all the elements in that `SmallVec` strictly outlive the root stack slot . /// lifetime. By separating `'tt` from `'root`, we can show that. 3,137,720 ( 0.00%) #[derive(Clone)] . struct MatcherPos<'root, 'tt> { . /// The token or sequence of tokens that make up the matcher . top_elts: TokenTreeOrTokenTreeSlice<'tt>, . . /// The position of the "dot" in this matcher 66,760 ( 0.00%) idx: usize, . . /// For each named metavar in the matcher, we keep track of token trees matched against the . /// metavar by the black box parser. In particular, there may be more than one match per . /// metavar if we are in a repetition (each repetition matches each of the variables). . /// Moreover, matchers and repetitions can be nested; the `matches` field is shared (hence the . /// `Rc`) among all "nested" matchers. `match_lo`, `match_cur`, and `match_hi` keep track of . /// the current position of the `self` matcher position in the shared `matches` list. . /// . /// Also, note that while we are descending into a sequence, matchers are given their own . /// `matches` vector. Only once we reach the end of a full repetition of the sequence do we add . /// all bound matches from the submatcher into the shared top-level `matches` vector. If `sep` . /// and `up` are `Some`, then `matches` is _not_ the shared top-level list. Instead, if one . /// wants the shared `matches`, one should use `up.matches`. 267,040 ( 0.00%) matches: Box<[Lrc]>, . /// The position in `matches` corresponding to the first metavar in this matcher's sequence of . /// token trees. In other words, the first metavar in the first token of `top_elts` corresponds . /// to `matches[match_lo]`. 66,760 ( 0.00%) match_lo: usize, . /// The position in `matches` corresponding to the metavar we are currently trying to match . /// against the source token stream. `match_lo <= match_cur <= match_hi`. . match_cur: usize, . /// Similar to `match_lo` except `match_hi` is the position in `matches` of the _last_ metavar . /// in this matcher. 66,760 ( 0.00%) match_hi: usize, . . // The following fields are used if we are matching a repetition. If we aren't, they should be . // `None`. . /// The KleeneOp of this sequence if we are in a repetition. 66,760 ( 0.00%) seq_op: Option, . . /// The separator if we are in a repetition. . sep: Option, . . /// The "parent" matcher position if we are in a repetition. That is, the matcher position just . /// before we enter the sequence. 133,520 ( 0.00%) up: Option>, . . /// Specifically used to "unzip" token trees. By "unzip", we mean to unwrap the delimiters from . /// a delimited token tree (e.g., something wrapped in `(` `)`) or to get the contents of a doc . /// comment... . /// . /// When matching against matchers with nested delimited submatchers (e.g., `pat ( pat ( .. ) . /// pat ) pat`), we need to keep track of the matchers we are descending into. This stack does . /// that where the bottom of the stack is the outermost matcher. . /// Also, throughout the comments, this "descent" is often referred to as "unzipping"... . stack: SmallVec<[MatcherTtFrame<'tt>; 1]>, . } . . impl<'root, 'tt> MatcherPos<'root, 'tt> { . /// Adds `m` as a named match for the `idx`-th metavar. . fn push_match(&mut self, idx: usize, m: NamedMatch) { 1,518,512 ( 0.00%) let matches = Lrc::make_mut(&mut self.matches[idx]); . matches.push(m); . } . } . . // Lots of MatcherPos instances are created at runtime. Allocating them on the . // heap is slow. Furthermore, using SmallVec to allocate them all . // on the stack is also slow, because MatcherPos is quite a large type and . // instances get moved around a lot between vectors, which requires lots of -- line 221 ---------------------------------------- -- line 226 ---------------------------------------- . // and this type is used to encapsulate both cases. . enum MatcherPosHandle<'root, 'tt> { . Ref(&'root mut MatcherPos<'root, 'tt>), . Box(Box>), . } . . impl<'root, 'tt> Clone for MatcherPosHandle<'root, 'tt> { . // This always produces a new Box. 267,040 ( 0.00%) fn clone(&self) -> Self { 133,520 ( 0.00%) MatcherPosHandle::Box(match *self { 63,996 ( 0.00%) MatcherPosHandle::Ref(ref r) => Box::new((**r).clone()), . MatcherPosHandle::Box(ref b) => b.clone(), . }) 400,560 ( 0.00%) } . } . . impl<'root, 'tt> Deref for MatcherPosHandle<'root, 'tt> { . type Target = MatcherPos<'root, 'tt>; . fn deref(&self) -> &Self::Target { . match *self { . MatcherPosHandle::Ref(ref r) => r, . MatcherPosHandle::Box(ref b) => b, -- line 247 ---------------------------------------- -- line 272 ---------------------------------------- . . /// A `ParseResult` where the `Success` variant contains a mapping of . /// `MacroRulesNormalizedIdent`s to `NamedMatch`es. This represents the mapping . /// of metavars to the token trees they bind to. . crate type NamedParseResult = ParseResult>; . . /// Count how many metavars are named in the given matcher `ms`. . pub(super) fn count_names(ms: &[TokenTree]) -> usize { 2,507,332 ( 0.00%) ms.iter().fold(0, |count, elt| { 1,253,666 ( 0.00%) count 3,760,998 ( 0.01%) + match *elt { 84,896 ( 0.00%) TokenTree::Sequence(_, ref seq) => seq.num_captures, 78,347 ( 0.00%) TokenTree::Delimited(_, ref delim) => count_names(&delim.tts), . TokenTree::MetaVar(..) => 0, . TokenTree::MetaVarDecl(..) => 1, . TokenTree::Token(..) => 0, . } 3,134,165 ( 0.00%) }) . } . . /// `len` `Vec`s (initially shared and empty) that will store matches of metavars. . fn create_matches(len: usize) -> Box<[Lrc]> { 428,220 ( 0.00%) if len == 0 { . vec![] . } else { . let empty_matches = Lrc::new(SmallVec::new()); . vec![empty_matches; len] . } . .into_boxed_slice() . } . . /// Generates the top-level matcher position in which the "dot" is before the first token of the . /// matcher `ms`. . fn initial_matcher_pos<'root, 'tt>(ms: &'tt [TokenTree]) -> MatcherPos<'root, 'tt> { . let match_idx_hi = count_names(ms); . let matches = create_matches(match_idx_hi); 2,086,050 ( 0.00%) MatcherPos { . // Start with the top level matcher given to us . top_elts: TtSeq(ms), // "elts" is an abbr. for "elements" . // The "dot" is before the first token of the matcher . idx: 0, . . // Initialize `matches` to a bunch of empty `Vec`s -- one for each metavar in `top_elts`. . // `match_lo` for `top_elts` is 0 and `match_hi` is `matches.len()`. `match_cur` is 0 since . // we haven't actually matched anything yet. -- line 316 ---------------------------------------- -- line 340 ---------------------------------------- . /// particular token tree. . /// . /// The width of each `MatchedSeq` in the `NamedMatch`, and the identity of . /// the `MatchedNonterminal`s, will depend on the token tree it was applied . /// to: each `MatchedSeq` corresponds to a single `TTSeq` in the originating . /// token tree. The depth of the `NamedMatch` structure will therefore depend . /// only on the nesting depth of `ast::TTSeq`s in the originating . /// token tree it was derived from. 5,286 ( 0.00%) #[derive(Debug, Clone)] . crate enum NamedMatch { . MatchedSeq(Lrc), . MatchedNonterminal(Lrc), . } . . /// Takes a sequence of token trees `ms` representing a matcher which successfully matched input . /// and an iterator of items that matched input and produces a `NamedParseResult`. . fn nameize>( -- line 356 ---------------------------------------- -- line 357 ---------------------------------------- . sess: &ParseSess, . ms: &[TokenTree], . mut res: I, . ) -> NamedParseResult { . // Recursively descend into each type of matcher (e.g., sequences, delimited, metavars) and make . // sure that each metavar has _exactly one_ binding. If a metavar does not have exactly one . // binding, then there is an error. If it does, then we insert the binding into the . // `NamedParseResult`. 914,441 ( 0.00%) fn n_rec>( . sess: &ParseSess, . m: &TokenTree, . res: &mut I, . ret_val: &mut FxHashMap, . ) -> Result<(), (rustc_span::Span, String)> { 541,697 ( 0.00%) match *m { . TokenTree::Sequence(_, ref seq) => { 6,042 ( 0.00%) for next_m in &seq.tts { 36,996 ( 0.00%) n_rec(sess, next_m, res.by_ref(), ret_val)? . } . } . TokenTree::Delimited(_, ref delim) => { 8,257 ( 0.00%) for next_m in &delim.tts { 49,542 ( 0.00%) n_rec(sess, next_m, res.by_ref(), ret_val)?; . } . } . TokenTree::MetaVarDecl(span, _, None) => { . if sess.missing_fragment_specifiers.borrow_mut().remove(&span).is_some() { . return Err((span, "missing fragment specifier".to_string())); . } . } 378,126 ( 0.00%) TokenTree::MetaVarDecl(sp, bind_name, _) => match ret_val 252,084 ( 0.00%) .entry(MacroRulesNormalizedIdent::new(bind_name)) . { . Vacant(spot) => { . spot.insert(res.next().unwrap()); . } . Occupied(..) => return Err((sp, format!("duplicated bind name: {}", bind_name))), . }, . TokenTree::MetaVar(..) | TokenTree::Token(..) => (), . } . 83,131 ( 0.00%) Ok(()) 665,048 ( 0.00%) } . . let mut ret_val = FxHashMap::default(); . for m in ms { 609,489 ( 0.00%) match n_rec(sess, m, res.by_ref(), &mut ret_val) { . Ok(_) => {} . Err((sp, msg)) => return Error(sp, msg), . } . } . 108,513 ( 0.00%) Success(ret_val) . } . . /// Performs a token equality check, ignoring syntax context (that is, an unhygienic comparison) . fn token_name_eq(t1: &Token, t2: &Token) -> bool { 1,084,987 ( 0.00%) if let (Some((ident1, is_raw1)), Some((ident2, is_raw2))) = (t1.ident(), t2.ident()) { 261 ( 0.00%) ident1.name == ident2.name && is_raw1 == is_raw2 1,517,376 ( 0.00%) } else if let (Some(ident1), Some(ident2)) = (t1.lifetime(), t2.lifetime()) { . ident1.name == ident2.name . } else { 650,118 ( 0.00%) t1.kind == t2.kind . } . } . . /// Process the matcher positions of `cur_items` until it is empty. In the process, this will . /// produce more items in `next_items`, `eof_items`, and `bb_items`. . /// . /// For more info about the how this happens, see the module-level doc comments and the inline . /// comments of this function. -- line 427 ---------------------------------------- -- line 443 ---------------------------------------- . sess: &ParseSess, . cur_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>, . next_items: &mut Vec>, . eof_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>, . bb_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>, . token: &Token, . ) -> ParseResult<()> { . // Pop items from `cur_items` until it is empty. 2,619,688 ( 0.00%) while let Some(mut item) = cur_items.pop() { . // When unzipped trees end, remove them. This corresponds to backtracking out of a . // delimited submatcher into which we already descended. In backtracking out again, we need . // to advance the "dot" past the delimiters in the outer matcher. 8,056,096 ( 0.01%) while item.idx >= item.top_elts.len() { 18,796 ( 0.00%) match item.stack.pop() { . Some(MatcherTtFrame { elts, idx }) => { 84,582 ( 0.00%) item.top_elts = elts; 37,592 ( 0.00%) item.idx = idx + 1; . } . None => break, . } . } . . // Get the current position of the "dot" (`idx`) in `item` and the number of token trees in . // the matcher (`len`). . let idx = item.idx; . let len = item.top_elts.len(); . . // If `idx >= len`, then we are at or past the end of the matcher of `item`. 1,765,256 ( 0.00%) if idx >= len { . // We are repeating iff there is a parent. If the matcher is inside of a repetition, . // then we could be at the end of a sequence or at the beginning of the next . // repetition. 81,746 ( 0.00%) if item.up.is_some() { . // At this point, regardless of whether there is a separator, we should add all . // matches from the complete repetition of the sequence to the shared, top-level . // `matches` list (actually, `up.matches`, which could itself not be the top-level, . // but anyway...). Moreover, we add another item to `cur_items` in which the "dot" . // is at the end of the `up` matcher. This ensures that the "dot" in the `up` . // matcher is also advanced sufficiently. . // . // NOTE: removing the condition `idx == len` allows trailing separators. 120,944 ( 0.00%) if idx == len { . // Get the `up` matcher . let mut new_pos = item.up.clone().unwrap(); . . // Add matches from this repetition to the `matches` of `up` 120,710 ( 0.00%) for idx in item.match_lo..item.match_hi { 302,100 ( 0.00%) let sub = item.matches[idx].clone(); 181,260 ( 0.00%) new_pos.push_match(idx, MatchedSeq(sub)); . } . . // Move the "dot" past the repetition in `up` 120,591 ( 0.00%) new_pos.match_cur = item.match_hi; 362,130 ( 0.00%) new_pos.idx += 1; . cur_items.push(new_pos); . } . . // Check if we need a separator. 60,355 ( 0.00%) if idx == len && item.sep.is_some() { . // We have a separator, and it is the current token. We can advance past the . // separator token. 264 ( 0.00%) if item.sep.as_ref().map_or(false, |sep| token_name_eq(token, sep)) { 819 ( 0.00%) item.idx += 1; . next_items.push(item); . } . } . // We don't need a separator. Move the "dot" back to the beginning of the matcher . // and try to match again UNLESS we are only allowed to have _one_ repetition. 60,340 ( 0.00%) else if item.seq_op != Some(mbe::KleeneOp::ZeroOrOne) { 120,670 ( 0.00%) item.match_cur = item.match_lo; 241,340 ( 0.00%) item.idx = 0; . cur_items.push(item); . } . } . // If we are not in a repetition, then being at the end of a matcher means that we have . // reached the potential end of the input. . else { . eof_items.push(item); . } . } . // We are in the middle of a matcher. . else { . // Look at what token in the matcher we are trying to match the current token (`token`) . // against. Depending on that, we may generate new items. 2,568,489 ( 0.00%) match item.top_elts.get_tt(idx) { . // Need to descend into a sequence 30,794 ( 0.00%) TokenTree::Sequence(sp, seq) => { . // Examine the case where there are 0 matches of this sequence. We are . // implicitly disallowing OneOrMore from having 0 matches here. Thus, that will . // result in a "no rules expected token" error by virtue of this matcher not . // working. 12,888 ( 0.00%) if seq.kleene.op == mbe::KleeneOp::ZeroOrMore . || seq.kleene.op == mbe::KleeneOp::ZeroOrOne . { 12,810 ( 0.00%) let mut new_item = item.clone(); 25,620 ( 0.00%) new_item.match_cur += seq.num_captures; 32,025 ( 0.00%) new_item.idx += 1; 38,430 ( 0.00%) for idx in item.match_cur..item.match_cur + seq.num_captures { 18,846 ( 0.00%) new_item.push_match(idx, MatchedSeq(Lrc::new(smallvec![]))); . } . cur_items.push(new_item); . } . 6,444 ( 0.00%) let matches = create_matches(item.matches.len()); 77,328 ( 0.00%) cur_items.push(MatcherPosHandle::Box(Box::new(MatcherPos { 6,444 ( 0.00%) stack: smallvec![], . sep: seq.separator.clone(), 6,444 ( 0.00%) seq_op: Some(seq.kleene.op), . idx: 0, 32,220 ( 0.00%) matches, 12,888 ( 0.00%) match_lo: item.match_cur, . match_cur: item.match_cur, 12,888 ( 0.00%) match_hi: item.match_cur + seq.num_captures, . up: Some(item), 45,108 ( 0.00%) top_elts: Tt(TokenTree::Sequence(sp, seq)), . }))); . } . . // We need to match a metavar (but the identifier is invalid)... this is an error . TokenTree::MetaVarDecl(span, _, None) => { . if sess.missing_fragment_specifiers.borrow_mut().remove(&span).is_some() { . return Error(span, "missing fragment specifier".to_string()); . } -- line 565 ---------------------------------------- -- line 568 ---------------------------------------- . // We need to match a metavar with a valid ident... call out to the black-box . // parser by adding an item to `bb_items`. . TokenTree::MetaVarDecl(_, _, Some(kind)) => { . // Built-in nonterminals never start with these tokens, so we can eliminate . // them from consideration. . // . // We use the span of the metavariable declaration to determine any . // edition-specific matching behavior for non-terminals. 1,597,745 ( 0.00%) if Parser::nonterminal_may_begin_with(kind, token) { . bb_items.push(item); . } . } . . // We need to descend into a delimited submatcher or a doc comment. To do this, we . // push the current matcher onto a stack and push a new item containing the . // submatcher onto `cur_items`. . // . // At the beginning of the loop, if we reach the end of the delimited submatcher, . // we pop the stack to backtrack out of the descent. 152,230 ( 0.00%) seq @ (TokenTree::Delimited(..) . | TokenTree::Token(Token { kind: DocComment(..), .. })) => { . let lower_elts = mem::replace(&mut item.top_elts, Tt(seq)); 30,446 ( 0.00%) let idx = item.idx; 213,122 ( 0.00%) item.stack.push(MatcherTtFrame { elts: lower_elts, idx }); 121,784 ( 0.00%) item.idx = 0; . cur_items.push(item); . } . . // We just matched a normal token. We can just advance the parser. 627,374 ( 0.00%) TokenTree::Token(t) if token_name_eq(&t, token) => { 271,768 ( 0.00%) item.idx += 1; . next_items.push(item); . } . . // There was another token that was not `token`... This means we can't add any . // rules. NOTE that this is not necessarily an error unless _all_ items in . // `cur_items` end up doing this. There may still be some other matchers that do . // end up working out. . TokenTree::Token(..) | TokenTree::MetaVar(..) => {} . } 2,930,387 ( 0.00%) } 1,085,460 ( 0.00%) } . . // Yay a successful parse (so far)! . Success(()) . } . . /// Use the given sequence of token trees (`ms`) as a matcher. Match the token . /// stream from the given `parser` against it and return the match. 1,390,700 ( 0.00%) pub(super) fn parse_tt( . parser: &mut Cow<'_, Parser<'_>>, . ms: &[TokenTree], . macro_name: Ident, . ) -> NamedParseResult { . // A queue of possible matcher positions. We initialize it with the matcher position in which . // the "dot" is before the first token of the first token tree in `ms`. `inner_parse_loop` then . // processes all of these possible matcher positions and produces possible next positions into . // `next_items`. After some post-processing, the contents of `next_items` replenish `cur_items` . // and we start over again. . // . // This MatcherPos instance is allocated on the stack. All others -- and . // there are frequently *no* others! -- are allocated on the heap. . let mut initial = initial_matcher_pos(ms); 695,350 ( 0.00%) let mut cur_items = smallvec![MatcherPosHandle::Ref(&mut initial)]; . let mut next_items = Vec::new(); . . loop { . // Matcher positions black-box parsed by parser.rs (`parser`) . let mut bb_items = SmallVec::new(); . . // Matcher positions that would be valid if the macro invocation was over now . let mut eof_items = SmallVec::new(); 490,820 ( 0.00%) assert!(next_items.is_empty()); . . // Process `cur_items` until either we have finished the input or we need to get some . // parsing from the black-box parser done. The result is that `next_items` will contain a . // bunch of possible next matcher positions in `next_items`. . match inner_parse_loop( . parser.sess, . &mut cur_items, . &mut next_items, -- line 648 ---------------------------------------- -- line 652 ---------------------------------------- . ) { . Success(_) => {} . Failure(token, msg) => return Failure(token, msg), . Error(sp, msg) => return Error(sp, msg), . ErrorReported => return ErrorReported, . } . . // inner parse loop handled all cur_items, so it's empty 490,820 ( 0.00%) assert!(cur_items.is_empty()); . . // We need to do some post processing after the `inner_parser_loop`. . // . // Error messages here could be improved with links to original rules. . . // If we reached the EOF, check that there is EXACTLY ONE possible matcher. Otherwise, . // either the parse is ambiguous (which should never happen) or there is a syntax error. 2,454,100 ( 0.00%) if parser.token == token::Eof { 48,234 ( 0.00%) if eof_items.len() == 1 { . let matches = 87,135 ( 0.00%) eof_items[0].matches.iter_mut().map(|dv| Lrc::make_mut(dv).pop().unwrap()); 36,171 ( 0.00%) return nameize(parser.sess, ms, matches); . } else if eof_items.len() > 1 { . return Error( . parser.token.span, . "ambiguity: multiple successful parses".to_string(), . ); . } else { 27 ( 0.00%) return Failure( 9 ( 0.00%) Token::new( . token::Eof, 12 ( 0.00%) if parser.token.span.is_dummy() { . parser.token.span . } else { . parser.token.span.shrink_to_hi() . }, . ), . "missing tokens in macro arguments", . ); . } . } . // Performance hack: eof_items may share matchers via Rc with other things that we want . // to modify. Dropping eof_items now may drop these refcounts to 1, preventing an . // unnecessary implicit clone later in Rc::make_mut. 1,915,040 ( 0.00%) drop(eof_items); . . // If there are no possible next positions AND we aren't waiting for the black-box parser, . // then there is a syntax error. 1,602,114 ( 0.00%) if bb_items.is_empty() && next_items.is_empty() { 1,651,130 ( 0.00%) return Failure(parser.token.clone(), "no rules expected this token in macro call"); . } . // Another possibility is that we need to call out to parse some rust nonterminal . // (black-box) parser. However, if there is not EXACTLY ONE of these, something is wrong. 1,251,704 ( 0.00%) else if (!bb_items.is_empty() && !next_items.is_empty()) || bb_items.len() > 1 { . let nts = bb_items . .iter() . .map(|item| match item.top_elts.get_tt(item.idx) { . TokenTree::MetaVarDecl(_, bind, Some(kind)) => format!("{} ('{}')", kind, bind), . _ => panic!(), . }) . .collect::>() . .join(" or "); -- line 712 ---------------------------------------- -- line 721 ---------------------------------------- . n => format!("built-in NTs {} or {} other options.", nts, n), . } . ), . ); . } . // Dump all possible `next_items` into `cur_items` for the next iteration. . else if !next_items.is_empty() { . // Now process the next token 116,472 ( 0.00%) cur_items.extend(next_items.drain(..)); 38,824 ( 0.00%) parser.to_mut().bump(); . } . // Finally, we have the case where we need to call the black-box parser to get some . // nonterminal. . else { . assert_eq!(bb_items.len(), 1); . 625,852 ( 0.00%) let mut item = bb_items.pop().unwrap(); 1,755,586 ( 0.00%) if let TokenTree::MetaVarDecl(span, _, Some(kind)) = item.top_elts.get_tt(item.idx) { 312,926 ( 0.00%) let match_cur = item.match_cur; . // We use the span of the metavariable declaration to determine any . // edition-specific matching behavior for non-terminals. 2,015,874 ( 0.00%) let nt = match parser.to_mut().parse_nonterminal(kind) { . Err(mut err) => { . err.span_label( . span, . format!("while parsing argument for this `{}` macro fragment", kind), . ) . .emit(); . return ErrorReported; . } 1,877,556 ( 0.00%) Ok(nt) => nt, . }; 1,251,704 ( 0.00%) item.push_match(match_cur, MatchedNonterminal(Lrc::new(nt))); 1,251,704 ( 0.00%) item.idx += 1; 1,877,556 ( 0.00%) item.match_cur += 1; . } else { . unreachable!() . } . cur_items.push(item); . } . 703,500 ( 0.00%) assert!(!cur_items.is_empty()); . } 1,251,630 ( 0.00%) } 11,418,890 ( 0.02%) -------------------------------------------------------------------------------- The following files chosen for auto-annotation could not be found: -------------------------------------------------------------------------------- ./malloc/malloc.c ./stdlib/msort.c ./string/../sysdeps/x86_64/multiarch/memchr-avx2.S ./string/../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S ./string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S ./string/../sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S ./string/../sysdeps/x86_64/multiarch/strcmp-avx2.S /tmp/gcc-build/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/../../../../gcc-5.5.0/libstdc++-v3/libsupc++/new_op.cc -------------------------------------------------------------------------------- Ir -------------------------------------------------------------------------------- 85,880,646 ( 0.14%) events annotated