summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2014-08-08 12:41:08 +0000
committerJames Molloy <james.molloy@arm.com>2014-08-08 12:41:08 +0000
commit65b08f5e4690e21c712564ba6c49d4cdb4fe3ca5 (patch)
tree54326ae5b567f1710feb2d88db47ef85e4997091 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parent3feea9c11a389a969f30473c9f70051246f5c935 (diff)
downloadbcm5719-llvm-65b08f5e4690e21c712564ba6c49d4cdb4fe3ca5.tar.gz
bcm5719-llvm-65b08f5e4690e21c712564ba6c49d4cdb4fe3ca5.zip
[LoopVectorizer] Enable support for floating-point subtraction reductions
llvm-svn: 215200
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 9f6cfeca2c0..1ab439f724a 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5136,7 +5136,7 @@ LoopVectorizationLegality::isReductionInstr(Instruction *I,
ReductionKind Kind,
ReductionInstDesc &Prev) {
bool FP = I->getType()->isFloatingPointTy();
- bool FastMath = (FP && I->isCommutative() && I->isAssociative());
+ bool FastMath = FP && I->hasUnsafeAlgebra();
switch (I->getOpcode()) {
default:
return ReductionInstDesc(false, I);
@@ -5158,6 +5158,7 @@ LoopVectorizationLegality::isReductionInstr(Instruction *I,
return ReductionInstDesc(Kind == RK_IntegerXor, I);
case Instruction::FMul:
return ReductionInstDesc(Kind == RK_FloatMult && FastMath, I);
+ case Instruction::FSub:
case Instruction::FAdd:
return ReductionInstDesc(Kind == RK_FloatAdd && FastMath, I);
case Instruction::FCmp:
OpenPOWER on IntegriCloud