aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 63665d8..493dec7 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -1165,6 +1165,18 @@ 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.getVScaleRangeMin();
+ if (VScale && VScale == Attr.getVScaleRangeMax())
+ return VScale;
+
+ return 0;
+}
+
bool llvm::NullPointerIsDefined(const Function *F, unsigned AS) {
if (F && F->nullPointerIsDefined())
return true;