aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorPhoebe Wang <phoebe.wang@intel.com>2022-03-29 09:41:31 +0800
committerPhoebe Wang <phoebe.wang@intel.com>2022-03-29 11:29:57 +0800
commitcd26190a10fceb6e1472fabcd9e1736f62f078c4 (patch)
tree7bf091b5aae7eaa015321dbe801713a0f839e7a0 /clang/lib/CodeGen/CodeGenFunction.cpp
parent48e251b1d60c872e0ce8ede6c030b053ebaa5ee9 (diff)
downloadllvm-cd26190a10fceb6e1472fabcd9e1736f62f078c4.zip
llvm-cd26190a10fceb6e1472fabcd9e1736f62f078c4.tar.gz
llvm-cd26190a10fceb6e1472fabcd9e1736f62f078c4.tar.bz2
[X86][regcall] Support passing / returning structures
Currently, the regcall calling conversion in Clang doesn't match with ICC when passing / returning structures. https://godbolt.org/z/axxKMKrW7 This patch tries to fix the problem to match with ICC. Reviewed By: LuoYuanke Differential Revision: https://reviews.llvm.org/D122104
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 15719d1..aadf081 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -485,6 +485,9 @@ void CodeGenFunction::FinishFunction(SourceLocation EndLoc) {
std::max((uint64_t)LargestVectorWidth,
VT->getPrimitiveSizeInBits().getKnownMinSize());
+ if (CurFnInfo->getMaxVectorWidth() > LargestVectorWidth)
+ LargestVectorWidth = CurFnInfo->getMaxVectorWidth();
+
// Add the required-vector-width attribute. This contains the max width from:
// 1. min-vector-width attribute used in the source program.
// 2. Any builtins used that have a vector width specified.