[PATCH] D75402: [HIP] Make sure, unused hip-pinned-shadow global var is kept within device code

Mahesha S via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 09:56:52 PST 2020


hsmhsm marked an inline comment as done.
hsmhsm added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1919
 
 void CodeGenModule::addUsedGlobal(llvm::GlobalValue *GV) {
   LLVMUsed.emplace_back(GV);
----------------
hliao wrote:
> hsmhsm wrote:
> > yaxunl wrote:
> > > hliao wrote:
> > > > This check should be removed completely instead it should be revised for the exceptions.
> > > How about add back this assertion but make an exception for global variables with hip_pinned_shadow attribute.
> > Yeah, that is what I was thinking of initially - to remove this assertion only to hip_pinned_shadow vars, may, be creating a clone of this function something like - CodeGenModule::addUsedGlobalForHipPinnedShadows(), without assertion statement.
> > 
> > @hliao
> > 
> > What do you say?
> how about change that function prototype to
> 
> void addUsedGlobal(llvm::GlobalValue *GV, bool SkipCheck = false)
> 
> and assert check to
> 
> assert ((SkipCheck || !GV->isDeclaration()) && "");
> 
This also looks fine to me, and I can make these changes and submit the changes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75402/new/

https://reviews.llvm.org/D75402





More information about the cfe-commits mailing list