diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp --- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp @@ -1227,6 +1227,7 @@ unreachableInst, "alloca_split")); ompLoc.IP = builder.saveIP(); unreachableInst->removeFromParent(); + unreachableInst->deleteValue(); } builder.restoreIP(ompBuilder->createAtomicCapture( ompLoc, findAllocaInsertPoint(builder, moduleTranslation), llvmAtomicX,