[llvm-commits] CVS: llvm/include/llvm/Target/TargetLowering.h

Chris Lattner lattner at cs.uiuc.edu
Sun Mar 19 16:56:04 PST 2006



Changes in directory llvm/include/llvm/Target:

TargetLowering.h updated: 1.61 -> 1.62
---
Log message:

Add some helper methods


---
Diffs of the changes:  (+17 -0)

 TargetLowering.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+)


Index: llvm/include/llvm/Target/TargetLowering.h
diff -u llvm/include/llvm/Target/TargetLowering.h:1.61 llvm/include/llvm/Target/TargetLowering.h:1.62
--- llvm/include/llvm/Target/TargetLowering.h:1.61	Thu Mar 16 15:47:42 2006
+++ llvm/include/llvm/Target/TargetLowering.h	Sun Mar 19 18:55:52 2006
@@ -195,6 +195,15 @@
     return getOperationAction(Op, VT) == Legal ||
            getOperationAction(Op, VT) == Custom;
   }
+  
+  
+  /// isVectorShuffleLegal - Return true if a vector shuffle is legal with the
+  /// specified mask and type.  Targets can specify exactly which masks they
+  /// support and the code generator is tasked with not creating illegal masks.
+  bool isShuffleLegal(MVT::ValueType VT, SDOperand Mask) const {
+    return isOperationLegal(ISD::VECTOR_SHUFFLE, VT) && 
+           isShuffleMaskLegal(Mask);
+  }
 
   /// getTypeToPromoteTo - If the action for this operation is to promote, this
   /// method returns the ValueType to promote to.
@@ -476,6 +485,14 @@
     TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7);
   }
   
+  /// isShuffleMaskLegal - Targets can use this to indicate that they only
+  /// support *some* VECTOR_SHUFFLE operations, those with specific masks.
+  /// By default, if a target supports the VECTOR_SHUFFLE node, all mask values
+  /// are assumed to be legal.
+  virtual bool isShuffleMaskLegal(SDOperand Mask) const {
+    return true;
+  }
+  
 public:
 
   //===--------------------------------------------------------------------===//






More information about the llvm-commits mailing list