This patch changes the code generation of runtime flags to only occur if
a host bitcode file was passed in. This is a cheap way to determine if
we are compiling the OpenMP device runtime itself or user code. This is
needed because the global flags we generate for the device runtime e.g.
__omp_rtl_debug_kind were being generated with default values when we
compiled the runtime library. This would then invalidate the ones we
want to be able to add in when the user defines it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Do we have an alternative w/o need to add a flag dedicated for building a very specific target, OpenMP device runtime?
The only difference between building the OpenMP device runtime and user code is that we have -mlink-builtin-bitcode=bclib in the latter case. We could parse that but I felt like this is clearer.
Actually I believe we might be able to just check for bitcode library input as well, since that's already forwarded to codegen from an existing flag that we only pass for host compilations.
There's an existing flag for compile for device only, that's probably close enough to the right condition to not emit these flags.
The flags being generated should be covered by an existing test, I'll add a line where we don't specify a bitcode library.
We already check that before entering this code block, both the runtime and host code use that flag so we can't differentiate with it alone.