Skip to content

Commit

Permalink
improve alias analysis to reject blocks that are smaller than access …
Browse files Browse the repository at this point in the history
…size
  • Loading branch information
nunoplopes committed Dec 24, 2023
1 parent c9f29fb commit 87deb56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ir/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,9 @@ bool Memory::mayalias(bool local, unsigned bid0, const expr &offset0,

if (auto sz = (local ? local_blk_size : non_local_blk_size).lookup(bid)) {
expr offset = offset0.sextOrTrunc(bits_size_t);
if (offset.uge(*sz).isTrue() || (*sz - offset).ult(bytes).isTrue())
if (offset.uge(*sz).isTrue() ||
sz->ult(bytes).isTrue() ||
(*sz - offset).ult(bytes).isTrue())
return false;
} else if (local) // allocated in another branch
return false;
Expand Down

0 comments on commit 87deb56

Please sign in to comment.