Effective Automatic Parallelization And Locality Optimization Using The Polyhedral Model