@antiagainst pointed me to an earlier discussion on this: Adding min/max (int/float) ops to standard dialect - #4 by awpr
I think we have to be extra clear and careful when deciding what ‘consistent semantics’ mean for Unknown/Undefined. Based on:
I understood that:
- It’s either
PropagateNaNorPropagateOtherglobally in the whole module. minf/maxfarePure(speculatable, no implicit memory effects)- Duplication, CSE, DCE are all fine. This should not fail:
- We can only constant-fold when we know arguments to be non-NaN.
Without either a strict notion of consistency or disallowing NaN arguments, I don’t see how we would be able to do basic transformations like scalarization, vectorization, loop unrolling, etc.