Skip to content

Commit 47aee8b

Browse files
authored
[flang][OpenMP] Set OpenMP attributes in MLIR module in bbc before lo… (#82774)
…wering Right now attributes like OpenMP version or target attributes for offload are set after lowering in bbc. The flang frontend sets them before lowering, making them available in the lowering process. This change sets them before lowering in bbc as well.
1 parent 5c90527 commit 47aee8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flang/tools/bbc/bbc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ static mlir::LogicalResult convertFortranSourceToMLIR(
360360
semanticsContext.targetCharacteristics(), parsing.allCooked(),
361361
targetTriple, kindMap, loweringOptions, envDefaults,
362362
semanticsContext.languageFeatures(), targetMachine);
363-
burnside.lower(parseTree, semanticsContext);
364363
mlir::ModuleOp mlirModule = burnside.getModule();
365364
if (enableOpenMP) {
366365
if (enableOpenMPGPU && !enableOpenMPDevice) {
@@ -376,6 +375,7 @@ static mlir::LogicalResult convertFortranSourceToMLIR(
376375
setOffloadModuleInterfaceAttributes(mlirModule, offloadModuleOpts);
377376
setOpenMPVersionAttribute(mlirModule, setOpenMPVersion);
378377
}
378+
burnside.lower(parseTree, semanticsContext);
379379
std::error_code ec;
380380
std::string outputName = outputFilename;
381381
if (!outputName.size())

0 commit comments

Comments
 (0)