Guiding Loop Transformations for High-Performance Tensor Applications