[llvm] r330774 - AMDGPU/GlobalISel: Fall-back to SelectionDAG for non-void functions
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 24 14:29:36 PDT 2018
Author: tstellar
Date: Tue Apr 24 14:29:36 2018
New Revision: 330774
URL: http://llvm.org/viewvc/llvm-project?rev=330774&view=rev
Log:
AMDGPU/GlobalISel: Fall-back to SelectionDAG for non-void functions
Reviewers: arsenm, nhaehnle
Reviewed By: nhaehnle
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D45843
Added:
llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp?rev=330774&r1=330773&r2=330774&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUCallLowering.cpp Tue Apr 24 14:29:36 2018
@@ -32,6 +32,10 @@ AMDGPUCallLowering::AMDGPUCallLowering(c
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;
}
Added: llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll?rev=330774&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll (added)
+++ llvm/trunk/test/CodeGen/AMDGPU/GlobalISel/todo.ll Tue Apr 24 14:29:36 2018
@@ -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
+}
More information about the llvm-commits
mailing list