Free isl_ctx and fix several memory leaks

Because of me not understanding the LLVM pass structure well, I did not find a
good way to allocate isl_ctx and to free it later without getting issues with
reference counting. I now found this place, such that we can free isl_ctx. This
patch also fixes the memory leaks that were ignored beforehand.

llvm-svn: 138204
diff --git a/polly/lib/CodeGeneration.cpp b/polly/lib/CodeGeneration.cpp
index aa2dc11..cfede95 100644
--- a/polly/lib/CodeGeneration.cpp
+++ b/polly/lib/CodeGeneration.cpp
@@ -1134,7 +1134,7 @@
     map = isl_map_intersect(map, identity);
 
     isl_map *lexmax = isl_map_lexmax(isl_map_copy(map));
-    isl_map *lexmin = isl_map_lexmin(isl_map_copy(map));
+    isl_map *lexmin = isl_map_lexmin(map);
     isl_map *sub = isl_map_sum(lexmax, isl_map_neg(lexmin));
 
     isl_set *elements = isl_map_range(sub);
@@ -1149,6 +1149,7 @@
     isl_point_get_coordinate(p, isl_dim_set, isl_set_n_dim(loopDomain) - 1, &v);
     int numberIterations = isl_int_get_si(v);
     isl_int_clear(v);
+    isl_point_free(p);
 
     return (numberIterations) / isl_int_get_si(f->stride) + 1;
   }