[PATCH] D112918: [fir][NFC] Address post commit comments on D112845

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 1 09:57:07 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0c4a7a52636e: [fir][NFC] Address post commit comments on D112845 (authored by clementval).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112918/new/

https://reviews.llvm.org/D112918

Files:
  flang/include/flang/Optimizer/CodeGen/CGPasses.td
  flang/lib/Optimizer/CodeGen/CodeGen.cpp


Index: flang/lib/Optimizer/CodeGen/CodeGen.cpp
===================================================================
--- flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -44,9 +44,8 @@
     return *static_cast<fir::LLVMTypeConverter *>(this->getTypeConverter());
   }
 };
-} // namespace
 
-namespace {
+// Lower `fir.address_of` operation to `llvm.address_of` operation.
 struct AddrOfOpConversion : public FIROpConversion<fir::AddrOfOp> {
   using FIROpConversion::FIROpConversion;
 
@@ -60,6 +59,7 @@
   }
 };
 
+/// Lower `fir.has_value` operation to `llvm.return` operation.
 struct HasValueOpConversion : public FIROpConversion<fir::HasValueOp> {
   using FIROpConversion::FIROpConversion;
 
@@ -71,6 +71,9 @@
   }
 };
 
+/// Lower `fir.global` operation to `llvm.global` operation.
+/// `fir.insert_on_range` operations are replaced with constant dense attribute
+/// if they are applied on the full range.
 struct GlobalOpConversion : public FIROpConversion<fir::GlobalOp> {
   using FIROpConversion::FIROpConversion;
 
@@ -133,6 +136,8 @@
     return true;
   }
 
+  // TODO: String comparaison should be avoided. Replace linkName with an
+  // enumeration.
   mlir::LLVM::Linkage convertLinkage(Optional<StringRef> optLinkage) const {
     if (optLinkage.hasValue()) {
       auto name = optLinkage.getValue();
Index: flang/include/flang/Optimizer/CodeGen/CGPasses.td
===================================================================
--- flang/include/flang/Optimizer/CodeGen/CGPasses.td
+++ flang/include/flang/Optimizer/CodeGen/CGPasses.td
@@ -23,10 +23,7 @@
     will also convert ops in the standard and FIRCG dialects.
   }];
   let constructor = "::fir::createFIRToLLVMPass()";
-  let dependentDialects = [
-    "fir::FIROpsDialect", "fir::FIRCodeGenDialect", "mlir::BuiltinDialect",
-    "mlir::LLVM::LLVMDialect", "mlir::omp::OpenMPDialect"
-  ];
+  let dependentDialects = ["mlir::LLVM::LLVMDialect"];
 }
 
 def CodeGenRewrite : Pass<"cg-rewrite"> {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112918.383824.patch
Type: text/x-patch
Size: 2007 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211101/c21188e1/attachment.bin>


More information about the llvm-commits mailing list