Currently, we ignore all locality attributes/info when building for
the device and thus all symblos are externally visible and can be
preemted at the runtime. It may lead to incorrect results. We need to
follow the same logic, compiler uses for static/pie builds. But in some
cases changing of dso locality may lead to problems with codegen, so
instead mark external symbols as hidden instead in the device code.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 41317 Build 41518: arc lint + arc unit
Event Timeline
Comment Actions
@ABataev @jhuber6 and I would like to change this to annotate variables with whatever visibility the user asked for.
Can you recall if the concern about premption here was for the deviceRTL, in which case it can be comprehensively dealt with by internalizing the deviceRTL symbols, or for user defined things in which case we want whatever the linker flag -Bsymbolic maps onto as an IR construct. (<- said construct is dso_local)
Comment Actions
Hi, check the original PR, it has all required details. Maybe add a check that if the device is same as the host, then add hidden visibility (to avoid problems with the standard libs etc.), otherwise keep it as is?