From b6c095e8166dfeaa3e16abbfa5e77d9533310e26 Mon Sep 17 00:00:00 2001 From: Matt Wala <wala1@illinois.edu> Date: Sun, 4 Dec 2016 21:04:41 -0600 Subject: [PATCH] codegen.loop: Use PwAff.is_equal() to test for lower and upper bound equality. --- loopy/codegen/loop.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/loopy/codegen/loop.py b/loopy/codegen/loop.py index 8ac963835..e77465f09 100644 --- a/loopy/codegen/loop.py +++ b/loopy/codegen/loop.py @@ -431,13 +431,9 @@ def generate_sequential_loop_dim_code(codegen_state, sched_index): astb = codegen_state.ast_builder - zero = isl.PwAff.zero_on_domain( - isl.LocalSpace.from_space( - lbound.get_space()).domain()) - from loopy.symbolic import pw_aff_to_expr - if (ubound - lbound).plain_is_equal(zero): + if ubound.is_equal(lbound): # single-trip, generate just a variable assignment, not a loop inner = merge_codegen_results(codegen_state, [ astb.emit_initializer( -- GitLab