[PATCH] D153308: Analysis: Fix assertion when load alignment exceeds address space size

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 07:31:52 PDT 2023


gchatelet added inline comments.


================
Comment at: llvm/lib/Analysis/Loads.cpp:34-35
+    return false;
+  // It's possible for the maximum alignment value to overflow the size of the
+  // address space.
+  return Offset.isAligned(BA);
----------------
Now that the code is in `APInt` it's not entirely obvious how the comment is addressed.
Maybe reformulating the comment like so would help : "Delegating alignment check to APInt as Offset and Alignment might have different bit width. e.g., Align is 2^64 but Offset is from a 32 bit Address Space."
Or something along those lines.


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

https://reviews.llvm.org/D153308



More information about the llvm-commits mailing list