Index: lib/Target/AMDGPU/SIISelLowering.cpp =================================================================== --- lib/Target/AMDGPU/SIISelLowering.cpp +++ lib/Target/AMDGPU/SIISelLowering.cpp @@ -2386,6 +2386,9 @@ "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 "); Index: test/CodeGen/AMDGPU/div_i128.ll =================================================================== --- /dev/null +++ test/CodeGen/AMDGPU/div_i128.ll @@ -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 +}