[PATCH] D45003: [Support] Make line-number cache robust against access patterns.

Graydon Hoare via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 16:45:55 PDT 2018


graydon added a comment.

In https://reviews.llvm.org/D45003#1057871, @probinson wrote:

> In https://reviews.llvm.org/D45003#1055099, @graydon wrote:
>
> > In https://reviews.llvm.org/D45003#1053430, @probinson wrote:
> >
> > > There's commentary in lib/MC/MCParser/AsmParser.cpp about the ungraceful degradation in SourceMgr's cache.  Would this help or simplify what AsmParser is doing?
> >
> >
> > I believe this should eliminate the behaviour those comments describe (and thus remove the need for the code), though I feel a bit under-qualified tinkering with the code there itself. Would you like me to try, or shall I leave it to the owners of that file?
>
>
> If you could have a go at it, that would be great.  It's fine to do it as a follow-up NFC patch.  Or file a bug and cc me.  It's not really my area either but I keep running across that comment and it has always bothered me, maybe enough to do something now.


Ok, after a little staring it seemed clear it was just a small change. I made a synthetic test with 10,000 line-directives and built it with -c -g, both with and without the change, and only saw a 0.1% increase in instructions retired / 1ms increase in time (of 300ms). So I figure this is probably acceptable?


Repository:
  rL LLVM

https://reviews.llvm.org/D45003





More information about the llvm-commits mailing list