[llvm] r243485 - [mips][FastISel] Fix call lowering by bailing out on "fastcc" calls.

Vasileios Kalintiris Vasileios.Kalintiris at imgtec.com
Tue Jul 28 14:43:31 PDT 2015


Author: vkalintiris
Date: Tue Jul 28 16:43:31 2015
New Revision: 243485

URL: http://llvm.org/viewvc/llvm-project?rev=243485&view=rev
Log:
[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

Added:
    llvm/trunk/test/CodeGen/Mips/Fast-ISel/fastcc-miss.ll
Modified:
    llvm/trunk/lib/Target/Mips/MipsFastISel.cpp

Modified: llvm/trunk/lib/Target/Mips/MipsFastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsFastISel.cpp?rev=243485&r1=243484&r2=243485&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsFastISel.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsFastISel.cpp Tue Jul 28 16:43:31 2015
@@ -1245,6 +1245,10 @@ bool MipsFastISel::fastLowerCall(CallLow
   const Value *Callee = CLI.Callee;
   MCSymbol *Symbol = CLI.Symbol;
 
+  // Do not handle FastCC.
+  if (CC == CallingConv::Fast)
+    return false;
+
   // Allow SelectionDAG isel to handle tail calls.
   if (IsTailCall)
     return false;
@@ -1422,6 +1426,11 @@ bool MipsFastISel::selectRet(const Instr
 
   if (Ret->getNumOperands() > 0) {
     CallingConv::ID CC = F.getCallingConv();
+
+    // Do not handle FastCC.
+    if (CC == CallingConv::Fast)
+      return false;
+
     SmallVector<ISD::OutputArg, 4> Outs;
     GetReturnInfo(F.getReturnType(), F.getAttributes(), Outs, TLI, DL);
 

Added: llvm/trunk/test/CodeGen/Mips/Fast-ISel/fastcc-miss.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/Fast-ISel/fastcc-miss.ll?rev=243485&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/Fast-ISel/fastcc-miss.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/Fast-ISel/fastcc-miss.ll Tue Jul 28 16:43:31 2015
@@ -0,0 +1,16 @@
+; RUN: llc < %s -march=mipsel -mcpu=mips32r2 -O0 -relocation-model=pic \
+; RUN:     -fast-isel=true -mips-fast-isel -fast-isel-verbose 2>&1 | \
+; RUN:   FileCheck %s
+
+; CHECK:      FastISel missed call:
+; CHECK-SAME: %call = call fastcc i32 @foo(i32 signext %a, i32 signext %b)
+
+define internal i32 @bar(i32 signext %a, i32 signext %b) {
+  %s = and i32 %a, %b
+  ret i32 %s
+}
+
+define i32 @foo(i32 signext %a, i32 signext %b) {
+  %call = call fastcc i32 @foo(i32 signext %a, i32 signext %b)
+  ret i32 %call
+}





More information about the llvm-commits mailing list