[flang-commits] [flang] eb436da - [flang] automatically load FIR dialect with hlfir

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Tue Feb 14 05:45:51 PST 2023


Author: Tom Eccles
Date: 2023-02-14T13:44:58Z
New Revision: eb436da6b8269407e03b6954319de77a082f4adf

URL: https://github.com/llvm/llvm-project/commit/eb436da6b8269407e03b6954319de77a082f4adf
DIFF: https://github.com/llvm/llvm-project/commit/eb436da6b8269407e03b6954319de77a082f4adf.diff

LOG: [flang] automatically load FIR dialect with hlfir

MLIR loads dialects lazily so if a hlfir type (or operation) is found
before any fir type (or operation), the fir dialect will not have been
loaded when the hlfir thing is verified. Verification of some hlfir
operations does depend on fir types (e.g. hlfir.sum needs
fir::SequenceType).

Tablegen change recommended by jeanPerier

Differential Revision: https://reviews.llvm.org/D143930

Added: 
    

Modified: 
    flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
    flang/include/flang/Optimizer/HLFIR/HLFIROps.h

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td b/flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
index 23ad2eda36732..eca5f05d3d02d 100644
--- a/flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
+++ b/flang/include/flang/Optimizer/HLFIR/HLFIROpBase.td
@@ -39,6 +39,7 @@ def hlfir_Dialect : Dialect {
 
   let useDefaultTypePrinterParser = 1;
   let cppNamespace = "hlfir";
+  let dependentDialects = ["fir::FIROpsDialect"];
 }
 
 

diff  --git a/flang/include/flang/Optimizer/HLFIR/HLFIROps.h b/flang/include/flang/Optimizer/HLFIR/HLFIROps.h
index e0e718346c115..94ea77260e340 100644
--- a/flang/include/flang/Optimizer/HLFIR/HLFIROps.h
+++ b/flang/include/flang/Optimizer/HLFIR/HLFIROps.h
@@ -10,6 +10,7 @@
 #define FORTRAN_OPTIMIZER_HLFIR_HLFIROPS_H
 
 #include "flang/Optimizer/Dialect/FIRAttr.h"
+#include "flang/Optimizer/Dialect/FIRDialect.h"
 #include "flang/Optimizer/Dialect/FIRType.h"
 #include "flang/Optimizer/Dialect/FortranVariableInterface.h"
 #include "flang/Optimizer/HLFIR/HLFIRDialect.h"


        


More information about the flang-commits mailing list