aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 3cade80..1aa2d44 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -2029,3 +2029,14 @@ void AttributeFuncs::mergeAttributesForOutlining(Function &Base,
// that aspect in the merged function.
mergeFnAttrs(Base, ToMerge);
}
+
+void AttributeFuncs::updateMinLegalVectorWidthAttr(Function &Fn,
+ uint64_t Width) {
+ Attribute Attr = Fn.getFnAttribute("min-legal-vector-width");
+ if (Attr.isValid()) {
+ uint64_t OldWidth;
+ Attr.getValueAsString().getAsInteger(0, OldWidth);
+ if (Width > OldWidth)
+ Fn.addFnAttr("min-legal-vector-width", llvm::utostr(Width));
+ }
+}