[PATCH] D17316: [IR] Add {is, set, setNot}Convergent() functions to CallSite, CallInstr, and InvokeInstr.
Justin Lebar via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 16 17:01:13 PST 2016
jlebar created this revision.
jlebar added reviewers: jingyue, arsenm.
jlebar added a subscriber: llvm-commits.
(CallSite already has isConvergent() and setConvergent().)
No functional changes.
http://reviews.llvm.org/D17316
Files:
include/llvm/IR/CallSite.h
include/llvm/IR/Instructions.h
Index: include/llvm/IR/Instructions.h
===================================================================
--- include/llvm/IR/Instructions.h
+++ include/llvm/IR/Instructions.h
@@ -1745,6 +1745,10 @@
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 @@
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 {
Index: include/llvm/IR/CallSite.h
===================================================================
--- include/llvm/IR/CallSite.h
+++ include/llvm/IR/CallSite.h
@@ -410,6 +410,17 @@
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());
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17316.48130.patch
Type: text/x-patch
Size: 1823 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160217/de70eb40/attachment.bin>
More information about the llvm-commits
mailing list