[llvm] r213788 - [FastISel][AArch64] Fix return type in FastLowerCall.

Juergen Ributzka juergen at apple.com
Wed Jul 23 13:03:14 PDT 2014


Author: ributzka
Date: Wed Jul 23 15:03:13 2014
New Revision: 213788

URL: http://llvm.org/viewvc/llvm-project?rev=213788&view=rev
Log:
[FastISel][AArch64] Fix return type in FastLowerCall.

I used the wrong method to obtain the return type inside FinishCall. This fix
simply uses the return type from FastLowerCall, which we already determined to
be a valid type.

Reduced test case from Chad. Thanks.

Added:
    llvm/trunk/test/CodeGen/AArch64/fast-isel-call-return.ll
Modified:
    llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp?rev=213788&r1=213787&r2=213788&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp Wed Jul 23 15:03:13 2014
@@ -138,7 +138,7 @@ private:
   CCAssignFn *CCAssignFnForCall(CallingConv::ID CC) const;
   bool ProcessCallArgs(CallLoweringInfo &CLI, SmallVectorImpl<MVT> &ArgVTs,
                        unsigned &NumBytes);
-  bool FinishCall(CallLoweringInfo &CLI, unsigned NumBytes);
+  bool FinishCall(CallLoweringInfo &CLI, MVT RetVT, unsigned NumBytes);
 
 public:
   // Backend specific FastISel code.
@@ -1270,9 +1270,9 @@ bool AArch64FastISel::ProcessCallArgs(Ca
   return true;
 }
 
-bool AArch64FastISel::FinishCall(CallLoweringInfo &CLI, unsigned NumBytes) {
+bool AArch64FastISel::FinishCall(CallLoweringInfo &CLI, MVT RetVT,
+                                 unsigned NumBytes) {
   CallingConv::ID CC = CLI.CallConv;
-  MVT RetVT = MVT::getVT(CLI.RetTy);
 
   // Issue CALLSEQ_END
   unsigned AdjStackUp = TII.getCallFrameDestroyOpcode();
@@ -1370,7 +1370,7 @@ bool AArch64FastISel::FastLowerCall(Call
   MIB.addRegMask(TRI.getCallPreservedMask(CC));
 
   // Finish off the call including any return values.
-  return FinishCall(CLI, NumBytes);
+  return FinishCall(CLI, RetVT, NumBytes);
 }
 
 bool AArch64FastISel::IsMemCpySmall(uint64_t Len, unsigned Alignment) {

Added: llvm/trunk/test/CodeGen/AArch64/fast-isel-call-return.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/fast-isel-call-return.ll?rev=213788&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/fast-isel-call-return.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/fast-isel-call-return.ll Wed Jul 23 15:03:13 2014
@@ -0,0 +1,12 @@
+; RUN: llc -fast-isel -fast-isel-abort < %s | FileCheck %s
+target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-linux-gnu"
+
+define i8* @test_call_return_type(i64 %size) {
+entry:
+; CHECK: bl xmalloc
+  %0 = call noalias i8* @xmalloc(i64 undef)
+  ret i8* %0
+}
+
+declare noalias i8* @xmalloc(i64)





More information about the llvm-commits mailing list