[Mlir-commits] [clang] [llvm] [mlir] [NVPTX] Convert scalar function nvvm.annotations to attributes (PR #125908)

Alex MacLean llvmlistbot at llvm.org
Wed Feb 5 15:48:37 PST 2025


================
@@ -179,6 +179,13 @@ static bool argHasNVVMAnnotation(const Value &Val,
   return false;
 }
 
+static std::optional<unsigned> getFnAttrParsedIntOrNull(const Function &F,
+                                                        StringRef Attr) {
+  if (F.hasFnAttribute(Attr))
+    return F.getFnAttributeAsParsedInteger(Attr);
+  return std::nullopt;
----------------
AlexMaclean wrote:

Had to be a little more explicit to make the compiler happy but I've switched to a ternary as requested. 

https://github.com/llvm/llvm-project/pull/125908


More information about the Mlir-commits mailing list