[PATCH] D106802: Adding flags for disabling the following optimizations: Deglobalization SPMDization State machine rewrites Folding
Joseph Huber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 26 10:51:33 PDT 2021
jhuber6 added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:68
+// TODO turn this into one flag not two
+static cl::opt<bool> DisableOpenMPOptDeglobalization2(
+ "openmp-opt-disable-deglobalization2", cl::ZeroOrMore,
----------------
Could this be one flag if you just remove static here and declare it extern in the other file?
```
extern cl::opt<bool> DisableOpenMPOptDeglobalization;
```
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:71
+ cl::desc("Disable OpenMP optimizations involving deglobalization 2 of 2."),
+ cl::Hidden, cl::init(false));
+
----------------
jdoerfert wrote:
> I recommend to not seed AAHeapToStack / AAHeapToShared in OpenMP-Opt if the flag is set.
> If you want to keep the current model use a external storage location that you can declare as extern in the other TU:
> ```
> static cl::opt<unsigned, true> MaxInitializationChainLengthX(
> ┊ "attributor-max-initialization-chain-length", cl::Hidden,
> ┊ cl::desc(
> ┊ ┊ ┊ "Maximal number of chained initializations (to avoid stack overflows)"),
> ┊ cl::location(MaxInitializationChainLength), cl::init(1024));
> unsigned llvm::MaxInitializationChainLength;
> ```
Might be a better option since AAHeapToStack isn't necessarily coupled to OpenMP.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106802/new/
https://reviews.llvm.org/D106802
More information about the llvm-commits
mailing list