[llvm-commits] [llvm] r89297 - in /llvm/trunk: include/llvm/Transforms/Utils/Local.h lib/Transforms/Utils/SimplifyCFG.cpp

Jim Grosbach grosbach at apple.com
Wed Nov 18 18:02:10 PST 2009


Author: grosbach
Date: Wed Nov 18 20:02:10 2009
New Revision: 89297

URL: http://llvm.org/viewvc/llvm-project?rev=89297&view=rev
Log:
Make EliminateDuplicatePHINodes() available as a utility function

Modified:
    llvm/trunk/include/llvm/Transforms/Utils/Local.h
    llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Modified: llvm/trunk/include/llvm/Transforms/Utils/Local.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Local.h?rev=89297&r1=89296&r2=89297&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/Local.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/Local.h Wed Nov 18 20:02:10 2009
@@ -107,7 +107,14 @@
 /// rewriting all the predecessors to branch to the successor block and return
 /// true.  If we can't transform, return false.
 bool TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB);
-    
+
+/// EliminateDuplicatePHINodes - Check for and eliminate duplicate PHI
+/// nodes in this block. This doesn't try to be clever about PHI nodes
+/// which differ only in the order of the incoming values, but instcombine
+/// orders them so it usually won't matter.
+///
+bool EliminateDuplicatePHINodes(BasicBlock *BB);
+
 /// SimplifyCFG - This function is used to do simplification of a CFG.  For
 /// example, it adjusts branches to branches to eliminate the extra hop, it
 /// eliminates unreachable basic blocks, and does other "peephole" optimization

Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=89297&r1=89296&r2=89297&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Wed Nov 18 20:02:10 2009
@@ -1594,7 +1594,7 @@
 /// which differ only in the order of the incoming values, but instcombine
 /// orders them so it usually won't matter.
 ///
-static bool EliminateDuplicatePHINodes(BasicBlock *BB) {
+bool llvm::EliminateDuplicatePHINodes(BasicBlock *BB) {
   bool Changed = false;
   
   // This implementation doesn't currently consider undef operands





More information about the llvm-commits mailing list