[PATCH] D112486: [BasicAA] Make range check more precise

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 11:19:29 PDT 2021


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM w/minor change suggested.

It looks like this structure might subsume some of the nearby checks as well, but that can be explored in a follow up.



================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:1323
+      unsigned BW = Range.getBitWidth();
+      Range = Range.add(ConstantRange(APInt(BW, 0),
+                                      APInt(BW, V1Size.getValue())));
----------------
Rather than mutating an existing variable (which might be used later), I'd just use a new variable name here.  e.g. AccessRange 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112486/new/

https://reviews.llvm.org/D112486



More information about the llvm-commits mailing list