[PATCH] D75266: SROA: Don't drop atomic load/store alignments (PR45010)

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 09:19:57 PST 2020


hans added a comment.

In D75266#1895826 <https://reviews.llvm.org/D75266#1895826>, @efriedma wrote:

> I would prefer to just avoid creating unaligned allocas in the first place.  https://github.com/llvm/llvm-project/blob/740ed617f7d4d16e7883636c5eff994f8be7eba4/llvm/lib/Transforms/Scalar/SROA.cpp#L4163 has some code which intentionally uses an unspecified alignment... but really, there's no reason to do that.  allocas with no specified alignment are implicitly aligned using the ABI type alignment.  So it's semantically equivalent to `std::max(Alignment, DL.getABITypeAlignment(SliceTy)`, just more annoying to deal with.


The current behaviour is from https://github.com/llvm/llvm-project/commit/903790eff54f473fca8fbf6915713751a070b5df

Changing that seems like a riskier change (I want this for 10.x) whereas copying over the alignment from the store/load seems straight-forward to me.


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

https://reviews.llvm.org/D75266





More information about the llvm-commits mailing list