forked from OSchip/llvm-project
Temporarily revert "[PowerPC] Allow tail calls of fastcc functions from C CallingConv functions."
It is causing sanitizer failures on llvm tests in a bootstrapped compiler. No bot link since it's currently down, but following up to get the bot up. This reverts commit r319218. llvm-svn: 320106
This commit is contained in:
parent
b0c97e566f
commit
a469acac03
|
@ -4397,18 +4397,13 @@ hasSameArgumentList(const Function *CallerFn, ImmutableCallSite CS) {
|
||||||
static bool
|
static bool
|
||||||
areCallingConvEligibleForTCO_64SVR4(CallingConv::ID CallerCC,
|
areCallingConvEligibleForTCO_64SVR4(CallingConv::ID CallerCC,
|
||||||
CallingConv::ID CalleeCC) {
|
CallingConv::ID CalleeCC) {
|
||||||
// tail calls are possible with fastcc and ccc.
|
// Tail or Sibling call optimization (TCO/SCO) needs callee and caller to
|
||||||
auto isTailCallableCC = [] (CallingConv::ID CC){
|
// have the same calling convention.
|
||||||
return CC == CallingConv::C || CC == CallingConv::Fast;
|
if (CallerCC != CalleeCC)
|
||||||
};
|
|
||||||
if (!isTailCallableCC(CallerCC) || !isTailCallableCC(CalleeCC))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// We can safely tail call both fastcc and ccc callees from a c calling
|
// Tail or Sibling calls can be done with fastcc/ccc.
|
||||||
// convention caller. If the caller is fastcc, we may have less stack space
|
return (CallerCC == CallingConv::Fast || CallerCC == CallingConv::C);
|
||||||
// then a non-fastcc caller with the same signature so disable tail-calls in
|
|
||||||
// that case.
|
|
||||||
return CallerCC == CallingConv::C || CallerCC == CalleeCC;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -42,10 +42,10 @@ if.end4: ; preds = %if.end
|
||||||
if.then6: ; preds = %if.end4
|
if.then6: ; preds = %if.end4
|
||||||
%call7 = tail call fastcc signext i32 @call3(i32 signext %a, i32 signext %b, i32 signext %c)
|
%call7 = tail call fastcc signext i32 @call3(i32 signext %a, i32 signext %b, i32 signext %c)
|
||||||
br label %return
|
br label %return
|
||||||
; tail calling a fastcc function from a ccc function is supported.
|
; No duplication here because the calling convention mismatch means we won't tail-call
|
||||||
; CHECK_LABEL: if.then13:
|
; CHECK_LABEL: if.then13:
|
||||||
; CHECK: %[[T2:[a-zA-Z0-9]+]] = tail call fastcc signext i32 @call3
|
; CHECK: tail call fastcc signext i32 @call3
|
||||||
; CHECK-NEXT: ret i32 %[[T2]]
|
; CHECK-NEXT: br
|
||||||
|
|
||||||
return: ; preds = %if.end4, %if.then6, %if.then2, %if.then
|
return: ; preds = %if.end4, %if.then6, %if.then2, %if.then
|
||||||
%retval.0 = phi i32 [ %call, %if.then ], [ %call3, %if.then2 ], [ %call7, %if.then6 ], [ %c, %if.end4 ]
|
%retval.0 = phi i32 [ %call, %if.then ], [ %call3, %if.then2 ], [ %call7, %if.then6 ], [ %c, %if.end4 ]
|
||||||
|
|
Loading…
Reference in New Issue