[flang-commits] [mlir] [flang] [WIP] Delayed privatization. (PR #79862)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Mon Feb 5 04:00:23 PST 2024


kiranchandramohan wrote:

> @kiranchandramohan @clementval @luporl can you 🙏 have a look at the proposed plan above and let me know if you agree with it? Apologies for the noise but I just want to make sure we are aligned since this touches a lot of places in the pipeline already.
> 
> I am specially interested in your opinion about the "feature flag" thing to enable/disable delayed privatization both in `bbc`and `flang-new` at well (and having it disabled by default). Let me know if this is something you agree with or have other suggestions so that we can roll out support for delayed privatization in a practical and gradual manner.

Thanks @ergawy for pushing this forward. This will add more capabilities to the dialect and make lowering easier. Your approach of gradually rolling out the feature makes a lot of sense. We should also ensure that applications that are enabled now continues to work (spec-2017 speed, subset of specomp2012, subset of NPB, SNAP) and that there is no regression in the gfortran testsuite.

When introducing the changes to OpenMP dialect, could you add a reply to https://discourse.llvm.org/t/rfc-privatisation-in-openmp-dialect/3526 saying that we are adding support for privatisation clauses in the dialect. We see benefits for this in:
-> lowering from frontend to MLIR
-> better support for task and target constructs. Tasks have delayed execution, so the private/firstprivate variables have to be inserted in the task structure. <Add some info for target as well>
-> better lowering (to LLVM) for index variables of loops.  https://github.com/llvm/llvm-project/pull/75836
-> better support for lastprivate, where the runtime can support detection of the last iteration.

I think it is fine to add a single flag to the file that can enable `delayed privatization` if it is accessible as `flang-new -mmlir <flag-name>` like for e.g (-fdebug-dump-pre-fir) and directly with bbc.

https://github.com/llvm/llvm-project/pull/79862


More information about the flang-commits mailing list