[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

Reid Spencer reid at x10sys.com
Mon Mar 19 17:17:14 PDT 2007



Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.668 -> 1.669
---
Log message:

Make isOneBitSet faster by using APInt::isPowerOf2. Thanks Chris.


---
Diffs of the changes:  (+1 -1)

 InstructionCombining.cpp |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.668 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.669
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.668	Mon Mar 19 16:29:50 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Mon Mar 19 19:16:52 2007
@@ -3472,7 +3472,7 @@
 // isOneBitSet - Return true if there is exactly one bit set in the specified
 // constant.
 static bool isOneBitSet(const ConstantInt *CI) {
-  return CI->getValue().countPopulation() == 1;
+  return CI->getValue().isPowerOf2();
 }
 
 #if 0   // Currently unused






More information about the llvm-commits mailing list