Replace the different reduce operations which is getting
a constant tensor as an input argument with a constant
tensor.
As the arguement of the reduce operation is constant tensor
and has only a single user we could calculate the resulted
constant tensor in compilation time and replace it
with reduced memory tensor
This optimization has been implemented for:
tosa.reduce_sum
tosa.reduce_prod
tosa.reduce_any
tosa.reduce_all
tosa.reduce_max
tosa.reduce_min
Mind breaking this into a couple lines? clang-format does not understand tablegen sadly.