[PATCH] D97482: [CSSPGO] Deduplicating dangling pseudo probes.

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 16:28:41 PST 2021


wmi added inline comments.


================
Comment at: llvm/lib/IR/PseudoProbe.cpp:139
+/// multiple copies of them.
+bool removeRedundantPseudoProbes(BasicBlock *Block) {
+
----------------
hoy wrote:
> wmi wrote:
> > If the interface can be changed to collectRedundantPseudoProbes(BasicBlock *Block, SmallVectorImpl<PseudoProbeInst *> &ToBeRemoved), it can be reused by the code above to remove redundent probes for the function.
> > 
> > 
> Thanks for the suggestion. The code above actually handles MIR pseudo probe intrinsics while the code here handles IR intrinsics. I was thinking about sharing them but I feel templated code maybe needed and not sure about the worth of that complexity. What do you think? 
Ah, ok. I didn't notice the difference. It needs some extra header file to include the template and share it with MIR pass. It may not worth it. 


================
Comment at: llvm/test/Transforms/SampleProfile/pseudo-probe-dedup.ll:1-2
+; REQUIRES: x86_64-linux
+; RUN: llc -pseudo-probe-for-profiling %s -filetype=asm -o - | FileCheck %s
+
----------------
Do you need two tests one for IR pass and one for MIR pass?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97482/new/

https://reviews.llvm.org/D97482



More information about the llvm-commits mailing list