Skip to content

Commit a0f0b23

Browse files
committed
[AMDGPU] Remove calling conv check on entry function
It is undefined behavior to call a function with a mismatched calling convention. Rather than crash on this behavior, it should compile.
1 parent ccd35e5 commit a0f0b23

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,6 @@ AMDGPUResourceUsageAnalysisImpl::analyzeResourceUsage(
256256

257257
const Function *Callee = getCalleeFunction(*CalleeOp);
258258

259-
// Avoid crashing on undefined behavior with an illegal call to a
260-
// kernel. If a callsite's calling convention doesn't match the
261-
// function's, it's undefined behavior. If the callsite calling
262-
// convention does match, that would have errored earlier.
263-
if (Callee && AMDGPU::isEntryFunctionCC(Callee->getCallingConv()))
264-
report_fatal_error("invalid call to entry function");
265-
266259
auto isSameFunction = [](const MachineFunction &MF, const Function *F) {
267260
return F == &MF.getFunction();
268261
};

0 commit comments

Comments
 (0)