Maybe I should say Compiler Explorer instead of Godbolt. This should be mandatory for any programming environment, along with a CPU emulator showing how data moves through the ALU, and all the ports, to which registers it goes to, and how everything works clock by clock. I hope AI makes this possible, at least for VS Code and C++.
i don't think IHVs would give out the RTL required for this to be possible, and it would also require a ton of compute to simulate it. TDA will be the best you can get reasonably.
Yeah there is so much to do on the visualization side! I know people who still draw these things on paper and count cycles by hand.
Modern cores are quite wide, I don’t know if my monitor is big enough to show this info for all the in-flight instructions…
When I program, I imagine the registers and ports. Only the ones I use. I see the sequence of micro-ops moving like in a queue, the stack in a different column, and the L1 cache as neighboring lines. That could be drawn. The parts not involved could be drawn in miniature, like the AVX2 hardware. More detail could be shown if the user clicks. It probably isn't as complex to draw.
1 reply
Does that give good results? I try to push the computations involve in the critical path up as high as possible, and then just hope that between the compiler and hardware somebody’ll take advantage of that. I haven’t tuned a ton of kernels though, I mostly do linear algebra stuff and good BLAS implementations do better than I could hope to.