summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-10-30 22:06:26 +0000
committerNadav Rotem <nrotem@apple.com>2012-10-30 22:06:26 +0000
commit47a299dcc9fcd84823ab64d9245133765a28e5fb (patch)
tree0dfd412e9ff3e3bd44172898466f0351f4c909e1 /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parent616e8a5c0b9e473ab1819a5657d6814f49a81bd4 (diff)
downloadbcm5719-llvm-47a299dcc9fcd84823ab64d9245133765a28e5fb.tar.gz
bcm5719-llvm-47a299dcc9fcd84823ab64d9245133765a28e5fb.zip
Add documentation.
llvm-svn: 167055
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 9e05cacbbe9..431a8478a03 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -749,16 +749,21 @@ SingleBlockLoopVectorizer::createEmptyLoop(LoopVectorizationLegality *Legal) {
}
+/// This function returns the identity element (or neutral element) for
+/// the operation K.
static unsigned
getReductionIdentity(LoopVectorizationLegality::ReductionKind K) {
switch (K) {
case LoopVectorizationLegality::IntegerXor:
case LoopVectorizationLegality::IntegerAdd:
case LoopVectorizationLegality::IntegerOr:
+ // Adding, Xoring, Oring zero to a number does not change it.
return 0;
case LoopVectorizationLegality::IntegerMult:
+ // Multiplying a number by 1 does not change it.
return 1;
case LoopVectorizationLegality::IntegerAnd:
+ // AND-ing a number with an all-1 value does not change it.
return -1;
default:
llvm_unreachable("Unknown reduction kind");
OpenPOWER on IntegriCloud