This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] AAFunctionReachability, Handle CallBase Reachability.
ClosedPublic

Authored by kuter on Jul 20 2021, 2:48 PM.

Details

Summary

This patch makes it possible to query callbase reachability
(Can a callbase reach a function Fn transitively).
The patch moves the reachability query handling logic to a member class,
this class will have more users within the AA once we add other function
reachability queries.

Diff Detail

Event Timeline

kuter created this revision.Jul 20 2021, 2:48 PM
kuter requested review of this revision.Jul 20 2021, 2:48 PM
Herald added a reviewer: sstefan1. · View Herald Transcript
Herald added a reviewer: baziotis. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
kuter updated this revision to Diff 360287.Jul 20 2021, 2:51 PM

Rmove useless comment.

kuter updated this revision to Diff 360289.Jul 20 2021, 3:03 PM

Fix issue with the unittest.
Change tracking issue.

kuter updated this revision to Diff 361928.Jul 27 2021, 12:35 AM

Use the new |= operator for change tracking.

kuter updated this revision to Diff 372095.Sep 11 2021, 1:54 PM
  • Use early increment iterator range rather than hacky code.
  • Fix the infinite loop issue.
  • Negative test case.
jdoerfert added inline comments.Sep 11 2021, 3:22 PM
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
9362

I don't get this. In line 9331 we iterate over unreachable and ask isReachable but we always would return false because of this, no?

9413
9438

You can use recordDependence here to make it clear what is happening and avoid some unnecessary code.

9487

Documentation for both.

kuter updated this revision to Diff 372100.Sep 11 2021, 3:57 PM

address review.

This revision is now accepted and ready to land.Sep 11 2021, 4:00 PM
kuter updated this revision to Diff 372101.Sep 11 2021, 4:04 PM

Use recordDependence

kuter marked 3 inline comments as done.Sep 11 2021, 4:05 PM
This revision was landed with ongoing or failed builds.Sep 12 2021, 3:36 PM
This revision was automatically updated to reflect the committed changes.