when merging two loads, make sure to take the min of their alignment,
not the max.  This didn't matter until the previous patch because
instcombine would refuse to sink loads with differenting alignments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85738 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 4c6c2bb..07681d1 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -10774,7 +10774,7 @@
     if ((LoadAlignment != 0) != (LI->getAlignment() != 0))
       return 0;
     
-    LoadAlignment = std::max(LoadAlignment, LI->getAlignment());
+    LoadAlignment = std::min(LoadAlignment, LI->getAlignment());
     
     // If the PHI is of volatile loads and the load block has multiple
     // successors, sinking it would remove a load of the volatile value from