[DAG] scalarizeExtractedVectorLoad - replace getABITypeAlign with allowsMemoryAccess...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 1 Oct 2021 20:07:26 +0000 (21:07 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 1 Oct 2021 20:07:34 +0000 (21:07 +0100)
commitdf672f66b669ca6f347858d26af1cae0aeddf8c2
tree883e3400cbafd75d0919424b1e322d81b9f14b2a
parentdff3454bda097723799935e8ea7f026ff0626940
[DAG] scalarizeExtractedVectorLoad - replace getABITypeAlign with allowsMemoryAccess (PR45116)

One of the cases identified in PR45116 - we don't need to limit extracted loads to ABI alignment, we can use allowsMemoryAccess - which tests using getABITypeAlign, but also checks if a target permits (fast) misaligned memory loads by checking allowsMisalignedMemoryAccesses as a fallback.

I've also cleaned up the alignment calculation code - if we have a constant extraction index then the alignment can be based on an offset from the original vector load alignment, but for non-constant indices we should assume the worst (single element alignment only).

Differential Revision: https://reviews.llvm.org/D110486
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/arm64-indexed-vector-ldst.ll
llvm/test/CodeGen/X86/merge-consecutive-stores-nt.ll