[PATCH] D91017: [BranchProbabilityInfo] Use SmallVector (NFC)

Andrew Trick via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 21:22:18 PST 2020


atrick added a comment.

I won't weigh in decisively, but it does look like a positive change to me.

When it comes to designing for compile time and memory usage, it's more important to protect against the worst-case (pathological input) than streamlining the average case--there's typically one straggler function that takes excessive time while the rest can be easily parallelized. That was the motivation behind avoiding allocations that may scale with the function size.

On the other hand, the worst-case with this change--a very large number of switches in the same function---seems truly pathological, and the consequence is not so bad--it's just a linear increase in allocations and memory.

When in doubt, the simpler implementation should be preferred.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91017



More information about the llvm-commits mailing list