This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][i386] Fix scalar costing in ix86_add_stmt_cost
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Richard Guenther <rguenther at suse dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Sun, 7 Oct 2018 05:53:15 -0700
- Subject: Re: [PATCH][i386] Fix scalar costing in ix86_add_stmt_cost
- References: <alpine.LSU.2.20.1810041131590.16707@zhemvz.fhfr.qr> <20181005112917.GA63936@kam.mff.cuni.cz>
On Fri, Oct 5, 2018 at 4:29 AM Jan Hubicka <hubicka@ucw.cz> wrote:
>
> >
> > The following fixes bogus differences in scalar iteration cost
> > computed by the vectorizer when comparing 128 and 256 bit vectorizations.
> > This was caused by the hook looking at the vector types mode even
> > for kind == scalar_stmt and thus returning vector operation costs
> > for things like add or negate.
> >
> > This is most noticable on targets where ix86_vec_cost applies
> > multiplication based on vector size (TARGET_AVX128_OPTIMAL, thus
> > Zen and Bulldozer). But it will also adjust the actual costs
> > everywhere where scalar and vector costs diverge.
> >
> > The adjustments done for Silvermont also look broken since they
> > are applied to both scalar and vector cost which makes it mostly
> > a no-op. The patch adjusts it to only apply for vector costing
> > but of course I didn't benchmark this and the magic number of 1.7
> > may not make sense after this fix so I'm happy to leave that
> > out - Kirill? Should I just go ahead with that for trunk (we can
> > revert or adjust if autotesters pick up regressions on your side)?
> >
> > Bootstrap & regtest running on x86_64-unknown-linux-gnu, OK?
> >
> > Richard.
> >
> > 2018-10-04 Richard Biener <rguenther@suse.de>
> >
> > * config/i386/i386.c (ix86_add_stmt_cost): When scalar cost
> > is asked for initialize mode to the component mode of the
> > vector type. Make sure Bonnel and esp. other Atom cost
> > adjustments are not done for scalar cost estimates.
> OK,
This caused:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87545
--
H.J.