[llvm] [AMDGPU][Attributor] Make `AAAMDFlatWorkGroupSize` honor existing attribute (PR #114357)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 09:46:26 PST 2024


================
@@ -936,6 +936,19 @@ getIntegerPairAttribute(const Function &F, StringRef Name,
                         std::pair<unsigned, unsigned> Default,
                         bool OnlyFirstRequired = false);
 
+/// \returns A pair of integer values requested using \p F's \p Name attribute
+/// in "first[,second]" format ("second" is optional unless \p OnlyFirstRequired
+/// is false).
+///
+/// \returns \p std::nullopt if attribute is not present.
+///
+/// \returns \p std::nullopt and emits error if one of the requested values
+/// cannot be converted to integer, or \p OnlyFirstRequired is false and
+/// "second" value is not present.
+std::optional<std::pair<unsigned, std::optional<unsigned>>>
----------------
shiltian wrote:

Our front end can still emit `"X,"`. I think we could potentially fix this in the front end and then remove the 2nd optional entry.

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


More information about the llvm-commits mailing list