aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorPhoebe Wang <phoebe.wang@intel.com>2022-12-21 11:39:11 +0800
committerPhoebe Wang <phoebe.wang@intel.com>2022-12-21 11:54:05 +0800
commite746a9a600a0f697009820eb6acf8eff65853f0f (patch)
tree116f074c8a2a05a9996d46ee187e9244ae576eae /clang/lib/CodeGen/CodeGenFunction.cpp
parenteeb8de936303e0341417b4580b456ba6ea2a82f7 (diff)
downloadllvm-e746a9a600a0f697009820eb6acf8eff65853f0f.zip
llvm-e746a9a600a0f697009820eb6acf8eff65853f0f.tar.gz
llvm-e746a9a600a0f697009820eb6acf8eff65853f0f.tar.bz2
[Clang] Emit "min-legal-vector-width" attribute for X86 only
This is an alternative way of D139627 suggested by Craig. Creently only X86 backend uses this attribute. Let's just emit for X86 only. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D139701
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 874a083..a8d9b81 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -499,7 +499,9 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
// 4. Width of vector arguments and return types for this function.
// 5. Width of vector aguments and return types for functions called by this
// function.
- CurFn->addFnAttr("min-legal-vector-width", llvm::utostr(LargestVectorWidth));
+ if (getContext().getTargetInfo().getTriple().isX86())
+ CurFn->addFnAttr("min-legal-vector-width",
+ llvm::utostr(LargestVectorWidth));
// Add vscale_range attribute if appropriate.
Optional<std::pair<unsigned, unsigned>> VScaleRange =