[clang] [clang][OpenMP] Add OpenMP GPU optimization flag framework (PR #178914)

Dhruva Chakrabarti via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 3 23:21:09 PST 2026


================
@@ -239,6 +239,7 @@ LANGOPT(OpenMPThreadSubscription  , 1, 0, NotCompatible, "Assume work-shared loo
 LANGOPT(OpenMPTeamSubscription  , 1, 0, NotCompatible, "Assume distributed loops do not have more iterations than participating teams.")
 LANGOPT(OpenMPNoThreadState  , 1, 0, NotCompatible, "Assume that no thread in a parallel region will modify an ICV.")
 LANGOPT(OpenMPNoNestedParallelism  , 1, 0, NotCompatible, "Assume that no thread in a parallel region will encounter a parallel region")
+LANGOPT(OpenMPTargetIgnoreEnvVars, 1, 0, NotCompatible, "Assume that the OpenMP runtime can ignore environment variables during code generation for GPU offload")
----------------
dhruvachak wrote:

> Does this flag do anything? Should probably defer it if not.

I agree. I would suggest not adding it. Even in downstream AMD fork, the only use is in the No-Loop kernel generation. We already have the teams and threads oversubscription options which are used for this purpose, should really deprecate fopenmp-target-ignore-env-vars.

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


More information about the cfe-commits mailing list