[PATCH] D80370: [CodeGen] Make CreateStackTemporary choose better alignments

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 15:11:26 PDT 2020


efriedma added a comment.

I'm not sure we can really do this, at least not the way it's written.

The behavior of `CreateStackTemporary(TypeSize Bytes, Align Alignment)` is completely unambiguous; the caller has to decide the size and alignment, and generate other code consistent with that.  For the other overloads, the alignment is computed implicitly.  The callers then make some assumption about the alignment.  If we change the alignment computation, we also have to change the code that uses it.  I'm uncomfortable with assuming that a lower alignment is sufficient for all callers.

I recommend changing the six callers in type legalization (LegalizeVectorTypes.cpp, LegalizeTypesGeneric.cpp, LegalizeTypes.cpp, LegalizeIntegerTypes.cpp) to explicitly pass in the right size/alignment. That should be enough to solve the issue you care about without unpredictable side-effects on other code.


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

https://reviews.llvm.org/D80370





More information about the llvm-commits mailing list