DAG combiner folds (fma a 1.0 b) into (fadd a b) but the flag isn't propagated into new fadd. This patch fixes that.
However, besides this, SDNodeFlags are easily missed/passed wrongly. (D86871) Is there any 'rule' about whether pass flags or not? Roughly speaking, there are (or more than?) three types of transformation in SDAG:
- The node is eliminated. Flags of it will never be passed to others.
- A node is expanded/simplified into another node(s). In this case, flags of the node should be passed to all newly created node(s).
- Some nodes are transformed to another group of nodes. Here new nodes should have intersection of original flags? Or decided by opcode type?
We can do some check against new nodes or pass flags automatically if the rule is clear. Any ideas?