This patch was requested to be split out from D30086e flags have been moved into SDNode, and the BinaryWithFlagsSDNode class has been removed. The flags also contain a new "defined" state to allow intersecting between defined flags, and those which have just been default-constructed but never set. As a result of these changes, flags are now passed by value, so all the users have been updated.
It generalises SDNodes carrying flags, adding support for a currently unused unary SDNode with flags. Once D30086 lands two SDNodes will use the UnaryWithFlagsSDNode created here. NFCThis also paves the way to easily extend flags to 3 operand nodes.