[PATCH] D130233: [LoopLoadElim] Add stores with matching sizes as load-store candidates

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 28 01:06:45 PDT 2022


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp:216
+      // Only progagate the value if the pointees are the same size.
+      if (getLoadStoreType(Store)->getScalarSizeInBits() !=
+          getLoadStoreType(Load)->getScalarSizeInBits())
----------------
mgabka wrote:
> is it worth to make this work also for vector types? the patch you proposed does not work when there is casting between scalar and vector type of the same size for example i32 and <2 x i16>, would it be useful to extend it to cover such cases?
I don't think you can get such bitcasts, but also I think it's not even safe for big endian due to the different memory layout.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130233



More information about the llvm-commits mailing list