summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2009-11-19 02:03:18 +0000
committerJim Grosbach <grosbach@apple.com>2009-11-19 02:03:18 +0000
commitdcef55b2ef9d441a51f56347bc9c815e9cdb0cf7 (patch)
tree8f40cc7ca9b5cbe8f97a0636ee46b79a2803a5bd /llvm/lib/Transforms/Utils/LoopSimplify.cpp
parentcc69a1ba9a5ca119418c40aa6e44182469badba2 (diff)
downloadbcm5719-llvm-dcef55b2ef9d441a51f56347bc9c815e9cdb0cf7.tar.gz
bcm5719-llvm-dcef55b2ef9d441a51f56347bc9c815e9cdb0cf7.zip
Eliminate duplicate phi nodes in loops. Loop rotation, for example, can introduce these, and it's beneficial to later passes to clean them up.
llvm-svn: 89298
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopSimplify.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
index 2ab09721495..44a2c1f8518 100644
--- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
@@ -305,6 +305,12 @@ ReprocessLoop:
}
}
+ // If there are duplicate phi nodes (for example, from loop rotation),
+ // get rid of them.
+ for (Loop::block_iterator BB = L->block_begin(), E = L->block_end();
+ BB != E; ++BB)
+ EliminateDuplicatePHINodes(*BB);
+
return Changed;
}
OpenPOWER on IntegriCloud