While fixing something, I discovered that the DAG combiner will drop the flags from ISD::FMAXNUM if it is swapping operands to canonicalize the constant operand on the RHS.
That is presumably because of this code in the DAG combiner:
// Canonicalize to constant on RHS.
if (isConstantFPBuildVectorOrConstantFP(N0) &&
!isConstantFPBuildVectorOrConstantFP(N1))
return DAG.getNode(N->getOpcode(), SDLoc(N), VT, N1, N0);
As a result, the DAG transformations that are applied to something like
call fast <4 x float> @llvm.maxnum.v4f32(<4 x float> %3, <4 x float> zeroinitializer)
vs.
call fast <4 x float> @llvm.maxnum.v4f32(<4 x float> zeroinitializer, <4 x float> %3)
will be very different.
I wanted to get some opinions on how prevalent this is and whether there is any effort ongoing to fix it.