diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-01 20:07:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-01 20:07:07 +0000 |
commit | a664bb7bdcc074cb03a2fa6ed1c52a2ca9453550 (patch) | |
tree | 4326efaab57032efbbc2fe022c1e7407c1a816e5 /lib/Transforms | |
parent | 751a362c22ed5e08aafbc8f243f7aac3203189f8 (diff) |
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 4c6c2bb2ac..07681d15d8 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -10774,7 +10774,7 @@ Instruction *InstCombiner::FoldPHIArgLoadIntoPHI(PHINode &PN) { 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 |