[llvm] [memprof] Use std::vector<Frame> instead of llvm::SmallVector<Frame> (NFC) (PR #94432)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 08:12:00 PDT 2024


teresajohnson wrote:

> This patch replaces llvm::SmallVector with std::vector.
> 
> llvm::SmallVector sets aside one inline element.

I thought it allocated a few elements (I guess more than 2 from what you found below)?

> Meanwhile, when I sort all call stacks by their lengths, the length at the first percentile is already 2. That is, 99 percent of call stacks do not take advantage of the inline element.

I'm surprised that almost all are <=2: the allocation call contexts should almost always be longer than 2 frames in practice. Is this dominated by the CallSites frames? I can imagine those are short. Maybe that should use std::vector (or SmallVector<...,0>), and the AllocationInfo CallStack remain SmallVector?

https://github.com/llvm/llvm-project/pull/94432


More information about the llvm-commits mailing list