[PATCH] D65321: [MIPS GlobalISel] Fix check for void return during lowerCall

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 06:19:13 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL367107: [MIPS GlobalISel] Fix check for void return during lowerCall (authored by Petar.Avramovic, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D65321?vs=211888&id=211926#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65321/new/

https://reviews.llvm.org/D65321

Files:
  llvm/trunk/lib/Target/Mips/MipsCallLowering.cpp
  llvm/trunk/test/CodeGen/Mips/GlobalISel/irtranslator/call.ll


Index: llvm/trunk/test/CodeGen/Mips/GlobalISel/irtranslator/call.ll
===================================================================
--- llvm/trunk/test/CodeGen/Mips/GlobalISel/irtranslator/call.ll
+++ llvm/trunk/test/CodeGen/Mips/GlobalISel/irtranslator/call.ll
@@ -167,3 +167,27 @@
   call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 %dest, i8* align 1 %src, i32 %length, i1 false)
   ret void
 }
+
+declare void @f_with_void_ret();
+
+define void @call_f_with_void_ret() {
+  ; MIPS32-LABEL: name: call_f_with_void_ret
+  ; MIPS32: bb.1.entry:
+  ; MIPS32:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
+  ; MIPS32:   JAL @f_with_void_ret, csr_o32, implicit-def $ra, implicit-def $sp
+  ; MIPS32:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
+  ; MIPS32:   RetRA
+  ; MIPS32_PIC-LABEL: name: call_f_with_void_ret
+  ; MIPS32_PIC: bb.1.entry:
+  ; MIPS32_PIC:   liveins: $t9, $v0
+  ; MIPS32_PIC:   [[ADDu:%[0-9]+]]:gpr32 = ADDu $v0, $t9
+  ; MIPS32_PIC:   ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
+  ; MIPS32_PIC:   [[GV:%[0-9]+]]:gpr32(p0) = G_GLOBAL_VALUE target-flags(mips-got-call) @f_with_void_ret
+  ; MIPS32_PIC:   $gp = COPY [[ADDu]]
+  ; MIPS32_PIC:   JALRPseudo [[GV]](p0), csr_o32, implicit-def $ra, implicit-def $sp, implicit-def $gp
+  ; MIPS32_PIC:   ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
+  ; MIPS32_PIC:   RetRA
+entry:
+  call void @f_with_void_ret()
+  ret void
+}
Index: llvm/trunk/lib/Target/Mips/MipsCallLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/Mips/MipsCallLowering.cpp
+++ llvm/trunk/lib/Target/Mips/MipsCallLowering.cpp
@@ -514,7 +514,7 @@
       return false;
   }
 
-  if (OrigRet.Regs[0] && !isSupportedType(OrigRet.Ty))
+  if (!OrigRet.Ty->isVoidTy() && !isSupportedType(OrigRet.Ty))
     return false;
 
   MachineFunction &MF = MIRBuilder.getMF();
@@ -599,7 +599,7 @@
                          *STI.getRegBankInfo());
   }
 
-  if (OrigRet.Regs[0]) {
+  if (!OrigRet.Ty->isVoidTy()) {
     ArgInfos.clear();
     SmallVector<unsigned, 8> OrigRetIndices;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65321.211926.patch
Type: text/x-patch
Size: 2108 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190726/8983c467/attachment.bin>


More information about the llvm-commits mailing list