This is an archive of the discontinued LLVM Phabricator instance.

[MemLoc] Adjust memccpy support in MemoryLocation::getForArgument
ClosedPublic

Authored by xbolva00 on Oct 21 2020, 7:56 AM.

Details

Summary

Use LocationSize::upperBound instead of precise since we only know an upper bound on the number of bytes read/written.

Diff Detail

Event Timeline

xbolva00 created this revision.Oct 21 2020, 7:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 21 2020, 7:56 AM
xbolva00 requested review of this revision.Oct 21 2020, 7:56 AM
fhahn added inline comments.Oct 28 2020, 4:38 AM
llvm/lib/Analysis/MemoryLocation.cpp
261

I think it might be slightly better to mention here that we only know an upper bound on the number of bytes written and this upper bound is unsafe to use for writes.

xbolva00 added inline comments.Oct 28 2020, 4:58 AM
llvm/lib/Analysis/MemoryLocation.cpp
261

Ok, I will change the comment.

There is a LocationSize::upperBound(..), maybe it should be possible to use it here?

fhahn added inline comments.Oct 28 2020, 6:33 AM
llvm/lib/Analysis/MemoryLocation.cpp
261

Yes, it would probably be best to use upperBound unconditionally here for both read and write.

xbolva00 updated this revision to Diff 301310.Oct 28 2020, 9:29 AM

Use upperBound.

xbolva00 updated this revision to Diff 301313.Oct 28 2020, 9:31 AM
fhahn accepted this revision.Oct 28 2020, 12:55 PM

LGTM, thanks! It would be good to update the description before committing.

This revision is now accepted and ready to land.Oct 28 2020, 12:55 PM
xbolva00 edited the summary of this revision. (Show Details)Oct 28 2020, 1:15 PM
xbolva00 edited the summary of this revision. (Show Details)