diff options
author | Craig Topper <craig.topper@intel.com> | 2019-09-06 06:02:13 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2019-09-06 06:02:13 +0000 |
commit | 6c8a34ed9b49704bdd60838143047c62ba9f2502 (patch) | |
tree | 6f43756e7ea6f9c3ac2995dadeae6492e50d7e23 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 890b551fe79247d0dbc5d8ad34d171352fa0060e (diff) | |
download | llvm-6c8a34ed9b49704bdd60838143047c62ba9f2502.zip llvm-6c8a34ed9b49704bdd60838143047c62ba9f2502.tar.gz llvm-6c8a34ed9b49704bdd60838143047c62ba9f2502.tar.bz2 |
[X86] Prevent passing vectors of __int128 as <X x i128> in llvm IR
As far as I can tell, gcc passes 256/512 bit vectors __int128 in memory. And passes a vector of 1 _int128 in an xmm register. The backend considers <X x i128> as an illegal type and will scalarize any arguments with that type. So we need to coerce the argument types in the frontend to match to avoid the illegal type.
I'm restricting this to change to Linux and NetBSD based on the
how similar ABI changes have been handled in the past.
PS4, FreeBSD, and Darwin are unaffected. I've also added a
new -fclang-abi-compat version to restore the old behavior.
This issue was identified in PR42607. Though even with the types changed, we still seem to be doing some unnecessary stack realignment.
llvm-svn: 371169
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 711f7df..f162453 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3164,6 +3164,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.setClangABICompat(LangOptions::ClangABI::Ver6); else if (Major <= 7) Opts.setClangABICompat(LangOptions::ClangABI::Ver7); + else if (Major <= 9) + Opts.setClangABICompat(LangOptions::ClangABI::Ver9); } else if (Ver != "latest") { Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args) << A->getValue(); |