This is an archive of the discontinued LLVM Phabricator instance.

[BasicAliasAnalysis] Take into account operand bundles in the getModRefInfo function
ClosedPublic

Authored by igor-laevsky on Jan 15 2016, 7:37 AM.

Details

Summary

In the getModRefInfo we were checking aliasing only for the actual call arguments. For cases when aliasing value was only used in the operand bundle we were returning NoModRef result (which is incorrect).

Diff Detail

Repository
rL LLVM

Event Timeline

igor-laevsky retitled this revision from to [BasicAliasAnalysis] Take into account operand bundles in the getModRefInfo function.
igor-laevsky updated this object.
igor-laevsky added reviewers: reames, hfinkel, sanjoy.
igor-laevsky set the repository for this revision to rL LLVM.
igor-laevsky added a subscriber: llvm-commits.
reames accepted this revision.Jan 15 2016, 1:40 PM
reames edited edge metadata.

LGTM

lib/Analysis/BasicAliasAnalysis.cpp
720 ↗(On Diff #44988)

For clarity, it would be good to rename ArgNo to OperandNo since it can now iterate into the bundle operands not just the argument operands.

Alternatively, we could replace the induction variable with the CI-CS.data_operands_begin() like we did in CaptureTracking.

Doing this bit of cleanup in a separate change is fine.

734 ↗(On Diff #44988)

A potential enhancement to this code would be to return MRI_Ref if the arguments which could alias the object are all readonly. This would be potentially useful for deopt bundles since all the arguments are implicitly read only.

If you decide to do this, it should definitely be a separate patch.

This revision is now accepted and ready to land.Jan 15 2016, 1:40 PM
This revision was automatically updated to reflect the committed changes.
igor-laevsky marked an inline comment as done.Jan 16 2016, 4:31 AM
igor-laevsky added inline comments.
lib/Analysis/BasicAliasAnalysis.cpp
734 ↗(On Diff #44988)

That makes sense. I'll send a separate patch.