summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Simpson <mssimpso@codeaurora.org>2016-01-06 12:50:29 +0000
committerMatthew Simpson <mssimpso@codeaurora.org>2016-01-06 12:50:29 +0000
commitbf894faa15a5802c914688112db62a112622d8d1 (patch)
treeff4dcb82f8d66e4412f00dc8d2c47b1e649ef257
parent6fd916cd0c26da0f1371eeda51868cea480870c2 (diff)
downloadbcm5719-llvm-bf894faa15a5802c914688112db62a112622d8d1.tar.gz
bcm5719-llvm-bf894faa15a5802c914688112db62a112622d8d1.zip
[LV] Avoid creating empty reduction entries (NFC)
This patch prevents us from unintentionally creating entries in the reductions map for PHIs that are not actually reductions. This is currently not an issue since we bail out if we encounter PHIs other than inductions or reductions. However the behavior could become problematic as we add support for additional recurrence types. llvm-svn: 256930
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index a627dd66517..2c0d317d16b 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -4294,12 +4294,12 @@ bool LoopVectorizationLegality::canVectorizeInstrs() {
continue;
}
- if (RecurrenceDescriptor::isReductionPHI(Phi, TheLoop,
- Reductions[Phi])) {
- if (Reductions[Phi].hasUnsafeAlgebra())
- Requirements->addUnsafeAlgebraInst(
- Reductions[Phi].getUnsafeAlgebraInst());
- AllowedExit.insert(Reductions[Phi].getLoopExitInstr());
+ RecurrenceDescriptor RedDes;
+ if (RecurrenceDescriptor::isReductionPHI(Phi, TheLoop, RedDes)) {
+ if (RedDes.hasUnsafeAlgebra())
+ Requirements->addUnsafeAlgebraInst(RedDes.getUnsafeAlgebraInst());
+ AllowedExit.insert(RedDes.getLoopExitInstr());
+ Reductions[Phi] = RedDes;
continue;
}
OpenPOWER on IntegriCloud