================
@@ -1168,6 +1168,15 @@ bool Function::nullPointerIsDefined() const {
return hasFnAttribute(Attribute::NullPointerIsValid);
}
+unsigned Function::getVScaleValue() const {
+ Attribute Attr = getFnAttribute(Attribute::VScaleRange);
+ if (!Attr.isValid())
+ return 0;
+
+ unsigned VScale = Attr.getVScaleRangeMax().value_or(0);
+ return VScale == Attr.getVScaleRangeMin() ? VScale : 0;
----------------
rj-jesus wrote:
Nit: maybe you could do `getVScaleRangeMin()` first to avoid the `.value_or(0)`
(since the former isn't `std::optional`)?
https://github.com/llvm/llvm-project/pull/130973
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits