[PATCH] D61764: [LV] Suppress vectorization in some nontemporal cases

Warren Ristow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 15:22:20 PDT 2019


wristow created this revision.
wristow added a reviewer: mkuper.
Herald added a subscriber: rkruppe.

When considering a loop containing nontemporal stores or loads for
vectorization, suppress the vectorization if the corresponding
vectorized store or load with the aligment of the original scaler
memory op is not supported with the nontemporal hint on the target.

This adds two new functions:
`  bool isLegalNTStore(Type *DataType, unsigned Alignment) const;`
`  bool isLegalNTLoad(Type *DataType, unsigned Alignment) const;`

to TTI, leaving the target independent default implementation as
returning true, but with overriding implementations for X86 that
check the legality based on available Subtarget features.

This fixes https://llvm.org/PR40759


https://reviews.llvm.org/D61764

Files:
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  include/llvm/Transforms/Vectorize/LoopVectorizationLegality.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.cpp
  lib/Target/X86/X86TargetTransformInfo.h
  lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/X86/nontemporal.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61764.198918.patch
Type: text/x-patch
Size: 15484 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190509/eb6aaa66/attachment.bin>


More information about the llvm-commits mailing list