[llvm] [CGP] Reassociate GEPs to separate scalar and vector indexing (PR #146379)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 09:01:59 PDT 2025


================
@@ -6235,23 +6239,177 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
   return true;
 }
 
+Value *CodeGenPrepare::splitLastVectorIndex(Instruction *MemoryInst,
----------------
preames wrote:

This block is just the original code, pulled out into a helper.  I'd originally tried to merge both into a single implementation, but the complexity kept confusing me.  The split structure is much easier to reason about.  

https://github.com/llvm/llvm-project/pull/146379


More information about the llvm-commits mailing list