Index: lib/CodeGen/IslAst.cpp =================================================================== --- lib/CodeGen/IslAst.cpp +++ lib/CodeGen/IslAst.cpp @@ -42,6 +42,7 @@ #include "isl/map.h" #include "isl/set.h" #include "isl/union_map.h" +#include "isl/union_set.h" #define DEBUG_TYPE "polly-ast" @@ -411,7 +412,11 @@ buildRunCondition(Build); - Root = isl_ast_build_node_from_schedule(Build, S->getScheduleTree()); + isl_schedule *Schedule = S->getScheduleTree(); + Schedule = isl_schedule_intersect_domain( + Schedule, isl_union_set_from_set(S->getAssumedContext())); + Schedule = isl_schedule_gist_domain_params(Schedule, S->getAssumedContext()); + Root = isl_ast_build_node_from_schedule(Build, Schedule); isl_ast_build_free(Build); } Index: test/Isl/Ast/simple-run-time-condition.ll =================================================================== --- test/Isl/Ast/simple-run-time-condition.ll +++ test/Isl/Ast/simple-run-time-condition.ll @@ -23,7 +23,7 @@ ; CHECK; (o <= 0 && m + q >= 100 && q <= 100) ; CHECK: ) -; CHECK: if (o <= 0) { +; CHECK: if (o <= 0 && m + q >= 100) { ; CHECK: for (int c0 = 0; c0 < n; c0 += 1) ; CHECK: for (int c1 = 0; c1 < m; c1 += 1) ; CHECK: Stmt_for_j_1(c0, c1);