aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorDávid Bolvanský <david.bolvansky@gmail.com>2021-02-24 07:08:33 +0100
committerDávid Bolvanský <david.bolvansky@gmail.com>2021-02-24 07:08:44 +0100
commit053dc95839b3b8a36db46f8c419e36e632e989cd (patch)
tree0fecdf01128b5b8c872e98b6b13cfd45ad583af9 /clang/lib/CodeGen/CodeGenFunction.cpp
parent0f279c7a5c34eaae797c325c18614def21eba921 (diff)
downloadllvm-053dc95839b3b8a36db46f8c419e36e632e989cd.zip
llvm-053dc95839b3b8a36db46f8c419e36e632e989cd.tar.gz
llvm-053dc95839b3b8a36db46f8c419e36e632e989cd.tar.bz2
Reduce the number of attributes attached to each function
Patch takes advantage of the implicit default behavior to reduce the number of attributes, which in turns reduces compilation time. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D97116
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 5888866..ef7f9fb 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -493,7 +493,8 @@ 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 (LargestVectorWidth)
+ CurFn->addFnAttr("min-legal-vector-width", llvm::utostr(LargestVectorWidth));
// If we generated an unreachable return block, delete it now.
if (ReturnBlock.isValid() && ReturnBlock.getBlock()->use_empty()) {