This is an archive of the discontinued LLVM Phabricator instance.

Move isPointerOffset function to ValueTracking.
ClosedPublic

Authored by eugenis on Aug 13 2019, 2:05 PM.

Diff Detail

Event Timeline

eugenis created this revision.Aug 13 2019, 2:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2019, 2:05 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
vitalybuka accepted this revision.Aug 13 2019, 7:49 PM

It's does not change code, but looks like it can be improved in followup patches

llvm/lib/Analysis/ValueTracking.cpp
5705

pair<int64_t, bool>

5718

This line is confusing:

return VariableIdxFound = true;
5737
pair<bool, int64_t> llvm::isPointerOffset(const Value *Ptr1, const Value *Ptr2,
This revision is now accepted and ready to land.Aug 13 2019, 7:49 PM
eugenis marked an inline comment as done.Aug 15 2019, 2:58 PM

I'll submit this as is and then refactor in a follow up.
Thanks!

llvm/lib/Analysis/ValueTracking.cpp
5705

Even better, Optional<int64_t>

This revision was automatically updated to reflect the committed changes.