isl_aff.c: pw_multi_aff_from_map_plug_in: simplify substitution construction
authorSven Verdoolaege <sven@cerebras.net>
Fri, 17 Feb 2023 09:47:25 +0000 (17 10:47 +0100)
committerSven Verdoolaege <sven@cerebras.net>
Sat, 11 May 2024 13:16:14 +0000 (11 15:16 +0200)
This prepares for extracting this construction in the next commit.

Signed-off-by: Sven Verdoolaege <sven@cerebras.net>
isl_aff.c

index 8944beb..08ea187 100644 (file)
--- a/isl_aff.c
+++ b/isl_aff.c
@@ -5262,15 +5262,14 @@ static __isl_give isl_pw_multi_aff *pw_multi_aff_from_map_plug_in(
        if (n_in < 0)
                goto error;
 
-       if (is_set) {
-               ma = isl_multi_aff_from_aff(aff);
-       } else {
+       ma = isl_multi_aff_from_aff(aff);
+       if (!is_set) {
                isl_space *space;
+               isl_multi_aff *id;
 
                space = isl_aff_get_domain_space(aff);
-               ma = isl_multi_aff_identity(isl_space_map_from_set(space));
-               ma = isl_multi_aff_range_product(ma,
-                                               isl_multi_aff_from_aff(aff));
+               id = isl_multi_aff_identity(isl_space_map_from_set(space));
+               ma = isl_multi_aff_range_product(id, ma);
        }
 
        insert = isl_map_from_multi_aff_internal(isl_multi_aff_copy(ma));