[PATCH] D127392: [AggressiveInstCombine] Combine consecutive loads which are being merged to form a wider load.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 06:11:11 PDT 2022


spatel added inline comments.


================
Comment at: llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp:691-692
       MadeChange |= foldSqrt(I, TTI, TLI);
+      MadeChange |=
+          foldConsecutiveLoads(I, F.getParent()->getDataLayout(), TTI, AA);
     }
----------------
The transform should be placed ahead of foldSqrt(), or we we may hit a use-after-free bug (because foldSqrt can delete `I`).
There was a code comment about this in:
https://github.com/llvm/llvm-project/commit/df868edee561eb973edd85ec9df41c67aa0bff6b
...but that patch got reverted. We should probably add that code comment independently (or fix the bug some other way).


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

https://reviews.llvm.org/D127392



More information about the llvm-commits mailing list