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()); } 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 {