Starting with the revision we lost about ~5 on Zen wit -O2 -mtune=native.
Created attachment 42520 [details] perf annotate
Created attachment 42521 [details] perf report
Created attachment 42522 [details] perf diff
Created attachment 42523 [details] perf annotate
Created attachment 42524 [details] perf report
Can't be reproduced on Haswell.
GCC 7.3 is being released, adjusting target milestone.
This is a code layout issue with Zens (and a very quirky one, it is sometimes measurable and sometimes not, depending how the function happens to be placed on a particular system) and probably nothing that GCC can help with.