On 30 January 2018 at 11:47, Jakub Jelinek <ja...@redhat.com> wrote: > On Tue, Jan 30, 2018 at 11:07:50AM +0100, Richard Biener wrote: >> >> I have been asked to push this change, fixing (somewhat) the impreciseness >> of costing constant/invariant vector uses in SLP stmts. The previous >> code always just considered a single constant to be generated in the >> prologue irrespective of how many we'd need. With this patch we >> properly handle this count and optimize for the case when we can use >> a vector splat. It doesn't yet handle CSE (or CSE among stmts) which >> means it could in theory regress cases it overall costed correctly >> before "optimistically" (aka by accident). But at least the costing >> now matches code generation. >> >> Bootstrapped and tested on x86_64-unknown-linux-gnu. On x86_64 >> Haswell with AVX2 SPEC 2k6 shows no off-noise changes. >> >> The patch is said to help the case in the PR when additional backend >> costing changes are done (for AVX512). >> >> Ok for trunk at this stage? > > LGTM. > >> 2018-01-30 Richard Biener <rguent...@suse.de> >> >> PR tree-optimization/83008 >> * tree-vect-slp.c (vect_analyze_slp_cost_1): Properly cost >> invariant and constant vector uses in stmts when they need >> more than one stmt. > > Jakub
Hi Richard, This patch caused a regression on aarch64*: FAIL: gcc.dg/cse_recip.c scan-tree-dump-times optimized "rdiv_expr" 1 (found 2 times) we used to have: PASS: gcc.dg/cse_recip.c scan-tree-dump-times optimized "rdiv_expr" 1 Christophe