mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Add some helper methods
llvm-svn: 26882
This commit is contained in:
parent
c0f029cf63
commit
a3663c3dbb
@ -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:
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
Loading…
Reference in New Issue
Block a user