On Thu, 4 May 2023, Andre Vieira (lists) wrote: > > > On 03/05/2023 12:55, Richard Biener wrote: > > On Fri, 28 Apr 2023, Andre Vieira (lists) wrote: > > > >> Hi, > >> > >> I'm posting the patches separately now with ChangeLogs. > >> > >> I made the suggested changes and tried to simplify the code a bit further. > >> Where internal to tree-vect-stmts I changed most functions to use > >> code_helper > >> to avoid having to check at places we didn't need to. I was trying to > >> simplify > >> things further by also modifying supportable_half_widening_operation and > >> supportable_convert_operation but the result of that was that I ended up > >> moving the code to cast to tree code inside them rather than at the call > >> site > >> and it didn't look simpler, so I left those. Though if we did make those > >> changes we'd no longer need to keep around the tc1 variable in > >> vectorizable_conversion... Let me know what you think. > > > > I see that > > > > - else if (CONVERT_EXPR_CODE_P (code) > > + else if (CONVERT_EXPR_CODE_P (code.safe_as_tree_code ()) > > > > is convenient (as much as I dislike safe_as_tree_code). Isn't > > the following > > > > - if (!CONVERT_EXPR_CODE_P (code)) > > + if (!CONVERT_EXPR_CODE_P ((tree_code) code)) > > return false; > For some reason I thought the code could only reach here if code was a tree > code, but I guess if we have an ifn and the modes aren't the same as the > wide_vectype it would fall to this, which for an ifn this would fail. I am > wondering whether it needs to though, the multi-step widening should also work > for ifn's no? We'd need to adapt it, to not use c1, c2 but hi, lo in case of > ifn I guess.. and then use a different optab look up too? > > Though I'm thinking, maybe this should be a follow-up and just not have that > 'feature' for now. The feature being, supporting multi-step conversion for new > widening IFN's.
Yes, I think we should address this in a followup if needed. Richard.