Search-based Model-driven Loop Optimizations for Tensor Contractions