[llvm] r339271 - AMDGPU: Error more gracefully on libcalls

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 8 09:58:40 PDT 2018


Author: arsenm
Date: Wed Aug  8 09:58:39 2018
New Revision: 339271

URL: http://llvm.org/viewvc/llvm-project?rev=339271&view=rev
Log:
AMDGPU: Error more gracefully on libcalls

I think this is the only situation where the callsite
will have a null instruction.

Added:
    llvm/trunk/test/CodeGen/AMDGPU/div_i128.ll
Modified:
    llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp?rev=339271&r1=339270&r2=339271&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp Wed Aug  8 09:58:39 2018
@@ -2376,6 +2376,9 @@ SDValue SITargetLowering::LowerCall(Call
                               "unsupported call to variadic function ");
   }
 
+  if (!CLI.CS.getInstruction())
+    report_fatal_error("unsupported libcall legalization");
+
   if (!CLI.CS.getCalledFunction()) {
     return lowerUnhandledCall(CLI, InVals,
                               "unsupported indirect call to function ");

Added: llvm/trunk/test/CodeGen/AMDGPU/div_i128.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/div_i128.ll?rev=339271&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/div_i128.ll (added)
+++ llvm/trunk/test/CodeGen/AMDGPU/div_i128.ll Wed Aug  8 09:58:39 2018
@@ -0,0 +1,7 @@
+; RUN: not llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs  %s 2>&1 | FileCheck %s
+
+; CHECK: LLVM ERROR: unsupported libcall legalization
+define i128 @v_sdiv_i128_vv(i128 %lhs, i128 %rhs) {
+  %shl = sdiv i128 %lhs, %rhs
+  ret i128 %shl
+}




More information about the llvm-commits mailing list