I’m objecting to “as the first step” part only
Either it is the right thing to do, or it is not! (You seem to advocate above that we should do it this way, in the absolute, not as a first step)
On the general direction, I feel that what you’re describing applies equally to any FMF, so it is not clear to me right now why fp-contract is fundamentally different from other FMF, can you clarify that?
Are you saying this works because we don’t block inlining when functions attributes don’t match or update the function attributes to be more conservative when inlining? This is specifically one of the issues we were avoiding by using FMFs. Frankly, the same issue comes up with other fast-math properties, and I don’t see why we should handle this differently. I think that I’d prefer you stick with the new flag.
where all the operands are vectors with the typical implementation for the overload operators, we wouldn’t fp-contract unless the operator definitions use contract_fast too?
Are you saying this works because we don’t block inlining when functions attributes don’t match or update the function attributes to be more conservative when inlining? This is specifically one of the issues we were avoiding by using FMFs. Frankly, the same issue comes up with other fast-math properties, and I don’t see why we should handle this differently. I think that I’d prefer you stick with the new flag.
where all the operands are vectors with the typical implementation for the overload operators, we wouldn’t fp-contract unless the operator definitions use contract_fast too?
I guess it’s the conservative thing to do since those functions may have non-contractable operations.
Exactly; the problem is that this is the desirable behavior in some circumstances and undesirable in others, but I think that doing the conservative thing is the most self-consistent choice (and also allows users the most powerful fine-grained control). Thanks again, Hal
I’ve uploaded the first set of patches for this. They should fix LTO for fused multiply-and-add. -ffp-contract=fast is now translated into a new FMF called contract.
llvm: [DAGCombiner] Initial support for the fast-math flag contract https://reviews.llvm.org/D31169
DAGCombine support for fused subtract and then the pragma we discussed is coming up later. Please help to review what I have so far.
I’ve uploaded the first set of patches for this. They should fix LTO for fused multiply-and-add. -ffp-contract=fast is now translated into a new FMF called contract.
llvm: [DAGCombiner] Initial support for the fast-math flag contract https://reviews.llvm.org/D31169
DAGCombine support for fused subtract and then the pragma we discussed is coming up later. Please help to review what I have so far.
The new pragma is added in https://reviews.llvm.org/D31276. Please help to review this and the previous patches in the series.