summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYichao Yu <yyc1992@gmail.com>2017-11-02 12:18:33 +0000
committerYichao Yu <yyc1992@gmail.com>2017-11-02 12:18:33 +0000
commit52f6f2ce7b3f0f5366cd96e2b3305df56e35529f (patch)
tree4b2fcefe8a6e483f5d88a33a1241993f2aba0b36 /include
parent4352a046c591aec0915c4f16d54d03b1d00c1efa (diff)
Allow inaccessiblememonly and inaccessiblemem_or_argmemonly to be overwriten on call site with operand bundle
Summary: Similar to argmemonly, readonly and readnone. Fix PR35128 Reviewers: andrew.w.kaylor, chandlerc, hfinkel Reviewed By: hfinkel Subscribers: hfinkel, llvm-commits Differential Revision: https://reviews.llvm.org/D39434 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317201 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/IR/CallSite.h18
-rw-r--r--include/llvm/IR/InstrTypes.h6
-rw-r--r--include/llvm/IR/Instructions.h36
3 files changed, 60 insertions, 0 deletions
diff --git a/include/llvm/IR/CallSite.h b/include/llvm/IR/CallSite.h
index f1af2e43663..5b10da8f2ae 100644
--- a/include/llvm/IR/CallSite.h
+++ b/include/llvm/IR/CallSite.h
@@ -475,6 +475,24 @@ public:
CALLSITE_DELEGATE_SETTER(setOnlyAccessesArgMemory());
}
+ /// Determine if the function may only access memory that is
+ /// inaccessible from the IR.
+ bool onlyAccessesInaccessibleMemory() const {
+ CALLSITE_DELEGATE_GETTER(onlyAccessesInaccessibleMemory());
+ }
+ void setOnlyAccessesInaccessibleMemory() {
+ CALLSITE_DELEGATE_SETTER(setOnlyAccessesInaccessibleMemory());
+ }
+
+ /// Determine if the function may only access memory that is
+ /// either inaccessible from the IR or pointed to by its arguments.
+ bool onlyAccessesInaccessibleMemOrArgMem() const {
+ CALLSITE_DELEGATE_GETTER(onlyAccessesInaccessibleMemOrArgMem());
+ }
+ void setOnlyAccessesInaccessibleMemOrArgMem() {
+ CALLSITE_DELEGATE_SETTER(setOnlyAccessesInaccessibleMemOrArgMem());
+ }
+
/// Determine if the call cannot return.
bool doesNotReturn() const {
CALLSITE_DELEGATE_GETTER(doesNotReturn());
diff --git a/include/llvm/IR/InstrTypes.h b/include/llvm/IR/InstrTypes.h
index 063e4baef46..871f702f95f 100644
--- a/include/llvm/IR/InstrTypes.h
+++ b/include/llvm/IR/InstrTypes.h
@@ -1480,6 +1480,12 @@ protected:
default:
return false;
+ case Attribute::InaccessibleMemOrArgMemOnly:
+ return hasReadingOperandBundles();
+
+ case Attribute::InaccessibleMemOnly:
+ return hasReadingOperandBundles();
+
case Attribute::ArgMemOnly:
return hasReadingOperandBundles();
diff --git a/include/llvm/IR/Instructions.h b/include/llvm/IR/Instructions.h
index 6446e2d04b1..c1122d137f2 100644
--- a/include/llvm/IR/Instructions.h
+++ b/include/llvm/IR/Instructions.h
@@ -1807,6 +1807,24 @@ public:
addAttribute(AttributeList::FunctionIndex, Attribute::ArgMemOnly);
}
+ /// @brief Determine if the function may only access memory that is
+ /// inaccessible from the IR.
+ bool onlyAccessesInaccessibleMemory() const {
+ return hasFnAttr(Attribute::InaccessibleMemOnly);
+ }
+ void setOnlyAccessesInaccessibleMemory() {
+ addAttribute(AttributeList::FunctionIndex, Attribute::InaccessibleMemOnly);
+ }
+
+ /// @brief Determine if the function may only access memory that is
+ /// either inaccessible from the IR or pointed to by its arguments.
+ bool onlyAccessesInaccessibleMemOrArgMem() const {
+ return hasFnAttr(Attribute::InaccessibleMemOrArgMemOnly);
+ }
+ void setOnlyAccessesInaccessibleMemOrArgMem() {
+ addAttribute(AttributeList::FunctionIndex, Attribute::InaccessibleMemOrArgMemOnly);
+ }
+
/// Determine if the call cannot return.
bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); }
void setDoesNotReturn() {
@@ -3889,6 +3907,24 @@ public:
addAttribute(AttributeList::FunctionIndex, Attribute::ArgMemOnly);
}
+ /// @brief Determine if the function may only access memory that is
+ /// inaccessible from the IR.
+ bool onlyAccessesInaccessibleMemory() const {
+ return hasFnAttr(Attribute::InaccessibleMemOnly);
+ }
+ void setOnlyAccessesInaccessibleMemory() {
+ addAttribute(AttributeList::FunctionIndex, Attribute::InaccessibleMemOnly);
+ }
+
+ /// @brief Determine if the function may only access memory that is
+ /// either inaccessible from the IR or pointed to by its arguments.
+ bool onlyAccessesInaccessibleMemOrArgMem() const {
+ return hasFnAttr(Attribute::InaccessibleMemOrArgMemOnly);
+ }
+ void setOnlyAccessesInaccessibleMemOrArgMem() {
+ addAttribute(AttributeList::FunctionIndex, Attribute::InaccessibleMemOrArgMemOnly);
+ }
+
/// Determine if the call cannot return.
bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); }
void setDoesNotReturn() {