From 148779df305667b6942fee7e758fdf81a6498f38 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 3 May 2017 20:26:11 +0000 Subject: Vendor import of llvm trunk r302069: https://llvm.org/svn/llvm-project/llvm/trunk@302069 --- lib/Target/X86/X86FastISel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/Target/X86/X86FastISel.cpp') diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index fd11b671dd9b..ebd179e786da 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -3181,6 +3181,15 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) { bool Is64Bit = Subtarget->is64Bit(); bool IsWin64 = Subtarget->isCallingConvWin64(CC); + const CallInst *CI = + CLI.CS ? dyn_cast(CLI.CS->getInstruction()) : nullptr; + const Function *CalledFn = CI ? CI->getCalledFunction() : nullptr; + + // Functions with no_caller_saved_registers that need special handling. + if ((CI && CI->hasFnAttr("no_caller_saved_registers")) || + (CalledFn && CalledFn->hasFnAttribute("no_caller_saved_registers"))) + return false; + // Handle only C, fastcc, and webkit_js calling conventions for now. switch (CC) { default: return false; -- cgit v1.2.3