[OperandBundles] Make function attributes conservatively correct
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 22 Oct 2015 03:12:22 +0000 (03:12 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 22 Oct 2015 03:12:22 +0000 (03:12 +0000)
commitf1c277c27096a55a1ab2220294a69457d0951bf7
treef168ecaf4784145aaba61d90db449704c511736f
parent55a57a7674acbd7265598b11119d84af737de6d2
[OperandBundles] Make function attributes conservatively correct

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.

Reviewers: reames, chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13961

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250973 91177308-0d34-0410-b5e6-96231b3b80d8
docs/LangRef.rst
include/llvm/IR/InstrTypes.h
include/llvm/IR/Instructions.h
lib/IR/Instructions.cpp
test/Feature/OperandBundles/adce.ll [new file with mode: 0644]
test/Feature/OperandBundles/early-cse.ll [new file with mode: 0644]