mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
Infer element types for shuffle masks
llvm-svn: 27456
This commit is contained in:
parent
7f54d730f1
commit
9f8d5b538e
@ -672,6 +672,26 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP, bool NotRegisters) {
|
||||
// must have void types.
|
||||
if (NI.getNumResults() == 0)
|
||||
MadeChange |= UpdateNodeType(MVT::isVoid, TP);
|
||||
|
||||
// If this is a vector_shuffle operation, apply types to the build_vector
|
||||
// operation. The types of the integers don't matter, but this ensures they
|
||||
// won't get checked.
|
||||
if (getOperator()->getName() == "vector_shuffle" &&
|
||||
getChild(2)->getOperator()->getName() == "build_vector") {
|
||||
TreePatternNode *BV = getChild(2);
|
||||
const std::vector<MVT::ValueType> &LegalVTs
|
||||
= ISE.getTargetInfo().getLegalValueTypes();
|
||||
MVT::ValueType LegalIntVT = MVT::Other;
|
||||
for (unsigned i = 0, e = LegalVTs.size(); i != e; ++i)
|
||||
if (MVT::isInteger(LegalVTs[i]) && !MVT::isVector(LegalVTs[i])) {
|
||||
LegalIntVT = LegalVTs[i];
|
||||
break;
|
||||
}
|
||||
assert(LegalIntVT != MVT::Other && "No legal integer VT?");
|
||||
|
||||
for (unsigned i = 0, e = BV->getNumChildren(); i != e; ++i)
|
||||
MadeChange |= BV->getChild(i)->UpdateNodeType(LegalIntVT, TP);
|
||||
}
|
||||
return MadeChange;
|
||||
} else if (getOperator()->isSubClassOf("Instruction")) {
|
||||
const DAGInstruction &Inst = ISE.getInstruction(getOperator());
|
||||
|
Loading…
Reference in New Issue
Block a user