[PATCH] D23908: LSV: Always try to adjust the alloca alignment

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 09:58:19 PDT 2016


jlebar added a comment.

> The unaligned operation might be faster to some unaligned expansion, but that doesn't mean it's still not better still to have the aligned access


Indeed, but there's a cost to increasing the alignment too, right?  In particular, it prevents us from packing our stack as efficiently.

It's an assumption of this pass that vectorization is always beneficial.  So of course we want to increase the alignment when the access would otherwise be illegal.  And it also seems reasonable to increase the alignment when the TTI tells us the access would not be "fast".  But increasing the alignment on the mere suspicion that it would be faster, without any indication from the target that it would in fact be an improvement...I am less comfortable with that.

An alternative would be to add a new late-IR pass that increases the alignment of all allocas and, on your targets, run that after the LSV.  Then we'd be making a target-specific decision to enable the pass.


https://reviews.llvm.org/D23908





More information about the llvm-commits mailing list