A Performance Optimization Framework for Compilation of Tensor Contraction Expressions into Parallel Programs