Try to keep the final flip small. Need to flip MemRef as there are many templated cases with it and Tensor.