I think setting contract flag on fp instructions with -cl-mad-enable should be sensible considering spec wording:
-cl-mad-enable Allow a * b + c to be replaced by a mad. The mad computes a * b + c with reduced accuracy. For example, some OpenCL devices implement mad as truncate the result of a * b before adding it to c
However, I am unclear how it impacts fdiv instructions and etc, as I am not sure how exactly it is optimized. LLVM reference manual says:
contract
Allow floating-point contraction (e.g. fusing a multiply followed by an addition into a fused multiply-and-add).
Presumably contract makes no effect in fdiv?
Now another question is whether we could remove LessPreciseFPMAD from CodeGen options as I don't feel it has actual uses. Although I might be misunderstanding this.
TODO: the same applies to -cl-unsafe-math-optimizations
I don't find this behavior "NORMAL". I don't believe we should contract expressions by default in OpenCL...