LoadStoreVectorizer: Remove TargetBaseAlign. Keep alignment for stack adjustments.
authorAlina Sbirlea <asbirlea@google.com>
Thu, 4 Aug 2016 16:38:44 +0000 (16:38 +0000)
committerAlina Sbirlea <asbirlea@google.com>
Thu, 4 Aug 2016 16:38:44 +0000 (16:38 +0000)
commit6f937b1144aeaf93ee57bdfaeb13d6cbbde5850d
tree0783be537dc51123711822441ed6769bbcd5c7c9
parent98d78405b0cc2a71f703c5f8fa6a694f6136056e
LoadStoreVectorizer: Remove TargetBaseAlign. Keep alignment for stack adjustments.

Summary:
TargetBaseAlign is no longer required since LSV checks if target allows misaligned accesses.
A constant defining a base alignment is still needed for stack accesses where alignment can be adjusted.

Previous patch (D22936) was reverted because tests were failing. This patch also fixes the cause of those failures:
- x86 failing tests either did not have the right target, or the right alignment.
- NVPTX failing tests did not have the right alignment.
- AMDGPU failing test (merge-stores) should allow vectorization with the given alignment but the target info
  considers <3xi32> a non-standard type and gives up early. This patch removes the condition and only checks
  for a maximum size allowed and relies on the next condition checking for %4 for correctness.
  This should be revisited to include 3xi32 as a MVT type (on arsenm's non-immediate todo list).

Note that checking the sizeInBits for a MVT is undefined (leads to an assertion failure),
so we need to create an EVT, hence the interface change in allowsMisaligned to include the Context.

Reviewers: arsenm, jlebar, tstellarAMD

Subscribers: jholewinski, arsenm, mzolotukhin, llvm-commits

Differential Revision: https://reviews.llvm.org/D23068

llvm-svn: 277735
12 files changed:
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/include/llvm/CodeGen/BasicTTIImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
llvm/test/Transforms/LoadStoreVectorizer/NVPTX/merge-across-side-effects.ll
llvm/test/Transforms/LoadStoreVectorizer/NVPTX/non-instr-bitcast.ll
llvm/test/Transforms/LoadStoreVectorizer/X86/correct-order.ll
llvm/test/Transforms/LoadStoreVectorizer/X86/preserve-order32.ll
llvm/test/Transforms/LoadStoreVectorizer/X86/preserve-order64.ll
llvm/test/Transforms/LoadStoreVectorizer/X86/subchain-interleaved.ll