[llvm] r279563 - [ValueTracking] Use a function_ref to avoid multiple instantiations

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 23 13:52:01 PDT 2016


Author: majnemer
Date: Tue Aug 23 15:52:00 2016
New Revision: 279563

URL: http://llvm.org/viewvc/llvm-project?rev=279563&view=rev
Log:
[ValueTracking] Use a function_ref to avoid multiple instantiations

No functional change intended, this should just be a code size
improvement.

Modified:
    llvm/trunk/lib/Analysis/ValueTracking.cpp

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=279563&r1=279562&r2=279563&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Tue Aug 23 15:52:00 2016
@@ -782,11 +782,11 @@ static void computeKnownBitsFromAssume(c
 // 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))) {




More information about the llvm-commits mailing list