diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-05-27 12:42:55 +0000 | 
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-05-27 12:42:55 +0000 | 
| commit | ed795153c7ebaf338ca06943480ef42b46fd138a (patch) | |
| tree | 9684b295372bec7f8429ad27a95e92dd17514170 /llvm/lib/CodeGen/SelectionDAG | |
| parent | 2892d82378c2a9d1fee61b8489ad0c4df442c31f (diff) | |
| download | bcm5719-llvm-ed795153c7ebaf338ca06943480ef42b46fd138a.tar.gz bcm5719-llvm-ed795153c7ebaf338ca06943480ef42b46fd138a.zip | |
Minor cleanups; add a better explanation for the issue with 
BUILD_VECTOR.
llvm-svn: 72469
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 33 | 
1 files changed, 10 insertions, 23 deletions
| diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 89d2cfc7d37..30dc8355c78 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -111,10 +111,6 @@ public:    void LegalizeDAG();  private: -  /// HandleOp - Legalize, Promote, or Expand the specified operand as -  /// appropriate for its type. -  void HandleOp(SDValue Op); -    /// LegalizeOp - We know that the specified value has a legal type.    /// Recursively ensure that the operands have legal types, then return the    /// result. @@ -129,9 +125,6 @@ private:    SDValue ExpandINSERT_VECTOR_ELT(SDValue Vec, SDValue Val,                                    SDValue Idx, DebugLoc dl); -  /// Useful 16 element vector type that is used to pass operands for widening. -  typedef SmallVector<SDValue, 16> SDValueVector; -    /// ShuffleWithNarrowerEltType - Return a vector shuffle operation which    /// performs the same shuffe in terms of order or result bytes, but on a type    /// whose vector element type is narrower than the original shuffle type. @@ -239,7 +232,7 @@ void SelectionDAGLegalize::LegalizeDAG() {    DAG.AssignTopologicalOrder();    for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),         E = prior(DAG.allnodes_end()); I != next(E); ++I) -    HandleOp(SDValue(I, 0)); +    LegalizeOp(SDValue(I, 0));    // Finally, it's possible the root changed.  Get the new root.    SDValue OldRoot = DAG.getRoot(); @@ -336,22 +329,10 @@ bool SelectionDAGLegalize::LegalizeAllNodesNotLeadingTo(SDNode *N, SDNode *Dest,    }    // Okay, this node looks safe, legalize it and return false. -  HandleOp(SDValue(N, 0)); +  LegalizeOp(SDValue(N, 0));    return false;  } -/// HandleOp - Legalize, Promote, Widen, or Expand the specified operand as -/// appropriate for its type. -void SelectionDAGLegalize::HandleOp(SDValue Op) { -  // Don't touch TargetConstants -  if (Op.getOpcode() == ISD::TargetConstant) -    return; -  MVT VT = Op.getValueType(); -  // We should never see any illegal result types here. -  assert(isTypeLegal(VT) && "Illegal type introduced after type legalization?"); -  (void)LegalizeOp(Op); -} -  /// ExpandConstantFP - Expands the ConstantFP node to an integer constant or  /// a load from the constant pool.  static SDValue ExpandConstantFP(ConstantFPSDNode *CFP, bool UseCP, @@ -800,8 +781,14 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {        Action = TargetLowering::Custom;      break;    case ISD::BUILD_VECTOR: -    // A weird case: when a BUILD_VECTOR is custom-lowered, it doesn't legalize -    // its operands first! +    // A weird case: legalization for BUILD_VECTOR never legalizes the +    // operands! +    // FIXME: This really sucks... changing it isn't semantically incorrect, +    // but it massively pessimizes the code for floating-point BUILD_VECTORs +    // because ConstantFP operands get legalized into constant pool loads +    // before the BUILD_VECTOR code can see them.  It doesn't usually bite, +    // though, because BUILD_VECTORS usually get lowered into other nodes +    // which get legalized properly.      SimpleFinishLegalizing = false;      break;    default: | 

