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

Duncan Sands baldrick at free.fr
Thu Oct 25 05:35:53 PDT 2007


Author: baldrick
Date: Thu Oct 25 07:35:51 2007
New Revision: 43341

URL: http://llvm.org/viewvc/llvm-project?rev=43341&view=rev
Log:
Small formatting changes.  Add a sanity check.
Use NVT rather than looking it up, since we have
it to hand.

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

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp Thu Oct 25 07:35:51 2007
@@ -454,7 +454,6 @@
   return DAG.getLoad(DestVT, Store, FIPtr, NULL, 0);
 }
 
-
 /// HandleMemIntrinsic - This handles memcpy/memset/memmove with invalid
 /// operands.  This promotes or expands the operands as required.
 SDOperand DAGTypeLegalizer::HandleMemIntrinsic(SDNode *N) {
@@ -664,7 +663,6 @@
   return DAG.getNode(NewOpc, NVT, Op);
 }
 
-
 SDOperand DAGTypeLegalizer::PromoteResult_SETCC(SDNode *N) {
   assert(isTypeLegal(TLI.getSetCCResultTy()) && "SetCC type is not legal??");
   return DAG.getNode(ISD::SETCC, TLI.getSetCCResultTy(), N->getOperand(0),
@@ -730,6 +728,7 @@
                      N->getOperand(1), LHS, RHS, N->getOperand(4));
 }
 
+
 //===----------------------------------------------------------------------===//
 //  Result Expansion
 //===----------------------------------------------------------------------===//
@@ -1061,7 +1060,6 @@
   Hi = DAG.getNode(ISD::BSWAP, Hi.getValueType(), Hi);
 }
 
-
 void DAGTypeLegalizer::ExpandResult_SELECT(SDNode *N,
                                            SDOperand &Lo, SDOperand &Hi) {
   SDOperand LL, LH, RL, RH;
@@ -1166,7 +1164,7 @@
     SDOperand LL, LH, RL, RH;
     GetExpandedOp(N->getOperand(0), LL, LH);
     GetExpandedOp(N->getOperand(1), RL, RH);
-    unsigned BitSize = MVT::getSizeInBits(RH.getValueType());
+    unsigned BitSize = MVT::getSizeInBits(NVT);
     unsigned LHSSB = DAG.ComputeNumSignBits(N->getOperand(0));
     unsigned RHSSB = DAG.ComputeNumSignBits(N->getOperand(1));
     
@@ -1364,6 +1362,8 @@
 ExpandShiftWithKnownAmountBit(SDNode *N, SDOperand &Lo, SDOperand &Hi) {
   MVT::ValueType NVT = TLI.getTypeToTransformTo(N->getValueType(0));
   unsigned NVTBits = MVT::getSizeInBits(NVT);
+  assert(!(NVTBits & (NVTBits - 1)) &&
+         "Expanded integer type size not a power of two!");
 
   uint64_t HighBitMask = NVTBits, KnownZero, KnownOne;
   DAG.ComputeMaskedBits(N->getOperand(1), HighBitMask, KnownZero, KnownOne);
@@ -1425,6 +1425,7 @@
   return true;
 }
 
+
 //===----------------------------------------------------------------------===//
 //  Operand Promotion
 //===----------------------------------------------------------------------===//
@@ -1530,7 +1531,6 @@
   return DAG.UpdateNodeOperands(SDOperand(N, 0), In);
 }
 
-
 SDOperand DAGTypeLegalizer::PromoteOperand_SELECT(SDNode *N, unsigned OpNo) {
   assert(OpNo == 0 && "Only know how to promote condition");
   SDOperand Cond = GetPromotedOp(N->getOperand(0));  // Promote the condition.
@@ -1548,7 +1548,6 @@
                                 N->getOperand(2));
 }
 
-
 SDOperand DAGTypeLegalizer::PromoteOperand_BRCOND(SDNode *N, unsigned OpNo) {
   assert(OpNo == 1 && "only know how to promote condition");
   SDOperand Cond = GetPromotedOp(N->getOperand(1));  // Promote the condition.
@@ -1633,7 +1632,6 @@
     return;
   }
 }
-  
 
 SDOperand DAGTypeLegalizer::PromoteOperand_STORE(StoreSDNode *N, unsigned OpNo){
   SDOperand Ch = N->getChain(), Ptr = N->getBasePtr();
@@ -1799,7 +1797,6 @@
   return DAG.getNode(ISD::FADD, DestTy, SignedConv, FudgeInReg);
 }
 
-
 SDOperand DAGTypeLegalizer::ExpandOperand_EXTRACT_ELEMENT(SDNode *N) {
   SDOperand Lo, Hi;
   GetExpandedOp(N->getOperand(0), Lo, Hi);
@@ -1936,7 +1933,6 @@
   NewRHS = SDOperand();
 }
 
-
 SDOperand DAGTypeLegalizer::ExpandOperand_STORE(StoreSDNode *N, unsigned OpNo) {
   assert(OpNo == 1 && "Can only expand the stored value so far");
   assert(!N->isTruncatingStore() && "Can't expand truncstore!");
@@ -2010,6 +2006,7 @@
   return DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
 }
 
+
 //===----------------------------------------------------------------------===//
 //  Entry Point
 //===----------------------------------------------------------------------===//
@@ -2022,4 +2019,3 @@
 void SelectionDAG::LegalizeTypes() {
   DAGTypeLegalizer(*this).run();
 }
-





More information about the llvm-commits mailing list