[PATCH] D23068: LoadStoreVectorizer: Remove TargetBaseAlign. Keep alignment for stack adjustments.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 09:57:35 PDT 2016


asbirlea created this revision.
asbirlea added reviewers: arsenm, jlebar.
asbirlea added a subscriber: llvm-commits.
Herald added a reviewer: tstellarAMD.
Herald added subscribers: mzolotukhin, arsenm, jholewinski.

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.

https://reviews.llvm.org/D23068

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23068.66494.patch
Type: text/x-patch
Size: 14544 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160802/3b517502/attachment.bin>


More information about the llvm-commits mailing list