[PATCH] D146813: [LICM] Reassociate GEPs to allow hoisting

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 30 07:18:48 PDT 2023


nikic marked an inline comment as done.
nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2536
+      Builder.CreateGEP(GEP->getSourceElementType(), SrcPtr,
+                        SmallVector<Value *>(GEP->indices()), "", IsInBounds);
+  Builder.SetInsertPoint(GEP);
----------------
mkazantsev wrote:
> Can you please add a test where GEP and Src's indices have different dimensions? I'm a bit worried about type compatibility here.
There is a test for different source element types in `@different_elem_types` and I've added `@different_index_types` with different index types. Not sure whether these are what you had in mind...


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

https://reviews.llvm.org/D146813



More information about the llvm-commits mailing list