This is an archive of the discontinued LLVM Phabricator instance.

[BasicAA] Ignore @llvm.annotation when computing ModRefInfo.
AbandonedPublic

Authored by courbet on Mar 19 2021, 12:39 AM.

Details

Reviewers
hfinkel
Summary

@llvm.annotation is supposed to be ignored by code generation and
optimization:
https://llvm.org/docs/LangRef.html#llvm-annotation-intrinsic

However BasicAA considers that it may write to memory, so loads cannot
be moved across annotations.

BasicAA already ignores llvm.assume for this purpose. This change adds
llvm.annotation, llvm.var.annotation and llvm.ptr.annotation.

Fixes PR49638.

Diff Detail

Event Timeline

courbet created this revision.Mar 19 2021, 12:39 AM
courbet requested review of this revision.Mar 19 2021, 12:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2021, 12:39 AM
courbet updated this revision to Diff 331786.Mar 19 2021, 12:52 AM

Rebase on test base to show diff.

xbolva00 added inline comments.
llvm/lib/Analysis/BasicAliasAnalysis.cpp
946

Use switch (intrinsicCode) instead ifs?

Harbormaster completed remote builds in B94627: Diff 331783.
nikic added a subscriber: nikic.Mar 19 2021, 1:44 AM

Can we handle this by marking the intrinsic as InaccessibleMemOnly? Is there a reason it's modeled as arbitrarily writing now?

courbet updated this revision to Diff 331796.Mar 19 2021, 1:52 AM
courbet marked an inline comment as done.

use switch as suggested

Thi sis similar to

Can we handle this by marking the intrinsic as InaccessibleMemOnly? Is there a reason it's modeled as arbitrarily writing now?

If I read the comment correctly it's to guarantee that control dependencies are respected.

courbet updated this revision to Diff 331797.Mar 19 2021, 1:55 AM

fix conjugation.

courbet abandoned this revision.Mar 22 2021, 12:04 AM

Retiring this in favor of D99022.