[VectorCombine] Fix alignment in single element store
authorQiu Chaofan <qiucofan@cn.ibm.com>
Fri, 11 Jun 2021 02:28:15 +0000 (10:28 +0800)
committerQiu Chaofan <qiucofan@cn.ibm.com>
Fri, 11 Jun 2021 02:28:15 +0000 (10:28 +0800)
commit2670c7dd5b25e87825edc0aca7729c1d3dba5afc
tree38eabbc442031a165bb775f81f539533837692c2
parent420bd5ee8ec996a2c2e305541e59465a5ba436e3
[VectorCombine] Fix alignment in single element store

This fixes the concern in single element store scalarization that the
alignment of new store may be larger than it should be. It calculates
the largest alignment if index is constant, and a safe one if not.

Reviewed By: lebedev.ri, spatel

Differential Revision: https://reviews.llvm.org/D103419
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
llvm/test/Transforms/VectorCombine/load-insert-store.ll