load/stores adjusted to align - prevent aggregate replacement/elimination

Hello,

This is a question reg. replacement of malloc'ed single element arrays
by scalars, which LLVM's opt appears to normally perform well. Now,
when there are arrays of vector types with elements of size 32 bytes
or more (eg <8 x float> *), it's common to adjust load/store's so that
they align on element type boundaries (since GNU malloc would
typically align only to 16 byte boundaries, say on x86-64). On such
IR, I notice that the scalar replacement / register promotion of a
malloc'ed vector element doesn't work any more.

https://godbolt.org/z/9KByAf
(Commenting out the alignment adjustment makes it work perfectly.)

Are there any attributes/hints that might be used in generating those
alignment arithmetic instructions to help the optimizer here?

Thanks,
~ Uday

Hello,

This is a question reg. replacement of malloc'ed single element arrays
by scalars, which LLVM's opt appears to normally perform well. Now,
when there are arrays of vector types with elements of size 32 bytes
or more (eg <8 x float> *), it's common to adjust load/store's so that
they align on element type boundaries (since GNU malloc would
typically align only to 16 byte boundaries, say on x86-64). On such
IR, I notice that the scalar replacement / register promotion of a
malloc'ed vector element doesn't work any more.

https://godbolt.org/z/9KByAf

Looks like the short URLs aren't working: I'm anyway appending the
snippet below.