diff --git a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp --- a/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp +++ b/mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp @@ -116,19 +116,20 @@ target.addDynamicallyLegalOp< mlir::omp::CriticalOp, mlir::omp::ParallelOp, mlir::omp::WsLoopOp, mlir::omp::SimdLoopOp, mlir::omp::MasterOp, mlir::omp::SectionsOp, - mlir::omp::SingleOp, mlir::omp::TaskOp>([&](Operation *op) { - return typeConverter.isLegal(&op->getRegion(0)) && - typeConverter.isLegal(op->getOperandTypes()) && - typeConverter.isLegal(op->getResultTypes()); - }); - target.addDynamicallyLegalOp( + mlir::omp::SingleOp, mlir::omp::TaskOp, mlir::omp::DataOp>( [&](Operation *op) { - return typeConverter.isLegal(op->getOperandTypes()) && + return typeConverter.isLegal(&op->getRegion(0)) && + typeConverter.isLegal(op->getOperandTypes()) && typeConverter.isLegal(op->getResultTypes()); }); + target + .addDynamicallyLegalOp( + [&](Operation *op) { + return typeConverter.isLegal(op->getOperandTypes()) && + typeConverter.isLegal(op->getResultTypes()); + }); target.addDynamicallyLegalOp([&](Operation *op) { return typeConverter.isLegal(op->getOperandTypes()); }); @@ -137,19 +138,19 @@ void mlir::populateOpenMPToLLVMConversionPatterns(LLVMTypeConverter &converter, RewritePatternSet &patterns) { patterns.add< - ReductionOpConversion, RegionOpConversion, - RegionOpConversion, ReductionOpConversion, - RegionOpConversion, RegionOpConversion, - RegionOpConversion, RegionOpConversion, - RegionOpConversion, RegionOpConversion, - RegionOpConversion, + LegalizeDataOpForLLVMTranslation, + LegalizeDataOpForLLVMTranslation, + LegalizeDataOpForLLVMTranslation, ReductionOpConversion, + RegionOpConversion, RegionOpConversion, + ReductionOpConversion, RegionOpConversion, + RegionOpConversion, RegionOpConversion, + RegionOpConversion, RegionOpConversion, + RegionOpConversion, RegionOpConversion, + RegionOpConversion, RegionLessOpWithVarOperandsConversion, RegionLessOpWithVarOperandsConversion, RegionLessOpWithVarOperandsConversion, - RegionLessOpWithVarOperandsConversion, - LegalizeDataOpForLLVMTranslation, - LegalizeDataOpForLLVMTranslation, - LegalizeDataOpForLLVMTranslation>(converter); + RegionLessOpWithVarOperandsConversion>(converter); } namespace {