The main goal of this series is to allow functions to be vectorised simply by defining the associated optab. At the moment you can get a scalar square root instruction by defining an md pattern like sqrtdf2. But if you want to have vectorised sqrt, you need to have a target- specific C-level built-in function for the vector form of sqrt, implement TARGET_BUILTIN_VECTORIZED_FUNCTION, and expand the sqrt in the same way that the target expands other directly-called built-in functions. That seems unnecessarily indirect, especially when in practice those target-specific functions tend to use patterns like sqrtv2df2 anyway. It also means GCC has less idea what the vector function is doing.
The series uses the combined_fn enum and internal functions from the patches I posted on Saturday to make the vectoriser pick up vector optabs automatically and represent the result as a vector internal function call. For example, we can convert BUILT_IN_SQRT{F,,L} or a scalar IFN_SQRT into a vector IFN_SQRT if the appropriate sqrtM2 optab is defined. Tested on x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnu and powerpc64-linux-gnu. Thanks, Richard