[PATCH] D34311: [InstCombine] Don't replace allocas with smaller globals

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 18:14:13 PDT 2017


efriedma added a comment.

LGTM.



================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:180
+    return false;
+  return isDereferenceableAndAlignedPointer(V, 1, APInt(64, AllocaSize), DL);
+}
----------------
vitalybuka wrote:
> efriedma wrote:
> > Doesn't the alignment here need to be the alignment of the alloca, rather than "1"?
> I'd expect it's not important as alignment of the source is not less than alloca.
If you don't check the alignment, you need to check that the memcpy dominates the reads from the alloca.


https://reviews.llvm.org/D34311





More information about the llvm-commits mailing list