[PATCH] D98040: [AMDGPU][GlobalISel] Improve constant offset lookup for llvm.amdgcn.s.buffer
    Matt Arsenault via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Mar  5 06:17:52 PST 2021
    
    
  
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp:51
+      if (mi_match(OffsetReg, MRI, m_ICst(Offset)) ||
+          mi_match(OffsetReg, MRI, m_Copy(m_ICst(Offset)))) {
+        // If Base was int converted to pointer, simply return int and offset.
----------------
This shouldn't add a second match pattern for a copy. That should be hidden away somehow. In this case I'd say the problem is regbankselect isn't picking the correct bank for the constant in the first place since we don't consider the users right now. We've been working around this on a case by case basis, but I think we should try to fix this.
Also arguably mi_match should look through copies, although in the presence of cross reg bank copies that's more questionable
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98040/new/
https://reviews.llvm.org/D98040
    
    
More information about the llvm-commits
mailing list