RFR: 8210416: [linux] Poor StrictMath performance due to non-optimized compilation
sgehwolf at redhat.com
Mon Sep 10 12:40:50 UTC 2018
On Fri, 2018-09-07 at 10:19 -0700, Erik Joelsson wrote:
> On 2018-09-07 09:56, Severin Gehwolf wrote:
> > On Fri, 2018-09-07 at 09:12 -0700, Erik Joelsson wrote:
> > > To me it sounds like we want this flag if the toolchain is either gcc or
> > > clang, so please make it conditional on that.
> > Updated webrev:
> > http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8210416/webrev.02/
> > It now only sets FDLIBM_CFLAGS if gcc supports it and builds fdlibm
> > without opt if not. Otherwise it uses -O3 and -ffp-contract=off. If the
> > toolchain is clang and on linux it always uses -O3 and -ffp-
> > contract=off. The reason, I've done this in configure is a potential
> > follow-up fix for hotspot via JDK-8210425 where the CFLAGS could get
> > re-used. Thoughts?
> Instead of checking for compiler version, you could simply use the
> FLAGS_COMPILER_CHECK_ARGUMENTS macro. This would apply to both gcc and
> clang. We usually prefer this over version checks (unless a version is
> just known to be unstable with a certain flag, in which case a
> capability check will not work).
> 43: I think "with" is superfluous
> Otherwise I think this looks like the right direction.
Latest webrev with Andrew Haley's suggestion to use -O2. I'm observing
similar performance numbers than -O3. I haven't changed to the
FLAGS_COMPILER_CHECK_ARGUMENTS macro as I'm not clear this is safe to
do at this point without breaking cross-compilation:
More information about the core-libs-dev