[PATCH] D146278: [flang] add -flang-experimental-hlfir flag to flang-new

Tom Eccles via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 06:07:02 PDT 2023


tblah added inline comments.
Herald added a subscriber: bviyer.


================
Comment at: flang/include/flang/Tools/CLOptions.inc:251
+    bool stackArrays = false, bool underscoring = true, bool useHLFIR = false) {
+  if (useHLFIR)
+    fir::createHLFIRToFIRPassPipeline(pm, optLevel);
----------------
tblah wrote:
> vzakhari wrote:
> > Is this check and the option really needed?  Except for the extra canonicalizer pass the newly added passes will be no-ops, so maybe we should just run them unconditionally.
> > 
> > It may be too much to ask for, but will it make sense not to bundle these passes into `MLIRToLLVM` pipeline and have the possibility to let driver emit post-HLFIR-lowering MLIR (under `-emit-fir`) and pre-HLFIR-lowering (under some new option)?
> Okay I'll run the HLFIR passes unconditionally.
> 
> I made -emit-fir output HLFIR to match what bbc already does, but I can see the usefulness of having both -emit-fir and -emit-hlfir. I won't do it in this patch but I will get around to this at some point (but feel free to jump in sooner if you need the flag for something).
`-emit-fir` and `-emit-hlfir` are separated in https://reviews.llvm.org/D151088


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146278



More information about the cfe-commits mailing list