[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
Wed Feb 17 09:51:15 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL261112: [IR] Add {is,set,setNot}Convergent() functions to CallSite, CallInstr, and… (authored by jlebar).

Changed prior to commit:
  http://reviews.llvm.org/D17316?vs=48130&id=48206#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17316

Files:
  llvm/trunk/include/llvm/IR/CallSite.h
  llvm/trunk/include/llvm/IR/Instructions.h

Index: llvm/trunk/include/llvm/IR/Instructions.h
===================================================================
--- llvm/trunk/include/llvm/IR/Instructions.h
+++ llvm/trunk/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: llvm/trunk/include/llvm/IR/CallSite.h
===================================================================
--- llvm/trunk/include/llvm/IR/CallSite.h
+++ llvm/trunk/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.48206.patch
Type: text/x-patch
Size: 1889 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160217/965b1f1b/attachment.bin>


More information about the llvm-commits mailing list