[PATCH] D45843: AMDGPU/GlobalISel: Fall-back to SelectionDAG for non-void functions

Tom Stellard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 24 14:32:56 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL330774: AMDGPU/GlobalISel: Fall-back to SelectionDAG for non-void functions (authored by tstellar, committed by ).

Repository:
  rL LLVM

https://reviews.llvm.org/D45843

Files:
  llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
  llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll


Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
@@ -32,6 +32,10 @@
 
 bool AMDGPUCallLowering::lowerReturn(MachineIRBuilder &MIRBuilder,
                                      const Value *Val, unsigned VReg) const {
+  // FIXME: Add support for non-void returns.
+  if (Val)
+    return false;
+
   MIRBuilder.buildInstr(AMDGPU::S_ENDPGM);
   return true;
 }
Index: llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll
@@ -0,0 +1,10 @@
+; RUN: llc -mtriple=amdgcn-mesa-mesa3d -global-isel -global-isel-abort=2 %s -o - 2>&1 | FileCheck %s
+
+; This isn't implemented, but we need to make sure we fall back to SelectionDAG
+; instead of generating wrong code.
+; CHECK: warning: Instruction selection used fallback path for non_void_ret
+; CHECK: non_void_ret:
+; CHECK-NOT: s_endpgm
+define amdgpu_vs i32 @non_void_ret() {
+  ret i32 0
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45843.143810.patch
Type: text/x-patch
Size: 1202 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180424/3f067d60/attachment.bin>


More information about the llvm-commits mailing list