Hi,
I noticed that this function:
define <2 x double> @f1(<2 x double> %val) { %cmp = fcmp ogt <2 x double> %val, zeroinitializer %ret = select <2 x i1> %cmp, <2 x double> %val, <2 x double> zeroinitializer ret <2 x double> %ret }
, which I expected to be implemented with a systemZ vfmaxdb (vector fp maximum), was not represented on the DAG with an fmaxnum node, and therefore not in the assembly output either.
I found this to be due to the fact that ValueTracking.cpp:isKnownNonNaN() is not recognizing the zero splat. This is because it is a ConstantAggregateZero which is a ConstantData and not a ConstantDataVector that the function is handling.
I wonder if my patch here is the right approach, or if it might be even better to make a utility function for this type of query to make this mistake less likely in other places? It is surprising to me to have a zero splat not recognized as a ConstantDataVector...
I don't think you need the FP type check