[PATCH] D103225: [AMDGPU] Replace non-kernel function uses of LDS globals by pointers.
    Mahesha S via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Jun  1 22:09:32 PDT 2021
    
    
  
hsmhsm marked 3 inline comments as done.
hsmhsm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp:200
+    IRBuilder<> Builder(EI);
+    Builder.CreateStore(Builder.CreatePtrToInt(GV, Type::getInt16Ty(Ctx)),
+                        LDSPointer);
----------------
arsenm wrote:
> The compiler should never introduce ptrtoint. This should offset from a base address with getelementptr
Actually I am wondering - how to do it. "inttoptr" can be replaced with getelementptr. On the other-hand, how to achieve it for "ptrtoint"?
getelementptr gives pointer value, not integer value, what I want here is - an integer value (pointer converted to integer). So, how to get integer value from getelementptr?
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103225/new/
https://reviews.llvm.org/D103225
    
    
More information about the llvm-commits
mailing list