Extend handling to support %base + offset as start for AddRecs in
isDereferenceableAndAlignedInLoop. This is done by adjusting AccessSize
by the offset and effectively checking if the full object starting from
%base to %base + offset + access-size is dereferenceable.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Analysis/Loads.cpp | ||
---|---|---|
320 | Don't you need to check that Offset is also aligned? If I'm reading this right, you'd currently accept Offset = 1 for Alignment = 4, as it is only checked against EltSize and the base pointer. |
llvm/lib/Analysis/Loads.cpp | ||
---|---|---|
320 | Thanks I was assuming the total size was also checked in isDereferenceableAndAlignedPointer but that's not the case! I added test cases for both the check of EltSize (looks like this was missing) and the check for the offset in 74dee4791a2b3f17a49ea2f90ce3730f241f36ac and 3b95c335887df73123991d023dadb36cd914fc91 |
Move assertion out of if/else? This always holds.