This is an archive of the discontinued LLVM Phabricator instance.

[OperandBundles] Make function attributes conservatively correct
ClosedPublic

Authored by sanjoy on Oct 21 2015, 4:15 PM.

Details

Summary

This makes attribute accessors on CallInst and InvokeInst do the
(conservatively) right thing. This essentially involves, in some
cases, *not* falling back querying the attributes on the called
llvm::Function when operand bundles are present.

Attributes locally present on the CallInst or InvokeInst will still
override operand bundle semantics. The LangRef has been amended to
reflect this. Note: this change does not do anything prevent
-function-attrs from inferring CallSite local attributes after
inspecting the called function -- that will be done as a separate
change.

I've used -adce and -early-cse to test these changes. There is
nothing special about these passes (and they did not require any
changes) except that they seemed be the easiest way to write the tests.

This change does not add deal with argmemonly. That's a later change
because alias analysis requires a related fix before argmemonly can be
tested.

Diff Detail

Repository
rL LLVM

Event Timeline

sanjoy updated this revision to Diff 38060.Oct 21 2015, 4:15 PM
sanjoy retitled this revision from to [OperandBundles] Make function attributes conservatively correct.
sanjoy updated this object.
sanjoy added reviewers: reames, chandlerc.
sanjoy added a subscriber: llvm-commits.
reames accepted this revision.Oct 21 2015, 6:25 PM
reames edited edge metadata.

LGTM w/minor comments addressed

test/Feature/OperandBundles/adce.ll
5 ↗(On Diff #38060)

Add a comment about *why* these need not be dead.

test/Feature/OperandBundles/early-cse.ll
5 ↗(On Diff #38060)

Again, adding comments about what you're testing and why would be helpful.

This revision is now accepted and ready to land.Oct 21 2015, 6:25 PM
This revision was automatically updated to reflect the committed changes.