On Mon, 3 Jul 2023, Andre Vieira (lists) wrote: > Hi, > > This patch makes the vectorizer treat any vector widening IFN as simple, like > it did with the tree codes VEC_WIDEN_*. > > I wasn't sure whether I should make all IFN's simple and then exclude some > (like GOMP_ ones), or include more than just the new widening IFNs. But since > this is the only behaviour that changed with the ifn patch, I decided to only > special case the widening IFNs for now. Let me know if you have different > thoughts on this. > > Bootstrapped and regression tested on aarch64-unknow-linux-gnu.
But could we expand all VEC_WIDEN_* with scalar operands properly? Can we do that for the IFNs? I think that's what we will end up doing then? How do we end up with !STMT_VINFO_LIVE_P here anyway? vectorizable_live_operation does /* If STMT is not relevant and it is a simple assignment and its inputs are invariant then it can remain in place, unvectorized. The original last scalar value that it computes will be used. */ if (!STMT_VINFO_RELEVANT_P (stmt_info)) { gcc_assert (is_simple_and_all_uses_invariant (stmt_info, loop_vinfo)); if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location, "statement is simple and uses invariant. Leaving in " "place.\n"); return true; > gcc/ChangeLog: > > PR tree-optimization/110436 > * tree-vect-stmts.cc (is_simple_and_all_uses_invariant): Treat > widening > IFN's as simple. > > gcc/testsuite/ChangeLog: > > * gcc.dg/pr110436.c: New test. > -- Richard Biener <rguent...@suse.de> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)