HomePhabricator

[X86] Prevent passing vectors of __int128 as <X x i128> in llvm IR

Description

[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.

Details

Committed
ctopperThu, Sep 5, 11:02 PM
Parents
rL371168: [X86] Pre-commit vector of __int128 test cases for D64672.
Branches
Unknown
Tags
Unknown