Patch to make some xforms preserve each other.  Patch contributed by
Domagoj Babic!

llvm-svn: 28181
diff --git a/llvm/lib/Transforms/Scalar/LowerSelect.cpp b/llvm/lib/Transforms/Scalar/LowerSelect.cpp
index 6a24c29..27dd430 100644
--- a/llvm/lib/Transforms/Scalar/LowerSelect.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerSelect.cpp
@@ -19,6 +19,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Transforms/Scalar.h"
+#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
 #include "llvm/Function.h"
 #include "llvm/Instructions.h"
 #include "llvm/Pass.h"
@@ -37,7 +38,11 @@
     LowerSelect(bool onlyfp = false) : OnlyFP(onlyfp) {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-      // Doesn't really preserve anything.  It can certainly destroy the CFG.
+      // This certainly destroys the CFG.
+      // This is a cluster of orthogonal Transforms:
+      AU.addPreserved<UnifyFunctionExitNodes>();
+      AU.addPreservedID(PromoteMemoryToRegisterID);
+      AU.addPreservedID(LowerSwitchID);
     }
 
     bool runOnFunction(Function &F);