Possibly vectorized operations are extended to the power-of-2 number with UndefValues to allow to use regular vector operations.
Some initial comments - there's a lot going on (cutting it into smaller patches would be very useful).
The sdiv undefs test worries me, and I'm not certain if we have good masked load/store costs at the moment.
Check for failure instead of just dereferencing?
drop the * ?
drop the * ?
Is it safe to use VL like this - do we guarantee the undef types are correct?
This is going to cause problems for an incoming patch I'm working on - any chance that you can avoid using Instruction &I?
|319 ↗||(On Diff #192640)|
This test is checking that the sdiv didn't get vectorized, because if any elt is undef then the whole result is undef - but if its stays scalarized then on elts 0 and 4 become undef.
I just don't have enough time for this. I referenced this patch in D66416. This patch is not X86 specific (if integer widening is supported only for X86) + it works with the existing cost model more correctly, I believe, since our cost model is not adapted to non-power-2 vectors and must be tweaked carefully. I suggested that someone else could take this patch and split it into several smaller patches, etc. What do you think?