[IR] Add {is,set,setNot}Convergent() functions to CallSite, CallInstr, and InvokeInstr.

Summary:
(CallSite already has isConvergent() and setConvergent().)

No functional changes.

Reviewers: reames

Subscribers: llvm-commits, jingyue, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261112 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Lebar 2016-02-17 17:46:47 +00:00
parent 97a9fd0f0b
commit 7d0a344458
2 changed files with 25 additions and 0 deletions

View File

@ -410,6 +410,17 @@ public:
CALLSITE_DELEGATE_SETTER(setDoesNotThrow());
}
/// @brief Determine if the call is convergent.
bool isConvergent() const {
CALLSITE_DELEGATE_GETTER(isConvergent());
}
void setConvergent() {
CALLSITE_DELEGATE_SETTER(setConvergent());
}
void setNotConvergent() {
CALLSITE_DELEGATE_SETTER(setNotConvergent());
}
unsigned getNumOperandBundles() const {
CALLSITE_DELEGATE_GETTER(getNumOperandBundles());
}

View File

@ -1745,6 +1745,10 @@ public:
void setConvergent() {
addAttribute(AttributeSet::FunctionIndex, Attribute::Convergent);
}
void setNotConvergent() {
removeAttribute(AttributeSet::FunctionIndex,
Attribute::get(getContext(), Attribute::Convergent));
}
/// \brief Determine if the call returns a structure through first
/// pointer argument.
@ -3664,6 +3668,16 @@ public:
addAttribute(AttributeSet::FunctionIndex, Attribute::NoDuplicate);
}
/// \brief Determine if the invoke is convergent
bool isConvergent() const { return hasFnAttr(Attribute::Convergent); }
void setConvergent() {
addAttribute(AttributeSet::FunctionIndex, Attribute::Convergent);
}
void setNotConvergent() {
removeAttribute(AttributeSet::FunctionIndex,
Attribute::get(getContext(), Attribute::Convergent));
}
/// \brief Determine if the call returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {