Post looking at BTB behavior and size

By: Linus Torvalds (torvalds.delete@this.linux-foundation.org), May 11, 2021 10:13 am
Room: Moderated Discussions
Anon (no.delete@this.spam.com) on May 10, 2021 4:43 pm wrote:
>
> I am not sure, but, what if, the uop cache works as a trace cache? I mean,
> if instructions across jmp instruction ends in the same uop cache line?
>
> Sounds as a perfectly valid optimizaion for me.

I don't think people realize how bad trace caches are. The cache content duplication isn't just a random detail, it's fundamental, and it's not small. It might look small if you have huge loop counts in some synthetic benchmark (which is how people benchmarked those things), but that just isn't reality.

I guess the one exception is if you can unroll a loop fully in the uop cache, because (by definition) you then end up with the same beginning/end-point anyway, and the only "duplication" of the uop cache is within that one entry.

But that would catch only truly trivial small loops.

I'd expect that some unaccounted "single core turbo" is the much more likely answer to this particular report.

Of course, if you actually can fetch two lines from the uop cache in one cycle (maybe you did it originally for SMT), and if you can predict two branches in a cycle, maybe you could just stitch together something in the instruction queue and actually get more than one branch per cycle for real. Not a trace cache, but the instruction queue itself is obviously a temporary "trace".

But that does sound very ambitious.

Linus
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Post looking at BTB behavior and sizeTravis Downs2021/05/10 02:57 PM
  Post looking at BTB behavior and sizeAnon2021/05/10 04:43 PM
    Post looking at BTB behavior and sizeTravis Downs2021/05/10 08:59 PM
    Post looking at BTB behavior and sizeLinus Torvalds2021/05/11 10:13 AM
  RKL taken branch throughputChester2021/05/10 05:25 PM
    RKL taken branch throughputTravis Downs2021/05/10 09:00 PM
      RKL taken branch throughputChester2021/05/11 10:04 PM
        RKL taken branch throughputTravis Downs2021/05/14 10:34 PM
          RKL taken branch throughput---2021/05/15 10:07 AM
Reply to this Topic
Name:
Email:
Topic:
Body: No Text
How do you spell tangerine? 🍊