[llvm] [SeparateConstOffsetFromGEP] Support GEP reordering for different types (PR #90802)

Jeffrey Byrnes via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 09:20:57 PDT 2024


================
@@ -1017,6 +1016,51 @@ bool SeparateConstOffsetFromGEP::reorderGEP(GetElementPtrInst *GEP,
       IsChainInBounds &= KnownPtrGEPIdx.isNonNegative();
     }
   }
+  TypeSize GEPSize = DL->getTypeSizeInBits(GEP->getSourceElementType());
+  TypeSize PtrGEPSize = DL->getTypeSizeInBits(PtrGEP->getSourceElementType());
----------------
jrbyrnes wrote:

I was trying to preserve the pointee type for users of the outer GEP, but I don't have a compelling argument as to why we would want to do this.

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


More information about the llvm-commits mailing list