]> granicus.if.org Git - llvm/commit
[LV] Suppress vectorization in some nontemporal cases
authorWarren Ristow <warren.ristow@sony.com>
Mon, 17 Jun 2019 17:20:08 +0000 (17:20 +0000)
committerWarren Ristow <warren.ristow@sony.com>
Mon, 17 Jun 2019 17:20:08 +0000 (17:20 +0000)
commit31868b92dfcc70b18adad342857b3de7bbace164
treee3ae382eb0db437845172e0fc68d25872aaf00e3
parentbb2597ae2fdf411ddc394824416aa3323c14d17d
[LV] Suppress vectorization in some nontemporal cases

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363581 91177308-0d34-0410-b5e6-96231b3b80d8
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 [new file with mode: 0644]
test/Transforms/LoopVectorize/nontemporal.ll