[Mlir-commits] [clang] [llvm] [mlir] [NVPTX] Convert scalar function nvvm.annotations to attributes (PR #125908)
Artem Belevich
llvmlistbot at llvm.org
Wed Feb 5 17:07:53 PST 2025
================
@@ -179,6 +179,13 @@ static bool argHasNVVMAnnotation(const Value &Val,
return false;
}
+static std::optional<unsigned> getFnAttrParsedInt(const Function &F,
+ StringRef Attr) {
+ return F.hasFnAttribute(Attr)
+ ? std::optional(F.getFnAttributeAsParsedInteger(Attr))
+ : std::nullopt;
----------------
Artem-B wrote:
Ugh. `{}` can't be used in a ternary, and using std::nullopt forces explicit optional use in the other branch. :-/
That ended up being a wash. Sorry about the noise.
Just in case. Comments marked as "nit" are up to you. It includes ignoring them or pushing back when those suggestions don't make sense or turn out not being worth it.
https://github.com/llvm/llvm-project/pull/125908
More information about the Mlir-commits
mailing list