Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,6 @@ AMDGPUResourceUsageAnalysisImpl::analyzeResourceUsage(

const Function *Callee = getCalleeFunction(*CalleeOp);

// Avoid crashing on undefined behavior with an illegal call to a
// kernel. If a callsite's calling convention doesn't match the
// function's, it's undefined behavior. If the callsite calling
// convention does match, that would have errored earlier.
if (Callee && AMDGPU::isEntryFunctionCC(Callee->getCallingConv()))
report_fatal_error("invalid call to entry function");

auto isSameFunction = [](const MachineFunction &MF, const Function *F) {
return F == &MF.getFunction();
};
Expand Down
8 changes: 8 additions & 0 deletions llvm/test/CodeGen/AMDGPU/cc-entry.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 < %s 2>&1 | FileCheck %s

define amdgpu_kernel void @entry_fn() {
; CHECK-NOT: LLVM ERROR: invalid call to entry function
entry:
call void @entry_fn()
ret void
}