introduce a new RoundUpAlignment helper function, use it to
[oota-llvm.git] / include / llvm / Target / TargetLowering.h
index 3dcf607f252740556f9d6619ba3824ab3e5f872c..073cb457d04f72174cf520ea7ae5bd66519f4a48 100644 (file)
@@ -701,12 +701,10 @@ public:
   /// that want to combine 
   struct TargetLoweringOpt {
     SelectionDAG &DAG;
-    bool AfterLegalize;
     SDValue Old;
     SDValue New;
 
-    explicit TargetLoweringOpt(SelectionDAG &InDAG, bool afterLegalize)
-      : DAG(InDAG), AfterLegalize(afterLegalize) {}
+    explicit TargetLoweringOpt(SelectionDAG &InDAG) : DAG(InDAG) {}
     
     bool CombineTo(SDValue O, SDValue N) { 
       Old = O; 
@@ -793,7 +791,7 @@ public:
   /// Return Value:
   ///   SDValue.Val == 0   - No change was made
   ///   SDValue.Val == N   - N was replaced, is dead, and is already handled.
-  ///   otherwise            - N should be replaced by the returned Operand.
+  ///   otherwise          - N should be replaced by the returned Operand.
   ///
   /// In addition, methods provided by DAGCombinerInfo may be used to perform
   /// more complex transformations.
@@ -1132,17 +1130,18 @@ public:
   /// implement this.  The default implementation of this aborts.
   virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG);
 
-  /// ReplaceNodeResults - This callback is invoked for operations that are
-  /// unsupported by the target, which are registered to use 'custom' lowering,
-  /// and whose result type is illegal.  This must return a node whose results
-  /// precisely match the results of the input node.  This typically involves a
-  /// MERGE_VALUES node and/or BUILD_PAIR.
+  /// ReplaceNodeResults - This callback is invoked when a node result type is
+  /// illegal for the target, and the operation was registered to use 'custom'
+  /// lowering for that result type.  The target places new result values for
+  /// the node in Results (their number and types must exactly match those of
+  /// the original return values of the node), or leaves Results empty, which
+  /// indicates that the node is not to be custom lowered after all.
   ///
   /// If the target has no operations that require custom lowering, it need not
   /// implement this.  The default implementation aborts.
-  virtual SDNode *ReplaceNodeResults(SDNode *N, SelectionDAG &DAG) {
+  virtual void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
+                                  SelectionDAG &DAG) {
     assert(0 && "ReplaceNodeResults not implemented for this target!");
-    return 0;
   }
 
   /// IsEligibleForTailCallOptimization - Check whether the call is eligible for
@@ -1172,7 +1171,7 @@ public:
   }
 
   /// GetPossiblePreceedingTailCall - Get preceeding TailCallNodeOpCode node if
-  /// it exists skip possible ISD:TokenFactor.
+  /// it exists. Skip a possible ISD:TokenFactor.
   static SDValue GetPossiblePreceedingTailCall(SDValue Chain,
                                                  unsigned TailCallNodeOpCode) {
     if (Chain.getOpcode() == TailCallNodeOpCode) {