[CodeGen] Fix the computation of the alignment of split stores.
authorClement Courbet <courbet@google.com>
Mon, 10 Feb 2020 10:27:53 +0000 (11:27 +0100)
committerClement Courbet <courbet@google.com>
Wed, 12 Feb 2020 09:37:30 +0000 (10:37 +0100)
commit15488ff24b4ae205f979be7248b38655acd82f9c
tree9d6bcf8b55ec3ff00744591f8dba0ee016febbed
parent3bd33ccfdf2f5183062e775e99725930bb4e5403
[CodeGen] Fix the computation of the alignment of split stores.

Summary:
Right now the alignment of the lower half of a store is computed as
align/2, which fails for unaligned stores (align = 1), and is overly
pessimitic for, e.g. a 8 byte store aligned to 4 bytes.
Fixes PR44851
Fixes PR44877

Reviewers: gchatelet, spatel, lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74311
llvm/lib/CodeGen/CodeGenPrepare.cpp
llvm/test/Transforms/CodeGenPrepare/PowerPC/split-store-alignment.ll
llvm/test/Transforms/CodeGenPrepare/X86/split-store-alignment.ll