Skip to content

Commit

Permalink
Merge pull request #2334 from devitocodes/hotfix-partile-none
Browse files Browse the repository at this point in the history
compiler: Patch Guards.simplify_and
  • Loading branch information
mloubout authored Mar 18, 2024
2 parents f1d5dbf + 78d01df commit 7b7b1eb
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions devito/ir/support/guards.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,16 @@ def simplify_and(relation, v):
for a in candidates:
if a.lhs is v.lhs:
covered = True
if type(a) in (Gt, Ge) and v.rhs > a.rhs:
new_args.append(v)
elif type(a) in (Lt, Le) and v.rhs < a.rhs:
new_args.append(v)
else:
try:
if type(a) in (Gt, Ge) and v.rhs > a.rhs:
new_args.append(v)
elif type(a) in (Lt, Le) and v.rhs < a.rhs:
new_args.append(v)
else:
new_args.append(a)
except TypeError:
# E.g., `v.rhs = const + z_M` and `a.rhs = z_M`, so the inequalities
# above are not evaluable to True/False
new_args.append(a)
else:
new_args.append(a)
Expand Down

0 comments on commit 7b7b1eb

Please sign in to comment.