Automatic Transformations for Communication-Minimized Parallelization and Locality Optimization in the Polyhedral Model