Skip to content

Commit c782f23

Browse files
committed
Add check for empty function.
1 parent dc44fb7 commit c782f23

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5473,6 +5473,9 @@ static void addAllocasForDeclareTargetFunctionPointerArgs(
54735473
if (!llvm::Triple(M.getTargetTriple()).isAMDGPU())
54745474
return;
54755475

5476+
if (Fn->empty())
5477+
return;
5478+
54765479
llvm::IRBuilderBase &builder = ompBuilder->Builder;
54775480
llvm::OpenMPIRBuilder::InsertPointTy curInsert = builder.saveIP();
54785481
unsigned int allocaAS = M.getDataLayout().getAllocaAddrSpace();

0 commit comments

Comments
 (0)