I found that some TVM ops such as exp, floor, ceil, etc., are defined as pure intrinsic ops. For example,
However, in HalideIR, these ops are defined as pure extern ops, see
Should we change them to pure extern ops to be consistent with HalideIR? Further, this will also be compatible with HalideIR simplification pass (though we need to add TVM op signature for them).
These operators will get lowered in compiler into different extern functions. So we want to keep them as intrinsics as opposed to extern.
In terms of simplification i feel we should not do the simplification for floating pt ops anyway, mainly because LLVM will do them when necessary and we mainly need simplification for integer indices.
One problem I have now is that when I want to compute the shape of arange op, storage rewrite fails because it cannot simplify the expr due to ceil op.
I see what you mean. Perhaps we could overload ceil floor op to eagerly simplify float arithmetics. As in our current eager simplification of integer ones
hmm. I found that float division/add/sub are not eagerly simplified either. Therefore, operand to ceil is still an expr instead of FloatImm. But I feel that eagar simplication for all float expression might not be desired. So what should we do here? Should I change the HalideIR simplify and match intrinsic ceil op defined in TVM?