https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112962
--- Comment #12 from Hongtao Liu <liuhongt at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #8) > Of course, yet another option is: > --- gcc/config/i386/i386.cc 2023-12-12 08:54:39.821148670 +0100 > +++ gcc/config/i386/i386.cc 2023-12-12 11:07:03.795286363 +0100 > @@ -19377,7 +19377,10 @@ ix86_gimple_fold_builtin (gimple_stmt_it > do_shift: > gcc_assert (n_args >= 2); > if (!gimple_call_lhs (stmt)) > - break; > + { > + gsi_replace (gsi, gimple_build_nop (), false); > + return true; > + } > arg0 = gimple_call_arg (stmt, 0); > arg1 = gimple_call_arg (stmt, 1); > elems = TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg0)); > @@ -19523,7 +19526,10 @@ ix86_gimple_fold_builtin (gimple_stmt_it > case IX86_BUILTIN_PABSD256_MASK: > gcc_assert (n_args >= 1); > if (!gimple_call_lhs (stmt)) > - break; > + { > + gsi_replace (gsi, gimple_build_nop (), false); > + return true; > + } > arg0 = gimple_call_arg (stmt, 0); > elems = TYPE_VECTOR_SUBPARTS (TREE_TYPE (arg0)); > /* For masked ABS, only optimize if the mask is all ones. */ > (and I wonder why all the gsi_replace calls in that function are with false, > IMHO they should use true). I prefer this solution, that's what we did for blendvps case. I don't know either, just follow what we did before (with false) when folding builtins.