[PATCH] D29214: [AMDGPU] Internalize non-kernel symbols

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 28 00:54:30 PST 2017


rampitec added inline comments.


================
Comment at: test/CodeGen/AMDGPU/internalize.ll:7-8
+
+ at gvar_unused = addrspace(1) global i32 undef, align 4
+ at gvar_used = addrspace(1) global i32 undef, align 4
+
----------------
tony-tye wrote:
> rampitec wrote:
> > rampitec wrote:
> > > tony-tye wrote:
> > > > kzhuravl wrote:
> > > > > tony-tye wrote:
> > > > > > rampitec wrote:
> > > > > > > arsenm wrote:
> > > > > > > > Should this check with various linkage types that should remain visible?
> > > > > > > As long as there is no late linking there are no linkages which should remain visible. Do you have an example?
> > > > > > The HSA Runtime can be used to query the address of global symbols so that the host program can access them. Will that still work after this phase?
> > > > > After this phase, if global symbol is unused, it would be removed. So it wouldn't be present in the object code. Hence hsa runtime won't know about it, and it would be inaccessible.
> > > > What about used global symbols, do they still have a linkage kind that the HSA Runtime will work with?
> > > That is right, but should it remain visible for RT if unused in kernels? Do we have a test for this?
> > It will remain untouched and accessible from RT as long as it is used from GPU side. If no kernels or functions they call access such variables they will be eliminated. Do we expect anything different?
> That sounds reasonable to me. Just wanted to make sure that the HSA Runtime will not be expecting the ELF symbols to have a specific linker kind which will end up being changed by this phase.
Linkage of used symbols is not changed.


Repository:
  rL LLVM

https://reviews.llvm.org/D29214





More information about the llvm-commits mailing list