[llvm-commits] [llvm] r47101 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Dan Gohman gohman at apple.com
Wed Feb 13 15:13:32 PST 2008


Author: djg
Date: Wed Feb 13 17:13:32 2008
New Revision: 47101

URL: http://llvm.org/viewvc/llvm-project?rev=47101&view=rev
Log:
Allow the APInt form of ComputeMaskedBits to operate on i128 types.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=47101&r1=47100&r2=47101&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Feb 13 17:13:32 2008
@@ -1134,14 +1134,13 @@
                                      APInt &KnownZero, APInt &KnownOne,
                                      unsigned Depth) const {
   unsigned BitWidth = Mask.getBitWidth();
+  assert(BitWidth == MVT::getSizeInBits(Op.getValueType()) &&
+         "Mask size mismatches value type size!");
+
   KnownZero = KnownOne = APInt(BitWidth, 0);   // Don't know anything.
   if (Depth == 6 || Mask == 0)
     return;  // Limit search depth.
   
-  // The masks are not wide enough to represent this type!  Should use APInt.
-  if (Op.getValueType() == MVT::i128)
-    return;
-  
   APInt KnownZero2, KnownOne2;
 
   switch (Op.getOpcode()) {
@@ -1477,6 +1476,10 @@
 void SelectionDAG::ComputeMaskedBits(SDOperand Op, uint64_t Mask, 
                                      uint64_t &KnownZero, uint64_t &KnownOne,
                                      unsigned Depth) const {
+  // The masks are not wide enough to represent this type!  Should use APInt.
+  if (Op.getValueType() == MVT::i128)
+    return;
+  
   unsigned NumBits = MVT::getSizeInBits(Op.getValueType());
   APInt APIntMask(NumBits, Mask);
   APInt APIntKnownZero(NumBits, 0);





More information about the llvm-commits mailing list