Some FPMathOperators succeed and the retrieve FMF context when they never have it, we should omit these cases to keep from removing FMF context.
For instance when we visit some FPMathOperator mapped Instructions which never have FMF flags and a Node was associated which does have FMF flags, that Node today will have all its flags cleared via the intersect operation. With this change, we exclude associating Nodes that never have FPMathOperator status under FMF.
I don't see the benefit of treating Instruction/ConstantExpr separately when the logic is identical for both and likely to keep growing.
Ie, can we do this:
static bool classof(const Value *V) { unsigned Opcode; if (auto *I = dyn_cast<Instruction>(V)) Opcode = I->getOpcode(); else if (auto *CE = dyn_cast<ConstantExpr>(V)) Opcode = CE->getOpcode(); else return false; switch (Opcode) { case Instruction::FCmp: return true; // Vector operators may have FP type, but they don't do math. case Instruction::ExtractElement: case Instruction::ShuffleVector: case Instruction::InsertElement: return false; default: return V->getType()->isFPOrFPVectorTy(); } }