[PATCH] D42759: [CGP] Split large data structres to sink more GEPs

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 04:09:51 PDT 2022


jonpa added inline comments.


================
Comment at: llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp:3816
+                 TLI.shouldConsiderGEPOffsetSplit() && Depth == 0 &&
+                 ConstantOffset > 0) {
+        // Record GEPs with non-zero offsets as candidates for splitting in the
----------------
efriedma wrote:
> jonpa wrote:
> > Is there any reason to not use '!=' as oppsed to '>' here (which would match the comment below)?
> > 
> > On SystemZ negative offsets are not supported on vector instructions.
> > 
> > 
> > 
> It could work. Would probably need a few other changes to make sure we don't do anything silly like grouping together positive and negative offsets.
I may be missing something, but as far as I can tell there should not be any problem just because the offset is negative. The type for offsets is already int64_t, and the algorithm of sorting them by offset and inserting a new GEP whenever needed seems to work regardless of a negative offset, since the most negative offset is generated first and then the remainder will be positive, or?



Repository:
  rL LLVM

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

https://reviews.llvm.org/D42759



More information about the llvm-commits mailing list