From bd52495518808bdbf24f4d8e9e20774d6d2e3333 Mon Sep 17 00:00:00 2001 From: Hongtao Yu Date: Thu, 17 Jun 2021 11:09:13 -0700 Subject: [PATCH] [CSSPGO] Undoing the concept of dangling pseudo probe As a follow-up to https://reviews.llvm.org/D104129, I'm cleaning up the danling probe related code in both the compiler and llvm-profgen. I'm seeing a 5% size win for the pseudo_probe section for SPEC2017 and 10% for Ciner. Certain benchmark such as 602.gcc has a 20% size win. No obvious difference seen on build time for SPEC2017 and Cinder. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D104477 --- llvm/include/llvm/CodeGen/MachineBasicBlock.h | 4 -- llvm/include/llvm/IR/PseudoProbe.h | 9 --- llvm/include/llvm/MC/MCPseudoProbe.h | 2 +- .../llvm/Transforms/Utils/BasicBlockUtils.h | 2 +- llvm/lib/CodeGen/BranchFolding.cpp | 10 ---- llvm/lib/CodeGen/MachineBasicBlock.cpp | 26 --------- llvm/lib/CodeGen/PseudoProbeInserter.cpp | 41 ++------------ llvm/lib/CodeGen/TailDuplicator.cpp | 6 -- llvm/lib/IR/PseudoProbe.cpp | 61 --------------------- llvm/lib/Transforms/IPO/SampleProfile.cpp | 6 -- llvm/lib/Transforms/IPO/SampleProfileProbe.cpp | 23 ++------ llvm/lib/Transforms/Scalar/JumpThreading.cpp | 5 +- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 4 +- llvm/lib/Transforms/Utils/Local.cpp | 16 +----- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 17 ++---- .../SampleProfile/pseudo-probe-dangle.ll | 49 ++++------------- .../SampleProfile/pseudo-probe-dangle2.ll | 4 +- .../SampleProfile/pseudo-probe-dangle3.ll | 4 +- .../SampleProfile/pseudo-probe-dangling.mir | 27 --------- .../Transforms/SampleProfile/pseudo-probe-dedup.ll | 41 -------------- .../inline-cs-dangling-pseudoprobe.perfscript | 5 -- .../Inputs/inline-cs-pseudoprobe.perfbin | Bin 13432 -> 17976 bytes .../Inputs/noinline-cs-pseudoprobe.perfbin | Bin 12896 -> 17456 bytes .../recursion-compression-pseudoprobe.perfbin | Bin 13584 -> 18096 bytes .../llvm-profgen/Inputs/truncated-pseudoprobe.ll | 2 - .../Inputs/truncated-pseudoprobe.perfbin | Bin 10400 -> 19256 bytes .../Inputs/truncated-pseudoprobe.perfscript | 6 +- .../Inputs/unique-linkage-name-probe.perfbin | Bin 13560 -> 17928 bytes .../tools/llvm-profgen/fname-canonicalization.test | 4 +- .../inline-cs-dangling-pseudoprobe.test | 54 ------------------ .../tools/llvm-profgen/inline-cs-pseudoprobe.test | 2 +- .../tools/llvm-profgen/merge-cold-profile.test | 18 +++--- .../llvm-profgen/noinline-cs-pseudoprobe.test | 2 +- .../tools/llvm-profgen/pseudoprobe-decoding.test | 31 +++-------- .../recursion-compression-pseudoprobe.test | 34 ++++++------ llvm/tools/llvm-profgen/ProfileGenerator.cpp | 6 +- llvm/tools/llvm-profgen/PseudoProbe.cpp | 9 +-- llvm/tools/llvm-profgen/PseudoProbe.h | 13 +---- 38 files changed, 85 insertions(+), 458 deletions(-) delete mode 100644 llvm/test/Transforms/SampleProfile/pseudo-probe-dangling.mir delete mode 100644 llvm/test/Transforms/SampleProfile/pseudo-probe-dedup.ll delete mode 100644 llvm/test/tools/llvm-profgen/Inputs/inline-cs-dangling-pseudoprobe.perfscript delete mode 100644 llvm/test/tools/llvm-profgen/inline-cs-dangling-pseudoprobe.test diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h index 66aaf00..efe22ea 100644 --- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h +++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h @@ -698,10 +698,6 @@ public: /// operands in the successor blocks which refer to FromMBB to refer to this. void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB); - /// move all pseudo probes in this block to the end of /c ToMBB To and tag - /// them dangling. - void moveAndDanglePseudoProbes(MachineBasicBlock *ToMBB); - /// Return true if any of the successors have probabilities attached to them. bool hasSuccessorProbabilities() const { return !Probs.empty(); } diff --git a/llvm/include/llvm/IR/PseudoProbe.h b/llvm/include/llvm/IR/PseudoProbe.h index a4148f0..53100f0 100644 --- a/llvm/include/llvm/IR/PseudoProbe.h +++ b/llvm/include/llvm/IR/PseudoProbe.h @@ -29,7 +29,6 @@ enum class PseudoProbeType { Block = 0, IndirectCall, DirectCall }; enum class PseudoProbeAttributes { Reserved = 0x1, // Reserved for future use. - Dangling = 0x2, // The probe is dangling. }; // The saturated distrution factor representing 100% for block probes. @@ -84,19 +83,11 @@ struct PseudoProbe { // A saturated distribution factor stands for 1.0 or 100%. A pesudo probe has // a factor with the value ranged from 0.0 to 1.0. float Factor; - - bool isDangling() const { - return Attr & (uint32_t)PseudoProbeAttributes::Dangling; - } }; Optional extractProbe(const Instruction &Inst); void setProbeDistributionFactor(Instruction &Inst, float Factor); - -bool moveAndDanglePseudoProbes(BasicBlock *From, Instruction *To); - -bool removeRedundantPseudoProbes(BasicBlock *Block); } // end namespace llvm #endif // LLVM_IR_PSEUDOPROBE_H diff --git a/llvm/include/llvm/MC/MCPseudoProbe.h b/llvm/include/llvm/MC/MCPseudoProbe.h index 27999e3..1c6926b 100644 --- a/llvm/include/llvm/MC/MCPseudoProbe.h +++ b/llvm/include/llvm/MC/MCPseudoProbe.h @@ -27,7 +27,7 @@ // TYPE (uint4) // 0 - block probe, 1 - indirect call, 2 - direct call // ATTRIBUTE (uint3) -// 1 - reserved, 2 - dangling +// 1 - reserved // ADDRESS_TYPE (uint1) // 0 - code address, 1 - address delta // CODE_ADDRESS (uint64 or ULEB128) diff --git a/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h b/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h index 3456700..c78e964 100644 --- a/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h +++ b/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h @@ -111,7 +111,7 @@ bool MergeBlockSuccessorsIntoGivenBlocks( /// Try to remove redundant dbg.value instructions from given basic block. /// Returns true if at least one instruction was removed. Remove redundant /// pseudo ops when RemovePseudoOp is true. -bool RemoveRedundantDbgInstrs(BasicBlock *BB, bool RemovePseudoOp = false); +bool RemoveRedundantDbgInstrs(BasicBlock *BB); /// Replace all uses of an instruction (specified by BI) with a value, then /// remove and delete the original instruction. diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp index 6deb2dc..65e7e92 100644 --- a/llvm/lib/CodeGen/BranchFolding.cpp +++ b/llvm/lib/CodeGen/BranchFolding.cpp @@ -1307,16 +1307,6 @@ static void salvageDebugInfoFromEmptyBlock(const TargetInstrInfo *TII, for (MachineBasicBlock *PredBB : MBB.predecessors()) if (PredBB->succ_size() == 1) copyDebugInfoToPredecessor(TII, MBB, *PredBB); - - // For AutoFDO, if the block is removed, we won't be able to sample it. To - // avoid assigning a zero weight for BB, move all its pseudo probes into once - // of its predecessors or successors and mark them dangling. This should allow - // the counts inference a chance to get a more reasonable weight for the - // block. - if (!MBB.pred_empty()) - MBB.moveAndDanglePseudoProbes(*MBB.pred_begin()); - else if (!MBB.succ_empty()) - MBB.moveAndDanglePseudoProbes(*MBB.succ_begin()); } bool BranchFolder::OptimizeBlock(MachineBasicBlock *MBB) { diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 1011f52..c6914dc 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -901,32 +901,6 @@ MachineBasicBlock::transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB) { normalizeSuccProbs(); } -/// A block emptied (i.e., with all instructions moved out of it) won't be -/// sampled at run time. In such cases, AutoFDO will be informed of zero samples -/// collected for the block. This is not accurate and could lead to misleading -/// weights assigned for the block. A way to mitigate that is to treat such -/// block as having unknown counts in the AutoFDO profile loader and allow the -/// counts inference tool a chance to calculate a relatively reasonable weight -/// for it. This can be done by moving all pseudo probes in the emptied block -/// i.e, /c this, to before /c ToMBB and tag them dangling. Note that this is -/// not needed for dead blocks which really have a zero weight. It's per -/// transforms to decide whether to call this function or not. -void MachineBasicBlock::moveAndDanglePseudoProbes(MachineBasicBlock *ToMBB) { - SmallVector ToBeMoved; - for (MachineInstr &MI : instrs()) { - if (MI.isPseudoProbe()) { - MI.addPseudoProbeAttribute(PseudoProbeAttributes::Dangling); - ToBeMoved.push_back(&MI); - } - } - - MachineBasicBlock::iterator I = ToMBB->getFirstTerminator(); - for (MachineInstr *MI : ToBeMoved) { - MI->removeFromParent(); - ToMBB->insert(I, MI); - } -} - bool MachineBasicBlock::isPredecessor(const MachineBasicBlock *MBB) const { return is_contained(predecessors(), MBB); } diff --git a/llvm/lib/CodeGen/PseudoProbeInserter.cpp b/llvm/lib/CodeGen/PseudoProbeInserter.cpp index cda9393..a9fb577 100644 --- a/llvm/lib/CodeGen/PseudoProbeInserter.cpp +++ b/llvm/lib/CodeGen/PseudoProbeInserter.cpp @@ -102,51 +102,22 @@ public: // Probes not surrounded by any real instructions in the same block are // called dangling probes. Since there's no good way to pick up a sample // collection point for dangling probes at compile time, they are being - // tagged so that the profile correlation tool will not report any + // removed so that the profile correlation tool will not report any // samples collected for them and it's up to the counts inference tool // to get them a reasonable count. + SmallVector ToBeRemoved; for (MachineInstr &MI : MBB) { if (MI.isPseudoProbe()) - MI.addPseudoProbeAttribute(PseudoProbeAttributes::Dangling); + ToBeRemoved.push_back(&MI); } - } - } - - // Remove redundant dangling probes. Same dangling probes are redundant - // since they all have the same semantic that is to rely on the counts - // inference too to get reasonable count for the same original block. - // Therefore, there's no need to keep multiple copies of them. - auto Hash = [](const MachineInstr *MI) { - return std::hash()(MI->getOperand(0).getImm()) ^ - std::hash()(MI->getOperand(1).getImm()); - }; - - auto IsEqual = [](const MachineInstr *Left, const MachineInstr *Right) { - return Left->getOperand(0).getImm() == Right->getOperand(0).getImm() && - Left->getOperand(1).getImm() == Right->getOperand(1).getImm() && - Left->getOperand(3).getImm() == Right->getOperand(3).getImm() && - Left->getDebugLoc() == Right->getDebugLoc(); - }; - SmallVector ToBeRemoved; - std::unordered_set - DanglingProbes(0, Hash, IsEqual); + for (auto *MI : ToBeRemoved) + MI->eraseFromParent(); - for (MachineBasicBlock &MBB : MF) { - for (MachineInstr &MI : MBB) { - if (MI.isPseudoProbe()) { - if ((uint32_t)MI.getPseudoProbeAttribute() & - (uint32_t)PseudoProbeAttributes::Dangling) - if (!DanglingProbes.insert(&MI).second) - ToBeRemoved.push_back(&MI); - } + Changed |= !ToBeRemoved.empty(); } } - for (auto *MI : ToBeRemoved) - MI->eraseFromParent(); - - Changed |= !ToBeRemoved.empty(); return Changed; } diff --git a/llvm/lib/CodeGen/TailDuplicator.cpp b/llvm/lib/CodeGen/TailDuplicator.cpp index e2be761..2b71490 100644 --- a/llvm/lib/CodeGen/TailDuplicator.cpp +++ b/llvm/lib/CodeGen/TailDuplicator.cpp @@ -779,12 +779,6 @@ bool TailDuplicator::duplicateSimpleBB( assert(PredBB->succ_size() <= 1); } - // For AutoFDO, since BB is going to be removed, we won't be able to sample - // it. To avoid assigning a zero weight for BB, move all its pseudo probes - // into Succ and mark them dangling. This should allow the counts inference - // a chance to get a more reasonable weight for BB. - TailBB->moveAndDanglePseudoProbes(PredBB); - if (PredTBB) TII->insertBranch(*PredBB, PredTBB, PredFBB, PredCond, DL); diff --git a/llvm/lib/IR/PseudoProbe.cpp b/llvm/lib/IR/PseudoProbe.cpp index 5d1fef5..bd92c60 100644 --- a/llvm/lib/IR/PseudoProbe.cpp +++ b/llvm/lib/IR/PseudoProbe.cpp @@ -106,65 +106,4 @@ void addPseudoProbeAttribute(PseudoProbeInst &Inst, if (OldAttr != NewAttr) Inst.replaceUsesOfWith(Inst.getAttributes(), Builder.getInt32(NewAttr)); } - -/// A block emptied (i.e., with all instructions moved out of it) won't be -/// sampled at run time. In such cases, AutoFDO will be informed of zero samples -/// collected for the block. This is not accurate and could lead to misleading -/// weights assigned for the block. A way to mitigate that is to treat such -/// block as having unknown counts in the AutoFDO profile loader and allow the -/// counts inference tool a chance to calculate a relatively reasonable weight -/// for it. This can be done by moving all pseudo probes in the emptied block -/// i.e, /c From, to before /c To and tag them dangling. Note that this is -/// not needed for dead blocks which really have a zero weight. It's per -/// transforms to decide whether to call this function or not. -bool moveAndDanglePseudoProbes(BasicBlock *From, Instruction *To) { - SmallVector ToBeMoved; - for (auto &I : *From) { - if (auto *II = dyn_cast(&I)) { - addPseudoProbeAttribute(*II, PseudoProbeAttributes::Dangling); - ToBeMoved.push_back(II); - } - } - - for (auto *I : ToBeMoved) - I->moveBefore(To); - - return !ToBeMoved.empty(); -} - -/// Same dangling probes in one blocks are redundant since they all have the -/// same semantic that is to rely on the counts inference too to get reasonable -/// count for the same original block. Therefore, there's no need to keep -/// multiple copies of them. -bool removeRedundantPseudoProbes(BasicBlock *Block) { - - auto Hash = [](const PseudoProbeInst *I) { - return std::hash()(I->getFuncGuid()->getZExtValue()) ^ - std::hash()(I->getIndex()->getZExtValue()); - }; - - auto IsEqual = [](const PseudoProbeInst *Left, const PseudoProbeInst *Right) { - return Left->getFuncGuid() == Right->getFuncGuid() && - Left->getIndex() == Right->getIndex() && - Left->getAttributes() == Right->getAttributes() && - Left->getDebugLoc() == Right->getDebugLoc(); - }; - - SmallVector ToBeRemoved; - std::unordered_set - DanglingProbes(0, Hash, IsEqual); - - for (auto &I : *Block) { - if (auto *II = dyn_cast(&I)) { - if (II->getAttributes()->getZExtValue() & - (uint32_t)PseudoProbeAttributes::Dangling) - if (!DanglingProbes.insert(II).second) - ToBeRemoved.push_back(II); - } - } - - for (auto *I : ToBeRemoved) - I->eraseFromParent(); - return !ToBeRemoved.empty(); -} } // namespace llvm diff --git a/llvm/lib/Transforms/IPO/SampleProfile.cpp b/llvm/lib/Transforms/IPO/SampleProfile.cpp index 2d0b146..fe1776a 100644 --- a/llvm/lib/Transforms/IPO/SampleProfile.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfile.cpp @@ -555,12 +555,6 @@ ErrorOr SampleProfileLoader::getProbeWeight(const Instruction &Inst) { if (!Probe) return std::error_code(); - // This is not the dangling probe from the training pass but generated by the - // current compilation. Ignore this since they are logically deleted and - // should not consume any profile samples. - if (Probe->isDangling()) - return std::error_code(); - const FunctionSamples *FS = findFunctionSamples(Inst); // If none of the instruction has FunctionSample, we choose to return zero // value sample to indicate the BB is cold. This could happen when the diff --git a/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp b/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp index 6c3752d..08d3163 100644 --- a/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp +++ b/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp @@ -425,15 +425,8 @@ void PseudoProbeUpdatePass::runOnFunction(Function &F, for (auto &Block : F) { for (auto &I : Block) { if (Optional Probe = extractProbe(I)) { - // Do not count dangling probes since they are logically deleted and the - // current block that a dangling probe resides in doesn't reflect the - // execution count of the probe. The original samples of the probe will - // be distributed among the rest probes if there are any, this is - // less-than-deal but at least we don't lose any samples. - if (!Probe->isDangling()) { - uint64_t Hash = computeCallStackHash(I); - ProbeFactors[{Probe->Id, Hash}] += BBProfileCount(&Block); - } + uint64_t Hash = computeCallStackHash(I); + ProbeFactors[{Probe->Id, Hash}] += BBProfileCount(&Block); } } } @@ -442,14 +435,10 @@ void PseudoProbeUpdatePass::runOnFunction(Function &F, for (auto &Block : F) { for (auto &I : Block) { if (Optional Probe = extractProbe(I)) { - // Ignore danling probes since they are logically deleted and should do - // not consume any profile samples in the subsequent profile annotation. - if (!Probe->isDangling()) { - uint64_t Hash = computeCallStackHash(I); - float Sum = ProbeFactors[{Probe->Id, Hash}]; - if (Sum != 0) - setProbeDistributionFactor(I, BBProfileCount(&Block) / Sum); - } + uint64_t Hash = computeCallStackHash(I); + float Sum = ProbeFactors[{Probe->Id, Hash}]; + if (Sum != 0) + setProbeDistributionFactor(I, BBProfileCount(&Block) / Sum); } } } diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp index d299c40..9dc3b03 100644 --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -433,9 +433,8 @@ bool JumpThreadingPass::runImpl(Function &F, TargetLibraryInfo *TLI_, // Jump threading may have introduced redundant debug values into BB // which should be removed. - // Remove redundant pseudo probes as well. if (Changed) - RemoveRedundantDbgInstrs(&BB, true); + RemoveRedundantDbgInstrs(&BB); // Stop processing BB if it's the entry or is now deleted. The following // routines attempt to eliminate BB and locating a suitable replacement @@ -468,7 +467,7 @@ bool JumpThreadingPass::runImpl(Function &F, TargetLibraryInfo *TLI_, // detect and transform nested loops later. !LoopHeaders.count(&BB) && !LoopHeaders.count(Succ) && TryToSimplifyUncondBranchFromEmptyBlock(&BB, DTU)) { - RemoveRedundantDbgInstrs(Succ, true); + RemoveRedundantDbgInstrs(Succ); // BB is valid for cleanup here because we passed in DTU. F remains // BB's parent until a DTU->getDomTree() event. LVI->eraseBlock(&BB); diff --git a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp index f793026..a20799d 100644 --- a/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp +++ b/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp @@ -429,7 +429,7 @@ static bool removeRedundantDbgInstrsUsingForwardScan(BasicBlock *BB) { return !ToBeRemoved.empty(); } -bool llvm::RemoveRedundantDbgInstrs(BasicBlock *BB, bool RemovePseudoOp) { +bool llvm::RemoveRedundantDbgInstrs(BasicBlock *BB) { bool MadeChanges = false; // By using the "backward scan" strategy before the "forward scan" strategy we // can remove both dbg.value (2) and (3) in a situation like this: @@ -444,8 +444,6 @@ bool llvm::RemoveRedundantDbgInstrs(BasicBlock *BB, bool RemovePseudoOp) { // already is described as having the value V1 at (1). MadeChanges |= removeRedundantDbgInstrsUsingBackwardScan(BB); MadeChanges |= removeRedundantDbgInstrsUsingForwardScan(BB); - if (RemovePseudoOp) - MadeChanges |= removeRedundantPseudoProbes(BB); if (MadeChanges) LLVM_DEBUG(dbgs() << "Removed redundant dbg instrs from: " diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 13a2f30..c228df2 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1133,12 +1133,6 @@ bool llvm::TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB, for (BasicBlock *Pred : predecessors(BB)) Pred->getTerminator()->setMetadata(LoopMDKind, LoopMD); - // For AutoFDO, since BB is going to be removed, we won't be able to sample - // it. To avoid assigning a zero weight for BB, move all its pseudo probes - // into Succ and mark them dangling. This should allow the counts inference a - // chance to get a more reasonable weight for BB. - moveAndDanglePseudoProbes(BB, &*Succ->getFirstInsertionPt()); - // Everything that jumped to BB now goes to Succ. BB->replaceAllUsesWith(Succ); if (!Succ->hasName()) Succ->takeName(BB); @@ -2767,19 +2761,13 @@ void llvm::hoistAllInstructionsInto(BasicBlock *DomBlock, Instruction *InsertPt, // encode predicated DIExpressions that yield different results on different // code paths. - // A hoisted conditional probe should be treated as dangling so that it will - // not be over-counted when the samples collected on the non-conditional path - // are counted towards the conditional path. We leave it for the counts - // inference algorithm to figure out a proper count for a danglng probe. - moveAndDanglePseudoProbes(BB, InsertPt); - for (BasicBlock::iterator II = BB->begin(), IE = BB->end(); II != IE;) { Instruction *I = &*II; I->dropUnknownNonDebugMetadata(); if (I->isUsedByMetadata()) dropDebugUsers(*I); - if (isa(I)) { - // Remove DbgInfo Intrinsics. + if (I->isDebugOrPseudoInst()) { + // Remove DbgInfo and pseudo probe Intrinsics. II = I->eraseFromParent(); continue; } diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index a0224a9..642320e 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1325,10 +1325,6 @@ bool SimplifyCFGOpt::PerformValueComparisonIntoPredecessorFolding( DTU->applyUpdates(Updates); } - // Here the BB is not a dead block but folded into its predecessors, so move - // the probe and mark it as dangling. - moveAndDanglePseudoProbes(BB, NewSI); - ++NumFoldValueComparisonIntoPredecessors; return true; } @@ -2394,6 +2390,11 @@ bool SimplifyCFGOpt::SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB, // probability for ThenBB, which is fine since the optimization here takes // place regardless of the branch probability. if (isa(I)) { + // The probe should be deleted so that it will not be over-counted when + // the samples collected on the non-conditional path are counted towards + // the conditional path. We leave it for the counts inference algorithm to + // figure out a proper count for an unknown probe. + SpeculatedDbgIntrinsics.push_back(I); continue; } @@ -2469,19 +2470,11 @@ bool SimplifyCFGOpt::SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB, SpeculatedStore->getDebugLoc()); } - // A hoisted conditional probe should be treated as dangling so that it will - // not be over-counted when the samples collected on the non-conditional path - // are counted towards the conditional path. We leave it for the counts - // inference algorithm to figure out a proper count for a danglng probe. - moveAndDanglePseudoProbes(ThenBB, BI); - // Metadata can be dependent on the condition we are hoisting above. // Conservatively strip all metadata on the instruction. Drop the debug loc // to avoid making it appear as if the condition is a constant, which would // be misleading while debugging. for (auto &I : *ThenBB) { - assert(!isa(I) && - "Should not drop debug info from any pseudo probes."); if (!SpeculatedStoreValue || &I != SpeculatedStore) I.setDebugLoc(DebugLoc()); I.dropUnknownNonDebugMetadata(); diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle.ll index 3844b00..707977f 100644 --- a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle.ll +++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle.ll @@ -19,62 +19,35 @@ T: F: br label %Merge Merge: -;; Check branch T and F are gone, and their probes (probe 2 and 3) are dangling. +;; Check branch T and F are gone, and their probes (probe 2 and 3) are gone too. ; JT-LABEL-NO: T ; JT-LABEL-NO: F ; JT-LABEL: Merge -; JT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 3, i32 2, i64 -1) -; JT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 2, i32 2, i64 -1) +; JT-NOT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 3 +; JT-NOT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 2 ; JT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1) -; ASM: .pseudoprobe 6699318081062747564 3 0 2 -; ASM: .pseudoprobe 6699318081062747564 2 0 2 +; ASM-NOT: .pseudoprobe 6699318081062747564 3 +; ASM-NOT: .pseudoprobe 6699318081062747564 2 ; ASM: .pseudoprobe 6699318081062747564 4 0 0 ret i32 %call } -;; Check block T and F are gone, and their probes (probe 2 and 3) are dangling. +;; Check block T and F are gone, and their probes (probe 2 and 3) are gone too. ; MIR-tail: bb.0 ; MIR-tail: PSEUDO_PROBE [[#GUID:]], 1, 0, 0 -; MIR-tail: PSEUDO_PROBE [[#GUID:]], 2, 0, 2 -; MIR-tail: PSEUDO_PROBE [[#GUID:]], 3, 0, 2 +; MIR-tail-NOT: PSEUDO_PROBE [[#GUID:]], 2 +; MIR-tail-NOT: PSEUDO_PROBE [[#GUID:]], 3 ; MIR-tail: PSEUDO_PROBE [[#GUID:]], 4, 0, 0 -define void @foo2() { -bb: - %tmp = call i32 @f1() - %tmp1 = icmp eq i32 %tmp, 1 - br i1 %tmp1, label %bb5, label %bb8 - -bb2: - %tmp4 = icmp ne i32 %tmp, 1 - switch i1 %tmp4, label %bb2 [ - i1 0, label %bb5 - i1 1, label %bb8 - ] - -bb5: -;; Check the pseudo probe with id 3 only has one copy. -; JT-COUNT-1: call void @llvm.pseudoprobe(i64 [[#GUID2:]], i64 3, i32 2, i64 -1) -; JT-NOT: call void @llvm.pseudoprobe(i64 [[#GUID2:]], i64 3, i32 2, i64 -1) - %tmp6 = phi i1 [ %tmp1, %bb ], [ false, %bb2 ] - br i1 %tmp6, label %bb8, label %bb7 - -bb7: - br label %bb8 - -bb8: - ret void -} - define i32 @test(i32 %a, i32 %b, i32 %c) { -;; Check block bb1 and bb2 are gone, and their probes (probe 2 and 3) are dangling. +;; Check block bb1 and bb2 are gone, and their probes (probe 2 and 3) are gone too. ; SC-LABEL: @test( ; SC-LABEL-NO: bb1 ; SC-LABEL-NO: bb2 ; SC: [[T1:%.*]] = icmp eq i32 [[B:%.*]], 0 -; SC-DAG: call void @llvm.pseudoprobe(i64 [[#GUID3:]], i64 2, i32 2, i64 -1) -; SC-DAG: call void @llvm.pseudoprobe(i64 [[#GUID3]], i64 3, i32 2, i64 -1) +; SC-NOT: call void @llvm.pseudoprobe(i64 [[#]], i64 2 +; SC-NOT: call void @llvm.pseudoprobe(i64 [[#]], i64 3 ; SC: [[T2:%.*]] = icmp sgt i32 [[C:%.*]], 1 ; SC: [[T3:%.*]] = add i32 [[A:%.*]], 1 ; SC: [[SPEC_SELECT:%.*]] = select i1 [[T2]], i32 [[T3]], i32 [[A]] diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll index 4df2f4a..ef93afa 100644 --- a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll +++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle2.ll @@ -2,9 +2,9 @@ ; RUN: opt < %s -simplifycfg -S -o %t ; RUN: FileCheck %s < %t -; Test to make sure the dangling probe's metadata not being dropped. +; Test to make sure the dangling probe is gone. ; CHECK: define dso_local i32 @foo -; CHECK: call void @llvm.pseudoprobe(i64 -4224472938262609671, i64 5, i32 2, i64 -1), !dbg ![[#]] +; CHECK-NOT: call void @llvm.pseudoprobe(i64 -4224472938262609671, i64 5 ; Function Attrs: nounwind uwtable define dso_local i32 @foo(i32* nocapture %marker, i32* nocapture %move_ordering, i32* nocapture %moves, i32 %num_moves) local_unnamed_addr #0 !dbg !10 { diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle3.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle3.ll index ae6aaa8..1a3c9a2 100644 --- a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle3.ll +++ b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangle3.ll @@ -1,10 +1,10 @@ -; Test after FoldValueComparisonIntoPredecessors, one dangling probe is generated +; Test after FoldValueComparisonIntoPredecessors, one dangling probe is gone ; RUN: opt -S -passes='pseudo-probe,simplifycfg' < %s | FileCheck %s ; CHECK: if.end80: ; preds = %if.end ; CHECK-NEXT: call void @llvm.pseudoprobe(i64 -2281696412744416103, i64 3, i32 0, i64 -1) -; CHECK-NEXT: call void @llvm.pseudoprobe(i64 -2281696412744416103, i64 4, i32 2, i64 -1) +; CHECK-NOT: call void @llvm.pseudoprobe(i64 -2281696412744416103, i64 4 define dso_local i32 @readCBPandCoeffsFromNAL(i1 %c, i32 %x, i32 %y) local_unnamed_addr { ; diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangling.mir b/llvm/test/Transforms/SampleProfile/pseudo-probe-dangling.mir deleted file mode 100644 index 6a24f77..0000000 --- a/llvm/test/Transforms/SampleProfile/pseudo-probe-dangling.mir +++ /dev/null @@ -1,27 +0,0 @@ - -# REQUIRES: x86-registered-target -# Ensure llc can read and parse MIR pseudo probe operations. -# RUN: llc -mtriple x86_64-- -run-pass=pseudo-probe-inserter %s -o - | FileCheck %s - -# CHECK: PSEUDO_PROBE 6699318081062747564, 1, 0, 0 -# check probe 2 is moved before the test instruction. -# CHECK: PSEUDO_PROBE 6699318081062747564, 2, 0, 0 -# CHECK: TEST32rr -# check probe 3 is dangling. -# CHECK: PSEUDO_PROBE 6699318081062747564, 3, 0, 2 - -name: foo -body: | - bb.0: - TEST32rr killed renamable $edi, renamable $edi, implicit-def $eflags - PSEUDO_PROBE 6699318081062747564, 1, 0, 0 - JCC_1 %bb.1, 4, implicit $eflags - - bb.2: - TEST32rr killed renamable $edi, renamable $edi, implicit-def $eflags - PSEUDO_PROBE 6699318081062747564, 2, 0, 0 - - bb.1: - PSEUDO_PROBE 6699318081062747564, 3, 0, 0 - -... diff --git a/llvm/test/Transforms/SampleProfile/pseudo-probe-dedup.ll b/llvm/test/Transforms/SampleProfile/pseudo-probe-dedup.ll deleted file mode 100644 index 57a24de..0000000 --- a/llvm/test/Transforms/SampleProfile/pseudo-probe-dedup.ll +++ /dev/null @@ -1,41 +0,0 @@ -; REQUIRES: x86_64-linux -; RUN: llc -pseudo-probe-for-profiling %s -filetype=asm -o - | FileCheck %s - -declare i32 @f1() -declare void @llvm.pseudoprobe(i64, i64, i32, i64) #0 - -define void @foo2() { -bb: -; CHECK: .pseudoprobe 2494702099028631698 1 0 0 - call void @llvm.pseudoprobe(i64 2494702099028631698, i64 1, i32 0, i64 -1) - %tmp = call i32 @f1() - %tmp1 = icmp eq i32 %tmp, 1 - br i1 %tmp1, label %bb5, label %bb8 - -bb2: -;; Check the pseudo probe with id 2 only has one copy. -; CHECK-COUNT-1: .pseudoprobe 2494702099028631698 2 0 2 -; CHECK-NOT: .pseudoprobe 2494702099028631698 2 0 2 - call void @llvm.pseudoprobe(i64 2494702099028631698, i64 2, i32 2, i64 -1) - %tmp4 = icmp ne i32 %tmp, 1 - call void @llvm.pseudoprobe(i64 2494702099028631698, i64 2, i32 2, i64 -1) - switch i1 %tmp4, label %bb2 [ - i1 0, label %bb5 - i1 1, label %bb8 - ] - -bb5: - %tmp6 = phi i1 [ %tmp1, %bb ], [ false, %bb2 ] - call void @llvm.pseudoprobe(i64 2494702099028631698, i64 2, i32 2, i64 -1) - br i1 %tmp6, label %bb8, label %bb7 - -bb7: - br label %bb8 - -bb8: - ret void -} - -!llvm.pseudo_probe_desc = !{!0} - -!0 = !{i64 2494702099028631698, i64 281612674956943, !"foo2", null} \ No newline at end of file diff --git a/llvm/test/tools/llvm-profgen/Inputs/inline-cs-dangling-pseudoprobe.perfscript b/llvm/test/tools/llvm-profgen/Inputs/inline-cs-dangling-pseudoprobe.perfscript deleted file mode 100644 index ba1affd..0000000 --- a/llvm/test/tools/llvm-profgen/Inputs/inline-cs-dangling-pseudoprobe.perfscript +++ /dev/null @@ -1,5 +0,0 @@ -PERF_RECORD_MMAP2 595196/595196: [0x201000(0x1000) @ 0 00:1d 224227621 1042948]: r-xp /home/inline-cs-pseudoprobe.perfbin - - 20180e - 5541f689495641d7 - 0x201858/0x20180e/P/-/-/0 0x20182b/0x20184d/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 0x20182b/0x201800/P/-/-/0 diff --git a/llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin b/llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin index 2b5fc0a9dfdd1df5400e6202f552b30e7e22af47..ba02c2e59e6943418933d145389dc392a18b6deb 100755 GIT binary patch delta 2893 zcmcImT}+!*7(U-e|ADsj9~kAMY*LDCzppK<1qI0r6-C_$&Pbf0ly=S<{s6WLC$_h>Sg zm>%^+GvnS=>bL~%iK)!nv1rbNBo_=t1M%Q!JTxW*_(&wm^YPJW#251WgMQw>KNjc+ z#Y4eBw3UPp9O&en;a6U3<$|7oN8o(CkLN?aAm<#6jd3qTP|TA?!Y#Ctfn@qvY^swR z7vutIpIeWUFwzWtuMQ6N_q{`OWPhpEOML8F zSDi$Y(J&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CZ)(;WO8rh~{0&mj{ zL4+#cpxaR^YuJJT)9$wV8^lmJc~JWS<&%wBgvbTZ2^2?Z6c;mO zC*q>u<&k^`#3wj$f|(Uk>9{2R7o#j&(m?f1O4EYx@q`ffJv8ijfJ;v)qnS+R*n}YZ zGD14zNv4J4E`RA~s1wT}9 zLqQ`{vovND?1mnqAB7o$CltIO+hK`qu&?7Jjy4e9r58Y_pA*Y|Lqus1X| zsj-4eA_^`O)<~QgRFBY~s&c_E0UAePIY{FnXd-wRMhQNt;ByMT1E+$t{XG&v&Ysl% zl_#|LS8~h2T^O#19)+u++T5Y=3uRglz+EZg_&jGhq|JwRBRt<5F(>NOvb&+$QwKlw zI;o3wP}6t7yh`4Uye=w)*yp59(y%~?4;oZrLp{;wG+(l-mUYGA?RT0N8&%6C^>DwF b8g#%y{{hP6gpd0VST>tg{-z!p_wW7#>n`+= diff --git a/llvm/test/tools/llvm-profgen/Inputs/noinline-cs-pseudoprobe.perfbin b/llvm/test/tools/llvm-profgen/Inputs/noinline-cs-pseudoprobe.perfbin index 6b96f792d0c299213a81b53fa0d2075d651d6d34..fc6440cf2ff426864aa7bed388db0ee46c5950bb 100755 GIT binary patch delta 2806 zcmcIlUuaup6hGfh8v8$g+ndlexgFLfowNGTH4!>LF-6-{ViH5SuVH5J!mJ<(7o5>i9`$#7pZ6^(@T01Tfv zF(CPeM<)VOL=MZE)T8#OYP2UJ`A;Vk($g^tCTEBUY5^EYXI@M$4oD*-Pf1$!a>5%{ zQRr1M*sL|~O$le4CF|Y|fCk)jxR`(+HGl84KzT5L;h}De0|3YD9eB&?-M|kG{M^7F4XnXu z+ePN(=s9lYz7Ixw9+ydT-oSToqg`P|yi58lT@DjOcyB=Bj+J3UyI1tw=2s^;;cLHC zVfbPThlssrurAoz$Le^N*fg<%V1u{IeP}npCSD`MzN zl%fIL#7$Cu%A*yxeHMmWQocCbv1&5W{bGBk_<_`EDti5K3;PF|=EJM9yYAx#BNr&( zrs89d;9Xe^M4Y9)KX)@Mne_hre{>jX)qODalZM*gelYb5TwO06-BsgFrB85o;f^vW zOmyLZIw<_og)h_emLIRHgLTt^l5~wq>#u9kKYy{Q?}r>)N1jL&F_y Oux>q6QtseTkMBRmlr;kY delta 2234 zcmc&!Urbw77(eIs(oras7U-pdaM5WCuD!hlTBxxCUBXl{gBdszvvAwqLZ$63Z9$f( z;G0>p2>CS5`LY>(F);y~y)SVOW(%1_O_pf1=mQUXu+b-ViGJtyN&puFW{D>`zjMAn z=lgTN?|$oV(Q;zd!3=Jp)Nx5$@Frf4Y`(trA z8Ixnlfn-RPhvET$Na>Hq`-1X74;fEo=hS>yTpk}kDa!v-5M$Bka#-|?ou2Fw2Yr1$ zSq%8)Az2Q{qUQxQA)Zo-RlXM^CZrB`6K+BY85=oH`(}sygGhet6d8B-Jc{1K_cOTA zRyDW)a&y~s{E%LbsJGuq;gC*_sJG9_lzK=fN7I8J9FM_kw*JRC^dk3~9eA}9D?HuM&!M$$TQf{IcRm=4-IfN!8-7ItW?vkwoxmMC>gjy`C#0xp6VXH` zKior{;dcqbuLvSigd}j&DR!fEHSDNm*LwE6CWv5$hkCrr0%O`4({c{sH{&s>V;xY# z6AYG|Cn-`OscaE zdJQ&Ee;(^jIe}aXi|paLb>AGyD@Lk{>d=_w) z!hM%b=4ykN?gX8tQe|k`Ohd3071q{yNDp^dD)o9uWCuth diff --git a/llvm/test/tools/llvm-profgen/Inputs/recursion-compression-pseudoprobe.perfbin b/llvm/test/tools/llvm-profgen/Inputs/recursion-compression-pseudoprobe.perfbin index a3dbda2f0b3ecf6905368f3fe3b81f9c34adba7c..0bed867a94e4fd16c293c05e5afbf3e9f0b9425d 100755 GIT binary patch delta 2911 zcmcIlZERCj7=F)fZ`ZC}+qGM73#_~Qi2DHg&1g4LwqY_q797OkVho`zE$bZX*g6z3 zS(z~b4RQFY7=IY}VI*K8OZ5+l#wkDG$54!DB8k~F=p-7MCWfd4-*bD1V=-}I^Q8AV z?|Yu-ydSqG=Z^QCJ<7)G1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zSkV5oy-;SpO#G3J7cyPMCE2(i_E~j1#PfK)59P#*Gx3a_B(oAmaZEP8h~f5=GszH* zvh zdGKZP;Oad1Wpi)|5I1`tUbxu_<4_5rHRm{E{ON*uqC4gfK8+C{cHo-8#~gSg_dh$H z*bYov;gE7%_q~9l|C0_s`?>wx`ST0FbM3*ZDFA+CWU=d9i zJ$;GJNS_f+Cz2^6GC0H_k{{?Z(`Hnw3$D2;w~^5ui^q&eG8x%pnDKNH0)b?t-!!6w z{r!7@V$%$;OlO&5d|?>tTSJ?gjHb+7TpsEvL(|= zt3)j3vJ?Z#l4f572_iSpmu4Dop$1v4Cjn|27II9(>kdW}m3_kiG~&|nxCE+hM4LNRS1We&pZg!N)4Oe-@5_I3zJX6IlJ z%!uv;NT$?>P`+q$Y;a&^zDZUM&Q%F=FwV&)r?f@Iy zyCGedb)-Q&%mq^|F{k|kW<8KW-^A|_{0_mVep3C^9>TvV`1Qge?LQ3(KJ8Z_ANQ!7 z{BHqkXVokAizOPkdRe+de(iB!KT)PgGF9g7eVOd!4@%d;^PTR%v@E;a@ zY@aZ%s6B>HUMxN1A((&7`1s@zecB1-p~4uV5v{{i4kN=*O& diff --git a/llvm/test/tools/llvm-profgen/Inputs/truncated-pseudoprobe.perfscript b/llvm/test/tools/llvm-profgen/Inputs/truncated-pseudoprobe.perfscript index 5b44658..d24c5ad 100644 --- a/llvm/test/tools/llvm-profgen/Inputs/truncated-pseudoprobe.perfscript +++ b/llvm/test/tools/llvm-profgen/Inputs/truncated-pseudoprobe.perfscript @@ -1,5 +1,5 @@ PERF_RECORD_MMAP2 1664112/1664112: [0x400000(0x1000) @ 0 08:11 806256818 82060973]: r-xp truncated-pseudoprobe.perfbin - 40057d - 4005b9 + 40060d + 400659 7f67469af555 - 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 0x40059f/0x400553/P/-/-/0 + 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 0x40062f/0x4005e3/P/-/-/0 diff --git a/llvm/test/tools/llvm-profgen/Inputs/unique-linkage-name-probe.perfbin b/llvm/test/tools/llvm-profgen/Inputs/unique-linkage-name-probe.perfbin index 124b1f435ed3bd7c8f7d719519f856c1585a7df1..f203f01e54d1877a1915e168299781ac010ea905 100755 GIT binary patch delta 3095 zcmcImYitx%6h3!$XJ1p6eY88fEiBWu*mj}Yo!#j^z?4EFrG^A44UY{Gwxw%VC@ZuT ziNX_v4{x`z+~iT)VWB0J9?){B{#<&SsztNefoL?>Kah>3 zKw2XoVv#S?Gx3uv4wkBB~OL#-h=5EQKF9mAU^` z07%HZwM@Xf&Rbp!lo|u*ULLl10Pvu@5zQ_yw-#{Cg0+QhE^@*Q4=dO7_VujX1P{62 zSA7caV64>pNOs|M_X2x`!8T_DHaRuaoV9579OO|=cxD`x&-z+^cAFR&yVzLhe|P^BC%v5kxpyLR6LPLX$ehB zCzG*QT-CH>G?7rF$y6$qOlyCAd*F6r+r-U>)aW<`^Kd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jcDi3m%rVPj`pr&~n`4s4^qZBWPnlzq$MYk0 z=R$JA9`9FD|-LQD#V#b8j9q{v^t z?7bREzJ2K~G&!V56_X&#=5Chuz`$fY70I9 zV>!ZLp{)bD;Nq!>?m%ZO08SvWVE`m-u$N>5ji8y0mDFma9*Esf!DuQ*d4+oQeF12O zj?O@zGWP&pfNp7`s-DjVGIrE-Bc8M3^(~-T@rEuK%*O!MLf7s&ge$OdIVjjhGaBJv zbrEqN>#=rITVEM1tC~7lXaT2na*8eqt}(bElld0Nv?%jZa4yw!_g`zufxA`{La^`9 z4wOc7+-rjmZZ?!dfx+yE5_ox7Ne4Er_HB@JL+aB3FGp&tlF^=#ypqcYDELNm%0x0t z-<7zcS<;!|bjC+F_=Mui$Ri3$XY%CBrsdspedikC3y7ik6Nv70G>LX1I5_ABm>eVG z$>GJd^GY6IgXLk0i)<(-7Z=a>jQUxt$+D0&n?P8_n%h|P9Lt#uc4Ax-egwN_No;D7 zu~2I&IG6%57wpzo&6eUxHX>Z;XAW5nhmf(r7SAQdxbP%Xya71S5PZrO9HxQ+1Vdrb z+~TP}0zi70>KTX6!Qh|Cg1`+tLn?&;_K|kMh1=l)D zB1hwF_6AuHba@nD8ODx|>hH7~7GQ|11NK|UTZL@skj~OjwEaQ$0DDts1)Wti5;5c? zux4=PQ7tbhIuh?% W#!T0f54)C?6&f`DHcPIz&i@Cpj{b%K diff --git a/llvm/test/tools/llvm-profgen/fname-canonicalization.test b/llvm/test/tools/llvm-profgen/fname-canonicalization.test index 5e7ec51..79789a4 100644 --- a/llvm/test/tools/llvm-profgen/fname-canonicalization.test +++ b/llvm/test/tools/llvm-profgen/fname-canonicalization.test @@ -18,9 +18,9 @@ ; CHECK-PROBE-FNAME: 3: 15 ; CHECK-PROBE-FNAME: 4: 15 ; CHECK-PROBE-FNAME: 6: 15 -; CHECK-PROBE-FNAME: 8: 15 _ZL3barii.__uniq.26267048767521081047744692097241227776:15 +; CHECK-PROBE-FNAME: 8: 15 _ZL3barii.__uniq.276699478366846449772231447066107882794:15 ; CHECK-PROBE-FNAME: !CFGChecksum: 563088904013236 -; CHECK-PROBE-FNAME:[main:2 @ foo:8 @ _ZL3barii.__uniq.26267048767521081047744692097241227776]:30:15 +; CHECK-PROBE-FNAME:[main:2 @ foo:8 @ _ZL3barii.__uniq.276699478366846449772231447066107882794]:30:15 ; CHECK-PROBE-FNAME: 1: 15 ; CHECK-PROBE-FNAME: 4: 15 ; CHECK-PROBE-FNAME: !CFGChecksum: 72617220756 diff --git a/llvm/test/tools/llvm-profgen/inline-cs-dangling-pseudoprobe.test b/llvm/test/tools/llvm-profgen/inline-cs-dangling-pseudoprobe.test deleted file mode 100644 index 801de3b..0000000 --- a/llvm/test/tools/llvm-profgen/inline-cs-dangling-pseudoprobe.test +++ /dev/null @@ -1,54 +0,0 @@ -; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-dangling-pseudoprobe.perfscript --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --output=%t --show-unwinder-output --profile-summary-cold-count=0 | FileCheck %s --check-prefix=CHECK-UNWINDER -; RUN: FileCheck %s --input-file %t - -; CHECK: [main:2 @ foo]:58:0 -; CHECK-NEXT: 1: 0 -; CHECK-NEXT: 2: 15 -; CHECK-NEXT: 3: 14 -; CHECK-NEXT: 4: 0 -; CHECK-NEXT: 5: 14 -; CHECK-NEXT: 6: 15 -; CHECK-NEXT: 7: 0 -; CHECK-NEXT: 9: 0 -; CHECK-NEXT: !CFGChecksum: 138950591924 -; CHECK:[main:2 @ foo:8 @ bar]:1:0 -; CHECK-NEXT: 1: 0 -; CHECK-NEXT: 4: 1 -; CHECK-NEXT: !CFGChecksum: 72617220756 - - -; CHECK-UNWINDER: Binary(inline-cs-pseudoprobe.perfbin)'s Range Counter: -; CHECK-UNWINDER-EMPTY: -; CHECK-UNWINDER-NEXT: (800, 82b): 14 -; CHECK-UNWINDER-NEXT: (84d, 858): 1 - -; CHECK-UNWINDER: Binary(inline-cs-pseudoprobe.perfbin)'s Branch Counter: -; CHECK-UNWINDER-EMPTY: -; CHECK-UNWINDER-NEXT: (82b, 800): 14 -; CHECK-UNWINDER-NEXT: (82b, 84d): 1 -; CHECK-UNWINDER-NEXT: (858, 80e): 1 - -; clang -O3 -fexperimental-new-pass-manager -fuse-ld=lld -fpseudo-probe-for-profiling -; -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Xclang -mdisable-tail-calls -; -g test.c -o a.out - -#include - -int bar(int x, int y) { - if (x % 3) { - return x - y; - } - return x + y; -} - -void foo() { - int s, i = 0; - while (i++ < 4000 * 4000) - if (i % 91) s = bar(i, s); else s += 30; - printf("sum is %d\n", s); -} - -int main() { - foo(); - return 0; -} diff --git a/llvm/test/tools/llvm-profgen/inline-cs-pseudoprobe.test b/llvm/test/tools/llvm-profgen/inline-cs-pseudoprobe.test index 2d23ff4..d62c8c3 100644 --- a/llvm/test/tools/llvm-profgen/inline-cs-pseudoprobe.test +++ b/llvm/test/tools/llvm-profgen/inline-cs-pseudoprobe.test @@ -11,7 +11,7 @@ ; CHECK-NEXT: 7: 0 ; CHECK-NEXT: 8: 14 bar:14 ; CHECK-NEXT: 9: 0 -; CHECK-NEXT: !CFGChecksum: 138950591924 +; CHECK-NEXT: !CFGChecksum: 563088904013236 ; CHECK:[main:2 @ foo:8 @ bar]:28:14 ; CHECK-NEXT: 1: 14 ; CHECK-NEXT: 4: 14 diff --git a/llvm/test/tools/llvm-profgen/merge-cold-profile.test b/llvm/test/tools/llvm-profgen/merge-cold-profile.test index 7e975a9..018cd15 100644 --- a/llvm/test/tools/llvm-profgen/merge-cold-profile.test +++ b/llvm/test/tools/llvm-profgen/merge-cold-profile.test @@ -22,7 +22,7 @@ ; CHECK-NEXT: 6: 0 ; CHECK-NEXT: 7: 2 fb:2 ; CHECK-NEXT: 8: 1 fa:1 -; CHECK-NEXT: !CFGChecksum: 120515930909 +; CHECK-NEXT: !CFGChecksum: 563070469352221 ; CHECK-NEXT: !Attributes: 0 ; CHECK-NEXT:[main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb]:13:4 ; CHECK-NEXT: 1: 4 @@ -31,7 +31,7 @@ ; CHECK-NEXT: 4: 0 ; CHECK-NEXT: 5: 4 fb:4 ; CHECK-NEXT: 6: 1 fa:1 -; CHECK-NEXT: !CFGChecksum: 72617220756 +; CHECK-NEXT: !CFGChecksum: 563022570642068 ; CHECK-KEEP-COLD: [fb]:19:6 ; CHECK-KEEP-COLD-NEXT: 1: 6 @@ -40,7 +40,7 @@ ; CHECK-KEEP-COLD-NEXT: 4: 0 ; CHECK-KEEP-COLD-NEXT: 5: 4 fb:4 ; CHECK-KEEP-COLD-NEXT: 6: 3 fa:3 -; CHECK-KEEP-COLD-NEXT: !CFGChecksum: 72617220756 +; CHECK-KEEP-COLD-NEXT: !CFGChecksum: 563022570642068 ; CHECK-KEEP-COLD-NEXT: !Attributes: 0 ; CHECK-KEEP-COLD-NEXT:[fa]:14:4 ; CHECK-KEEP-COLD-NEXT: 1: 4 @@ -50,7 +50,7 @@ ; CHECK-KEEP-COLD-NEXT: 6: 0 ; CHECK-KEEP-COLD-NEXT: 7: 2 fb:2 ; CHECK-KEEP-COLD-NEXT: 8: 1 fa:1 -; CHECK-KEEP-COLD-NEXT: !CFGChecksum: 120515930909 +; CHECK-KEEP-COLD-NEXT: !CFGChecksum: 563070469352221 ; CHECK-UNMERGED: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb]:13:4 ; CHECK-UNMERGED-NEXT: 1: 4 @@ -59,7 +59,7 @@ ; CHECK-UNMERGED-NEXT: 4: 0 ; CHECK-UNMERGED-NEXT: 5: 4 fb:4 ; CHECK-UNMERGED-NEXT: 6: 1 fa:1 -; CHECK-UNMERGED-NEXT: !CFGChecksum: 72617220756 +; CHECK-UNMERGED-NEXT: !CFGChecksum: 563022570642068 ; CHECK-UNMERGED-NOT: [fa] ; CHECK-UNMERGED-NOT: [fb] @@ -70,7 +70,7 @@ ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 4: 0 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 5: 4 fb:4 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 6: 1 fa:1 -; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 72617220756 +; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 563022570642068 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: !Attributes: 0 ; CHECK-COLD-CONTEXT-LENGTH-NEXT:[fb:6 @ fa]:10:3 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 1: 3 @@ -80,7 +80,7 @@ ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 6: 0 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 7: 1 fb:1 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 8: 1 fa:1 -; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 120515930909 +; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 563070469352221 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: !Attributes: 0 ; CHECK-COLD-CONTEXT-LENGTH-NEXT:[fa:7 @ fb]:6:2 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 1: 2 @@ -89,7 +89,7 @@ ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 4: 0 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 5: 0 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 6: 2 fa:2 -; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 72617220756 +; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 563022570642068 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: !Attributes: 0 ; CHECK-COLD-CONTEXT-LENGTH-NEXT:[fa:8 @ fa]:4:1 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 1: 1 @@ -99,7 +99,7 @@ ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 6: 0 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 7: 1 fb:1 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: 8: 0 -; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 120515930909 +; CHECK-COLD-CONTEXT-LENGTH-NEXT: !CFGChecksum: 563070469352221 ; CHECK-COLD-CONTEXT-LENGTH-NEXT: !Attributes: 0 ; clang -O3 -fexperimental-new-pass-manager -fuse-ld=lld -fpseudo-probe-for-profiling diff --git a/llvm/test/tools/llvm-profgen/noinline-cs-pseudoprobe.test b/llvm/test/tools/llvm-profgen/noinline-cs-pseudoprobe.test index 7dc968e..4e43446 100644 --- a/llvm/test/tools/llvm-profgen/noinline-cs-pseudoprobe.test +++ b/llvm/test/tools/llvm-profgen/noinline-cs-pseudoprobe.test @@ -11,7 +11,7 @@ ; CHECK-NEXT: 7: 0 ; CHECK-NEXT: 8: 15 bar:15 ; CHECK-NEXT: 9: 0 -; CHECK-NEXT: !CFGChecksum: 138950591924 +; CHECK-NEXT: !CFGChecksum: 563088904013236 ; CHECK:[main:2 @ foo:8 @ bar]:30:15 ; CHECK-NEXT: 1: 15 ; CHECK-NEXT: 4: 15 diff --git a/llvm/test/tools/llvm-profgen/pseudoprobe-decoding.test b/llvm/test/tools/llvm-profgen/pseudoprobe-decoding.test index a81842d..45be13c 100644 --- a/llvm/test/tools/llvm-profgen/pseudoprobe-decoding.test +++ b/llvm/test/tools/llvm-profgen/pseudoprobe-decoding.test @@ -4,9 +4,9 @@ PERF_RECORD_MMAP2 2854748/2854748: [0x400000(0x1000) @ 0 00:1d 123291722 526021] ; CHECK: Pseudo Probe Desc: ; CHECK: GUID: 6699318081062747564 Name: foo -; CHECK: Hash: 138950591924 +; CHECK: Hash: 563088904013236 ; CHECK: GUID: 15822663052811949562 Name: main -; CHECK: Hash: 4294967295 +; CHECK: Hash: 281479271677951 ; CHECK: GUID: 16434608426314478903 Name: bar ; CHECK: Hash: 72617220756 @@ -15,16 +15,9 @@ PERF_RECORD_MMAP2 2854748/2854748: [0x400000(0x1000) @ 0 00:1d 123291722 526021] ; CHECK: : ; CHECK: [Probe]: FUNC: bar Index: 1 Type: Block +; CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block ; CHECK-NEXT: 754: imull $2863311531, %edi, %eax -; CHECK: [Probe]: FUNC: bar Index: 2 Type: Block Dangling -; CHECK-NEXT: [Probe]: FUNC: bar Index: 3 Type: Block Dangling -; CHECK-NEXT: 768: cmovbl %esi, %ecx - -; CHECK: [Probe]: FUNC: bar Index: 4 Type: Block -; CHECK-NEXT: 76e: popq %rbp - - ; CHECK: : ; CHECK: [Probe]: FUNC: foo Index: 1 Type: Block ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block @@ -37,20 +30,17 @@ PERF_RECORD_MMAP2 2854748/2854748: [0x400000(0x1000) @ 0 00:1d 123291722 526021] ; CHECK-NEXT: 783: addl $1, %ecx ; CHECK: [Probe]: FUNC: foo Index: 3 Type: Block -; CHECK-NEXT: 7a9: cmpl %eax, %ecx +; CHECK-NEXT: 78e: movl %ecx, %edx ; CHECK: [Probe]: FUNC: foo Index: 4 Type: Block ; CHECK-NEXT: [Probe]: FUNC: bar Index: 1 Type: Block Inlined: @ foo:8 +; CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ foo:8 ; CHECK-NEXT: 7bf: addl %ecx, %edx -; CHECK: [Probe]: FUNC: bar Index: 2 Type: Block Dangling Inlined: @ foo:8 -; CHECK-NEXT: [Probe]: FUNC: bar Index: 3 Type: Block Dangling Inlined: @ foo:8 -; CHECK-NEXT: 7c8: cmovel %esi, %eax -; CHECK: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ foo:8 -; CHECK-NEXT: 7cd: movl %eax, %esi ; CHECK: [Probe]: FUNC: foo Index: 6 Type: Block ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block +; CHECK-NEXT: 7cf: addl $1, %ecx ; CHECK: [Probe]: FUNC: foo Index: 7 Type: Block ; CHECK-NEXT: 7de: movl $2098432, %edi @@ -72,18 +62,13 @@ PERF_RECORD_MMAP2 2854748/2854748: [0x400000(0x1000) @ 0 00:1d 123291722 526021] ; CHECK-NEXT: 803: addl $1, %ecx ; CHECK: [Probe]: FUNC: foo Index: 3 Type: Block Inlined: @ main:2 -; CHECK-NEXT: 829: cmpl %eax, %ecx +; CHECK-NEXT: 80e: movl %ecx, %edx ; CHECK: [Probe]: FUNC: foo Index: 4 Type: Block Inlined: @ main:2 ; CHECK-NEXT: [Probe]: FUNC: bar Index: 1 Type: Block Inlined: @ main:2 @ foo:8 +; CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ main:2 @ foo:8 ; CHECK-NEXT: 83f: addl %ecx, %edx -; CHECK: [Probe]: FUNC: bar Index: 2 Type: Block Dangling Inlined: @ main:2 @ foo:8 -; CHECK-NEXT: [Probe]: FUNC: bar Index: 3 Type: Block Dangling Inlined: @ main:2 @ foo:8 -; CHECK-NEXT: 848: cmovel %esi, %eax - -; CHECK: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ main:2 @ foo:8 -; CHECK-NEXT: 84d: movl %eax, %esi ; CHECK: [Probe]: FUNC: foo Index: 6 Type: Block Inlined: @ main:2 ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2 ; CHECK-NEXT: 84f: addl $1, %ecx diff --git a/llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test b/llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test index dcf39f0..b214a46 100644 --- a/llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test +++ b/llvm/test/tools/llvm-profgen/recursion-compression-pseudoprobe.test @@ -9,56 +9,56 @@ ; CHECK-UNCOMPRESS: 3: 1 ; CHECK-UNCOMPRESS: 4: 1 ; CHECK-UNCOMPRESS: 7: 1 fb:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 120515930909 +; CHECK-UNCOMPRESS: !CFGChecksum: 563070469352221 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:6 @ fa:8 @ fa]:4:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 3: 1 ; CHECK-UNCOMPRESS: 4: 1 ; CHECK-UNCOMPRESS: 7: 1 fb:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 120515930909 +; CHECK-UNCOMPRESS: !CFGChecksum: 563070469352221 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:6 @ fa]:4:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 3: 1 ; CHECK-UNCOMPRESS: 5: 1 ; CHECK-UNCOMPRESS: 8: 1 fa:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 120515930909 +; CHECK-UNCOMPRESS: !CFGChecksum: 563070469352221 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:6 @ fa:8 @ fa:7 @ fb:6 @ fa:7 @ fb]:3:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 3: 1 ; CHECK-UNCOMPRESS: 6: 1 fa:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 72617220756 +; CHECK-UNCOMPRESS: !CFGChecksum: 563022570642068 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:6 @ fa:8 @ fa:7 @ fb]:3:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 3: 1 ; CHECK-UNCOMPRESS: 6: 1 fa:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 72617220756 +; CHECK-UNCOMPRESS: !CFGChecksum: 563022570642068 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb]:3:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 3: 1 ; CHECK-UNCOMPRESS: 6: 1 fa:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 72617220756 +; CHECK-UNCOMPRESS: !CFGChecksum: 563022570642068 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb]:3:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 2: 1 ; CHECK-UNCOMPRESS: 5: 1 fb:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 72617220756 +; CHECK-UNCOMPRESS: !CFGChecksum: 563022570642068 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb]:3:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 2: 1 ; CHECK-UNCOMPRESS: 5: 1 fb:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 72617220756 +; CHECK-UNCOMPRESS: !CFGChecksum: 563022570642068 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb]:3:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 2: 1 ; CHECK-UNCOMPRESS: 5: 1 fb:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 72617220756 +; CHECK-UNCOMPRESS: !CFGChecksum: 563022570642068 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb:6 @ fa:8 @ fa:7 @ fb:6 @ fa:7 @ fb:6 @ fa]:2:1 ; CHECK-UNCOMPRESS: 1: 1 ; CHECK-UNCOMPRESS: 3: 1 -; CHECK-UNCOMPRESS: !CFGChecksum: 120515930909 +; CHECK-UNCOMPRESS: !CFGChecksum: 563070469352221 ; CHECK-UNCOMPRESS: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:5 @ fb:5 @ fb:5 @ fb]:1:0 ; CHECK-UNCOMPRESS: 5: 1 fb:1 -; CHECK-UNCOMPRESS: !CFGChecksum: 72617220756 +; CHECK-UNCOMPRESS: !CFGChecksum: 563022570642068 ; CHECK: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb]:13:4 @@ -67,35 +67,35 @@ ; CHECK: 3: 1 ; CEHCK: 5: 4 fb:4 ; CHECK: 6: 1 fa:1 -; CHECK !CFGChecksum: 72617220756 +; CHECK !CFGChecksum: 563022570642068 ; CHECK: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:6 @ fa:8 @ fa:7 @ fb:6 @ fa]:6:2 ; CHECK: 1: 2 ; CHECK: 3: 2 ; CHECK: 4: 1 ; CHECK: 7: 1 fb:1 -; CHECK: !CFGChecksum: 120515930909 +; CHECK: !CFGChecksum: 563070469352221 ; CHECK: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:6 @ fa:8 @ fa]:4:1 ; CHECK: 1: 1 ; CHECK: 3: 1 ; CHECK: 4: 1 ; CHECK: 7: 1 fb:1 -; CHECK: !CFGChecksum: 120515930909 +; CHECK: !CFGChecksum: 563070469352221 ; CHECK: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:6 @ fa]:4:1 ; CHECK: 1: 1 ; CHECK: 3: 1 ; CHECK: 5: 1 ; CHECK: 8: 1 fa:1 -; CHECK: !CFGChecksum: 120515930909 +; CHECK: !CFGChecksum: 563070469352221 ; CHECK: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:6 @ fa:8 @ fa:7 @ fb:6 @ fa:7 @ fb]:3:1 ; CHECK: 1: 1 ; CHECK: 3: 1 ; CHECK: 6: 1 fa:1 -; CHECK: !CFGChecksum: 72617220756 +; CHECK: !CFGChecksum: 563022570642068 ; CHECK: [main:2 @ foo:5 @ fa:8 @ fa:7 @ fb:5 @ fb:6 @ fa:8 @ fa:7 @ fb]:3:1 ; CHECK: 1: 1 ; CHECK: 3: 1 ; CHECK: 6: 1 fa:1 -; CHECK: !CFGChecksum: 72617220756 +; CHECK: !CFGChecksum: 563022570642068 diff --git a/llvm/tools/llvm-profgen/ProfileGenerator.cpp b/llvm/tools/llvm-profgen/ProfileGenerator.cpp index e0a3193..861dd17 100644 --- a/llvm/tools/llvm-profgen/ProfileGenerator.cpp +++ b/llvm/tools/llvm-profgen/ProfileGenerator.cpp @@ -524,14 +524,11 @@ void PseudoProbeCSProfileGenerator::populateBodySamplesWithProbes( for (auto PI : ProbeCounter) { const PseudoProbe *Probe = PI.first; uint64_t Count = PI.second; - // Ignore dangling probes since they will be reported later if needed. - if (Probe->isDangling()) - continue; FunctionSamples &FunctionProfile = getFunctionProfileForLeafProbe(ContextStrStack, Probe, Binary); // Record the current frame and FunctionProfile whenever samples are // collected for non-danglie probes. This is for reporting all of the - // dangling probes of the frame later. + // zero count probes of the frame later. FrameSamples[Probe->getInlineTreeNode()] = &FunctionProfile; FunctionProfile.addBodySamplesForProbe(Probe->Index, Count); FunctionProfile.addTotalSamples(Count); @@ -568,7 +565,6 @@ void PseudoProbeCSProfileGenerator::populateBodySamplesWithProbes( for (auto &I : FrameSamples) { auto *FunctionProfile = I.second; for (auto *Probe : I.first->getProbes()) { - if (!Probe->isDangling()) FunctionProfile->addBodySamplesForProbe(Probe->Index, 0); } } diff --git a/llvm/tools/llvm-profgen/PseudoProbe.cpp b/llvm/tools/llvm-profgen/PseudoProbe.cpp index b949661..02af3f0 100644 --- a/llvm/tools/llvm-profgen/PseudoProbe.cpp +++ b/llvm/tools/llvm-profgen/PseudoProbe.cpp @@ -88,12 +88,7 @@ void PseudoProbe::print(raw_ostream &OS, } OS << "Index: " << Index << " "; OS << "Type: " << PseudoProbeTypeStr[static_cast(Type)] << " "; - if (isDangling()) { - OS << "Dangling "; - } - if (isTailCall()) { - OS << "TailCall "; - } + std::string InlineContextStr = getInlineContextStr(GUID2FuncMAP, ShowName); if (InlineContextStr.size()) { OS << "Inlined: @ "; @@ -189,7 +184,7 @@ void PseudoProbeDecoder::buildAddress2ProbeMap(const uint8_t *Start, // TYPE (uint4) // 0 - block probe, 1 - indirect call, 2 - direct call // ATTRIBUTE (uint3) - // 1 - tail call, 2 - dangling + // 1 - reserved // ADDRESS_TYPE (uint1) // 0 - code address, 1 - address delta // CODE_ADDRESS (uint64 or ULEB128) diff --git a/llvm/tools/llvm-profgen/PseudoProbe.h b/llvm/tools/llvm-profgen/PseudoProbe.h index 4c75868..62d46d3 100644 --- a/llvm/tools/llvm-profgen/PseudoProbe.h +++ b/llvm/tools/llvm-profgen/PseudoProbe.h @@ -24,7 +24,7 @@ namespace llvm { namespace sampleprof { -enum PseudoProbeAttributes { TAILCALL = 1, DANGLING = 2 }; +enum PseudoProbeAttributes { RESERVED = 1 }; // Use func GUID and index as the location info of the inline site using InlineSite = std::tuple; @@ -102,7 +102,7 @@ A pseudo probe has the format like below: TYPE (uint4) 0 - block probe, 1 - indirect call, 2 - direct call ATTRIBUTE (uint3) - 1 - tail call, 2 - dangling + 1 - reserved ADDRESS_TYPE (uint1) 0 - code address, 1 - address delta CODE_ADDRESS (uint64 or ULEB128) @@ -124,15 +124,6 @@ struct PseudoProbe { InlineTree(Tree){}; bool isEntry() const { return Index == PseudoProbeFirstId; } - - bool isDangling() const { - return Attribute & static_cast(PseudoProbeAttributes::DANGLING); - } - - bool isTailCall() const { - return Attribute & static_cast(PseudoProbeAttributes::TAILCALL); - } - bool isBlock() const { return Type == PseudoProbeType::Block; } bool isIndirectCall() const { return Type == PseudoProbeType::IndirectCall; } bool isDirectCall() const { return Type == PseudoProbeType::DirectCall; } -- 2.7.4