[X86] Prevent passing vectors of __int128 as <X x i128> in llvm IR
authorCraig Topper <craig.topper@intel.com>
Fri, 6 Sep 2019 06:02:13 +0000 (06:02 +0000)
committerCraig Topper <craig.topper@intel.com>
Fri, 6 Sep 2019 06:02:13 +0000 (06:02 +0000)
commit6c8a34ed9b49704bdd60838143047c62ba9f2502
tree6f43756e7ea6f9c3ac2995dadeae6492e50d7e23
parent890b551fe79247d0dbc5d8ad34d171352fa0060e
[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
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/LangOptions.h
clang/lib/CodeGen/TargetInfo.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/x86-vec-i128.c