[PATCH] D37887: AMDGPU: Run internalize symbols at -O0
Stanislav Mekhanoshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 18 15:01:14 PDT 2017
rampitec added inline comments.
================
Comment at: lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:326
+ if (F->isDeclaration() || AMDGPU::isEntryFunctionCC(F->getCallingConv()))
+ return true;
+ }
----------------
arsenm wrote:
> rampitec wrote:
> > arsenm wrote:
> > > rampitec wrote:
> > > > arsenm wrote:
> > > > > rampitec wrote:
> > > > > > Looks like it changes original logic. All functions were internalized except for declarations and kernels.
> > > > > It's the same, also no tests fail
> > > > If a function is called and not declaration it used to be internalized, with this change it will not.
> > > Yes it is. This is the reason for doing this and is the func_used test I added
> > Then what happens if function is finally inlined and no calls left? I suppose it will remain in the object, which is not we really want.
> There is no change here in behavior from what was here before other than also internalizing at -O0. Regardless of whether the function is used or not it is internalized
There is change in behavior with the optimizations. You have removed this line to indicate this change:
CHECK-NOT: foo_used
With optimizations foo_used shall not be in the output.
================
Comment at: test/CodeGen/AMDGPU/internalize.ll:26
-; Function Attrs: alwaysinline nounwind
+; CHECK: define amdgpu_kernel void @foo_used(
define amdgpu_kernel void @foo_used(i32 addrspace(1)* %out, i32 %tid) local_unnamed_addr #1 {
----------------
I have check prefixes ALL, OPT and OPTNONE. The check prefix CHECK does not exist.
https://reviews.llvm.org/D37887
More information about the llvm-commits
mailing list