Index: lib/CodeGen/TargetInfo.cpp =================================================================== --- lib/CodeGen/TargetInfo.cpp +++ lib/CodeGen/TargetInfo.cpp @@ -3034,7 +3034,7 @@ return ABIArgInfo::getDirect(); } - if (RT || Ty->isMemberPointerType()) { + if (RT || Ty->isAnyComplexType() || Ty->isMemberPointerType()) { // MS x64 ABI requirement: "Any argument that doesn't fit in 8 bytes, or is // not 1, 2, 4, or 8 bytes, must be passed by reference." if (Width > 64 || !llvm::isPowerOf2_64(Width)) Index: test/CodeGen/x86_64-arguments-win32.c =================================================================== --- test/CodeGen/x86_64-arguments-win32.c +++ test/CodeGen/x86_64-arguments-win32.c @@ -14,3 +14,9 @@ // CHECK-LABEL: define void @f4(i16 %a) void f4(unsigned short a) {} + +// CHECK-LABEL: define void @f5(i64 %a.coerce) +void f5(_Complex float a) {} + +// CHECK-LABEL: define void @f6({ double, double }* %a) +void f6(_Complex double a) {}