Skip to content

Commit

Permalink
[Flang][MLIR][OpenMP] Simplify data layot setting using helper setMLI…
Browse files Browse the repository at this point in the history
…RDataLayout
  • Loading branch information
agozillon committed Jan 17, 2024
1 parent b20b7ee commit 62d6b6b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions flang/lib/Optimizer/CodeGen/CodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3869,13 +3869,7 @@ class FIRToLLVMLowering

if (!forcedDataLayout.empty()) {
llvm::DataLayout dl(forcedDataLayout);
mlir::MLIRContext *context = mod.getContext();
mod->setAttr(
mlir::LLVM::LLVMDialect::getDataLayoutAttrName(),
mlir::StringAttr::get(context, dl.getStringRepresentation()));
mlir::DataLayoutSpecInterface dlSpec =
mlir::translateDataLayout(dl, context);
mod->setAttr(mlir::DLTIDialect::kDataLayoutAttrName, dlSpec);
fir::support::setMLIRDataLayout(mod, dl);
}

// Run dynamic pass pipeline for converting Math dialect
Expand Down

0 comments on commit 62d6b6b

Please sign in to comment.