Skip to content

Commit

Permalink
Use unary + instead of a separate local variable for working
Browse files Browse the repository at this point in the history
around std::min vs static const friction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110112 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Dan Gohman committed Aug 3, 2010
1 parent c677c5d commit 795e70e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Transforms/InstCombine/InstCombineCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ unsigned InstCombiner::GetOrEnforceKnownAlignment(Value *V,
TrailZ = std::min(TrailZ, unsigned(sizeof(unsigned) * CHAR_BIT - 1));

unsigned Align = 1u << std::min(BitWidth - 1, TrailZ);
unsigned MaxAlign = Value::MaximumAlignment;

// LLVM doesn't support alignments larger than this currently.
Align = std::min(Align, MaxAlign);
Align = std::min(Align, +Value::MaximumAlignment);

if (PrefAlign > Align)
Align = EnforceKnownAlignment(V, Align, PrefAlign);
Expand Down

0 comments on commit 795e70e

Please sign in to comment.