Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit a0b4070

Browse files
Vasileios KalintirisVasileios Kalintiris
Vasileios Kalintiris
authored and
Vasileios Kalintiris
committed
[mips][FastISel] Fix call lowering by bailing out on "fastcc" calls.
Summary: Currently, we support only the MIPS O32 ABI calling convention for call lowering. With this change we avoid using the O32 calling convetion for lowering calls marked as using the fast calling convention. Reviewers: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11515 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243485 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 86eea13 commit a0b4070

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/Target/Mips/MipsFastISel.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,10 @@ bool MipsFastISel::fastLowerCall(CallLoweringInfo &CLI) {
12451245
const Value *Callee = CLI.Callee;
12461246
MCSymbol *Symbol = CLI.Symbol;
12471247

1248+
// Do not handle FastCC.
1249+
if (CC == CallingConv::Fast)
1250+
return false;
1251+
12481252
// Allow SelectionDAG isel to handle tail calls.
12491253
if (IsTailCall)
12501254
return false;
@@ -1422,6 +1426,11 @@ bool MipsFastISel::selectRet(const Instruction *I) {
14221426

14231427
if (Ret->getNumOperands() > 0) {
14241428
CallingConv::ID CC = F.getCallingConv();
1429+
1430+
// Do not handle FastCC.
1431+
if (CC == CallingConv::Fast)
1432+
return false;
1433+
14251434
SmallVector<ISD::OutputArg, 4> Outs;
14261435
GetReturnInfo(F.getReturnType(), F.getAttributes(), Outs, TLI, DL);
14271436

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; RUN: llc < %s -march=mipsel -mcpu=mips32r2 -O0 -relocation-model=pic \
2+
; RUN: -fast-isel=true -mips-fast-isel -fast-isel-verbose 2>&1 | \
3+
; RUN: FileCheck %s
4+
5+
; CHECK: FastISel missed call:
6+
; CHECK-SAME: %call = call fastcc i32 @foo(i32 signext %a, i32 signext %b)
7+
8+
define internal i32 @bar(i32 signext %a, i32 signext %b) {
9+
%s = and i32 %a, %b
10+
ret i32 %s
11+
}
12+
13+
define i32 @foo(i32 signext %a, i32 signext %b) {
14+
%call = call fastcc i32 @foo(i32 signext %a, i32 signext %b)
15+
ret i32 %call
16+
}

0 commit comments

Comments
 (0)