diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-01-27 11:27:37 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-01-27 11:27:37 +0000 |
commit | 2bb03ba6050ef482652cb49105d1f2a6b066e97f (patch) | |
tree | f6f3ab2cb2d2b95b9a8d70ec57f30ae787b0ef33 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | |
parent | 147c23278f784219f7bbfadf984552695074ef48 (diff) | |
download | bcm5719-llvm-2bb03ba6050ef482652cb49105d1f2a6b066e97f.tar.gz bcm5719-llvm-2bb03ba6050ef482652cb49105d1f2a6b066e97f.zip |
[vectorizer] Simplify code to use existing helpers on the Function
object and fewer pointless variables.
Also, add a clarifying comment and a FIXME because the code which
disables *all* vectorization if we can't use implicit floating point
instructions just makes no sense at all.
llvm-svn: 200214
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 5c9933a2c72..1ba0b77503e 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1055,14 +1055,14 @@ struct LoopVectorize : public FunctionPass { // Check the function attributes to find out if this function should be // optimized for size. Function *F = L->getHeader()->getParent(); - Attribute::AttrKind SzAttr = Attribute::OptimizeForSize; - Attribute::AttrKind FlAttr = Attribute::NoImplicitFloat; - unsigned FnIndex = AttributeSet::FunctionIndex; - bool OptForSize = Hints.Force != 1 && - F->getAttributes().hasAttribute(FnIndex, SzAttr); - bool NoFloat = F->getAttributes().hasAttribute(FnIndex, FlAttr); - - if (NoFloat) { + bool OptForSize = + Hints.Force != 1 && F->hasFnAttribute(Attribute::OptimizeForSize); + + // Check the function attributes to see if implicit floats are allowed.a + // FIXME: This check doesn't seem possibly correct -- what if the loop is + // an integer loop and the vector instructions selected are purely integer + // vector instructions? + if (F->hasFnAttribute(Attribute::NoImplicitFloat)) { DEBUG(dbgs() << "LV: Can't vectorize when the NoImplicitFloat" "attribute is used.\n"); return false; |