diff options
author | Haicheng Wu <haicheng@codeaurora.org> | 2016-02-17 21:00:06 +0000 |
---|---|---|
committer | Haicheng Wu <haicheng@codeaurora.org> | 2016-02-17 21:00:06 +0000 |
commit | 57e1a3e6eed86f689ef8f4bcdbdfda2bd7f52c4d (patch) | |
tree | f5d1b7fe7f22fb9ed3eb880922afb6dc1fec5737 /llvm/lib/Transforms | |
parent | 394f1d4159d217113ef6e58ae9fec555838d8fed (diff) | |
download | bcm5719-llvm-57e1a3e6eed86f689ef8f4bcdbdfda2bd7f52c4d.tar.gz bcm5719-llvm-57e1a3e6eed86f689ef8f4bcdbdfda2bd7f52c4d.zip |
[LIR] Avoid turning non-temporal stores into memset
This is to fix PR26645.
llvm-svn: 261149
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 900cdae41d4..85b185b39b5 100644 --- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -314,6 +314,10 @@ bool LoopIdiomRecognize::isLegalStore(StoreInst *SI, bool &ForMemset, if (!SI->isSimple()) return false; + // Avoid merging nontemporal stores. + if (SI->getMetadata(LLVMContext::MD_nontemporal)) + return false; + Value *StoredVal = SI->getValueOperand(); Value *StorePtr = SI->getPointerOperand(); |