The DeadStoreElimination pass now skips doing
PartialStoreMerging when stores overlap according to
OW_PartialEarlierWithFullLater and at least one of
the stores is having a store size that is different
from the size of the type being stored.
This solves problems seen in
https://bugs.llvm.org/show_bug.cgi?id=41949
for which we in the past could end up with
mis-compiles or assertions.
The content and location of the padding bits is not
formally described (or undefined) in the LangRef
at the moment. So the solution is chosen based on
that we cannot assume anything about the padding bits
when having a store that clobbers more memory than
indicated by the type of the value that is stored
(such as storing an i6 using an 8-bit store instruction).
The name you have is a little too short to be clear, I think; if you want something along those lines, maybe typeSizeEqualsStoreSize().
A couple other alternatives: hasNonStructPadding(), to indicate the underlying property of the memory. Or maybe follow EVT naming and call it isByteSized(), since this is essentially the same computation on a Type* instead of an EVT.
You could probably make this a little faster since getTypeStoreSizeInBits itself calls getTypeSizeInBits, but I guess it's unlikely to matter much.