This is an archive of the discontinued LLVM Phabricator instance.

[AAPointerInfo] rearrange code in preparation for further changes
ClosedPublic

Authored by sameerds on Nov 24 2022, 2:38 AM.

Details

Summary

AAPointerInfoFloating::updateImpl

Move the member function definition out of its class before modifying it.

translateAndAddState

Split the function definition into two along the FromCallee boolean argument.

handleAccess

This should only be called when Size is not known. In other cases, replaced
with a direct call to addAccess.

Diff Detail

Event Timeline

sameerds created this revision.Nov 24 2022, 2:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2022, 2:38 AM
sameerds requested review of this revision.Nov 24 2022, 2:38 AM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
jdoerfert added inline comments.Nov 28 2022, 10:36 AM
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
1217

Isn't this now 25 identical lines and 2 different ones? What's the benefit here? Code duplication is bad.

1262

Ty can be nullptr, no? Did you test this?

sameerds added inline comments.Nov 29 2022, 12:22 AM
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
1217

I agree with that sentiment wholeheartedly. But D138646 that introduces multiple offsets has different changes for the two versions. We can hold this until that code is reviewed. If we find a readable way to keep a single version, that would be great.

1262

At the two calls to this function, I don't see how it can be nullptr. What did I miss?

jdoerfert added inline comments.Nov 30 2022, 7:56 AM
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
1262

If it can't be, make it a reference please.

jdoerfert accepted this revision.Nov 30 2022, 8:11 AM

LG, with the reference nit.

This revision is now accepted and ready to land.Nov 30 2022, 8:11 AM
sameerds updated this revision to Diff 481168.Dec 8 2022, 12:23 AM
sameerds marked 3 inline comments as done.
  • Rebased.
  • Addressed review comments.
sameerds added inline comments.Dec 8 2022, 12:24 AM
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
1262

Done.