[PATCH] D55928: [OpenMP] Add flag for preventing the extension to 64 bits for the collapse loop counter

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 20 06:54:03 PST 2018


ABataev added inline comments.


================
Comment at: docs/OpenMPSupport.rst:119
+time. To prevent this conservative choice and use at most 32 bits,
+compile your program with the `-fopenmp-max-32bit-collapse-width`.
+
----------------
-fopenmp-optimistic-collapse


================
Comment at: include/clang/Basic/LangOptions.def:210
 LANGOPT(OpenMPCUDABlocksPerSM  , 32, 0, "Number of blocks per SM for CUDA devices.")
+LANGOPT(OpenMPMax32BitCollapseWidth  , 1, 0, "Use at most 32 bits to represent the collapsed loop nest counter.")
 LANGOPT(RenderScript      , 1, 0, "RenderScript")
----------------
Fix the description and the option in accordance with the option name


================
Comment at: include/clang/Driver/Options.td:1577
   Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
+def fopenmp_max_32bit_collapse_width : Flag<["-"], "fopenmp-max-32bit-collapse-width">, Group<f_Group>,
+  Flags<[CC1Option, NoArgumentUnused, HelpHidden]>;
----------------
Missed -fno... option


================
Comment at: lib/Driver/ToolChains/Clang.cpp:4429
       Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_cuda_blocks_per_sm_EQ);
+      Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_max_32bit_collapse_width);
 
----------------
You need to change the processing taking into account -fno... option.


================
Comment at: lib/Frontend/CompilerInvocation.cpp:2848
+  // OpenMP collapse clause.
+  Opts.OpenMPMax32BitCollapseWidth =
+      Args.hasArg(options::OPT_fopenmp_max_32bit_collapse_width) ? 1 : 0;
----------------
Also, need to check for -fno... option


Repository:
  rC Clang

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

https://reviews.llvm.org/D55928





More information about the cfe-commits mailing list