diff options
author | Chris Lattner <sabre@nondot.org> | 2006-03-20 00:55:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-03-20 00:55:52 +0000 |
commit | dc26e32ec7a10a7dea536b5953c75ff8e06b7f15 (patch) | |
tree | 066579f44450dca3527fcff932fa43e851d1ed7b | |
parent | 78fca695327446df6af50c97a8e775a666e64d3b (diff) |
Add some helper methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26882 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 2f950b01a2..5083e86046 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -195,6 +195,15 @@ public: 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 @@ protected: 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: //===--------------------------------------------------------------------===// |