diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-10 00:41:56 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-09-10 00:41:56 +0000 |
commit | d232222f347d6e8406522e540e76ab89d83e469d (patch) | |
tree | 0d61226fc7d3d12dbde847d3c79b0a9696305263 /llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | |
parent | f631f8c640dc54780a7105fc241af26606e99b41 (diff) | |
download | bcm5719-llvm-d232222f347d6e8406522e540e76ab89d83e469d.tar.gz bcm5719-llvm-d232222f347d6e8406522e540e76ab89d83e469d.zip |
Don't use getSetCCResultType for creating a vselect
The vselect mask isn't a setcc.
This breaks in the case when the result of getSetCCResultType
is larger than the vector operands
e.g. %tmp = select i1 %cmp <2 x i8> %a, <2 x i8> %b
when getSetCCResultType returns <2 x i32>, the assertion
that the (MaskTy.getSizeInBits() == Op1.getValueType().getSizeInBits())
is hit.
No test since I don't think I can hit this with any of the current
targets. The R600/SI implementation would break, since it returns a
vector of i1 for this, but it doesn't reach ExpandSELECT for other
reasons.
llvm-svn: 190376
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index 6e5fdca361e..fcb48b9b1be 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -599,8 +599,7 @@ SDValue VectorLegalizer::ExpandSELECT(SDValue Op) { return DAG.UnrollVectorOp(Op.getNode()); // Generate a mask operand. - EVT MaskTy = TLI.getSetCCResultType(*DAG.getContext(), VT); - assert(MaskTy.isVector() && "Invalid CC type"); + EVT MaskTy = VT.changeVectorElementTypeToInteger(); assert(MaskTy.getSizeInBits() == Op1.getValueType().getSizeInBits() && "Invalid mask size"); |