diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-01-02 23:54:43 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-01-02 23:54:43 +0000 |
commit | 00a6bcaeb4a74b930bc2b21f8021c3358d507ecf (patch) | |
tree | 18f62057be865d7f73ea42c0407ec54754071067 /lib | |
parent | 82de10a34c9432029040ced17129079a7d80904e (diff) |
Avoid vectorization when the function has the "noimplicitflot" attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Vectorize/LoopVectorize.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index f2004524b8..9b1d398ccc 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -94,9 +94,17 @@ struct LoopVectorize : public LoopPass { // Check the function attribues to find out if this function should be // optimized for size. Function *F = L->getHeader()->getParent(); - Attribute::AttrKind SzAttr= Attribute::OptimizeForSize; - bool OptForSize = - F->getAttributes().hasAttribute(AttributeSet::FunctionIndex, SzAttr); + Attribute::AttrKind SzAttr = Attribute::OptimizeForSize; + Attribute::AttrKind FlAttr = Attribute::NoImplicitFloat; + unsigned FnIndex = AttributeSet::FunctionIndex; + bool OptForSize = F->getAttributes().hasAttribute(FnIndex, SzAttr); + bool NoFloat = F->getAttributes().hasAttribute(FnIndex, FlAttr); + + if (NoFloat) { + DEBUG(dbgs() << "LV: Can't vectorize when the NoImplicitFloat" + "attribute is used.\n"); + return false; + } unsigned VF = CM.selectVectorizationFactor(OptForSize, VectorizationFactor); |