Skip to content

Commit

Permalink
[ValueTracking] Use a function_ref to avoid multiple instantiations
Browse files Browse the repository at this point in the history
No functional change intended, this should just be a code size
improvement.

llvm-svn: 279563
  • Loading branch information
majnemer committed Aug 23, 2016
1 parent df2ab91 commit 54690dc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions llvm/lib/Analysis/ValueTracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,11 @@ static void computeKnownBitsFromAssume(const Value *V, APInt &KnownZero,
// shift amount, compute the implied known-zero or known-one bits of the shift
// operator's result respectively for that shift amount. The results from calling
// KZF and KOF are conservatively combined for all permitted shift amounts.
template <typename KZFunctor, typename KOFunctor>
static void computeKnownBitsFromShiftOperator(const Operator *I,
APInt &KnownZero, APInt &KnownOne,
APInt &KnownZero2, APInt &KnownOne2,
unsigned Depth, const Query &Q, KZFunctor KZF, KOFunctor KOF) {
static void computeKnownBitsFromShiftOperator(
const Operator *I, APInt &KnownZero, APInt &KnownOne, APInt &KnownZero2,
APInt &KnownOne2, unsigned Depth, const Query &Q,
function_ref<APInt(const APInt &, unsigned)> KZF,
function_ref<APInt(const APInt &, unsigned)> KOF) {
unsigned BitWidth = KnownZero.getBitWidth();

if (auto *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
Expand Down

0 comments on commit 54690dc

Please sign in to comment.