[PATCH] D39946: Relax unaligned access assertion when type is byte aligned

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 11:56:40 PST 2017


nemanjai added a comment.

A couple of general comments...
I'm not a fan of modifying the ABI of DataLayout for this. Seems that we can just compare the ABI alignment against 1 at the call site. But I also wonder if it would suffice to simply check that the load instruction's alignment is less than the ABI alignment for that type
`if (I.getAlignment() < DL.getABITypeAlignment(Ty))`

However, that makes the additional assumption that targets can handle atomic loads with an alignment that is the same as the ABI alignment for that type. I believe this is a safe assumption, but perhaps that should be checked with the target maintainers. In either case, I think a quick check with the target maintainers would be good.


https://reviews.llvm.org/D39946





More information about the llvm-commits mailing list