[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h

Chris Lattner lattner at cs.uiuc.edu
Fri Apr 8 14:31:46 PDT 2005



Changes in directory llvm/include/llvm/CodeGen:

SelectionDAGNodes.h updated: 1.29 -> 1.30
---
Log message:

fix this method for 64-bit constants


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

 SelectionDAGNodes.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.29 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.30
--- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.29	Tue Apr  5 23:21:29 2005
+++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h	Fri Apr  8 16:31:29 2005
@@ -605,7 +605,9 @@
 
   bool isNullValue() const { return Value == 0; }
   bool isAllOnesValue() const {
-    return Value == (1ULL << MVT::getSizeInBits(getValueType(0)))-1;
+    int NumBits = MVT::getSizeInBits(getValueType(0));
+    if (NumBits == 64) return Value+1 == 0;
+    return Value == (1ULL << NumBits)-1;
   }
 
   static bool classof(const ConstantSDNode *) { return true; }






More information about the llvm-commits mailing list