summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-10 00:41:56 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2013-09-10 00:41:56 +0000
commitc6c08508cab2fc4f52e9ab44dce272e240661e06 (patch)
tree466b27319ce6856c7b4d883ce06fb5f1813c7097 /lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
parentffdee89a3c3b283ac02e6d0522e8e8d461bd3ff1 (diff)
downloadllvm-c6c08508cab2fc4f52e9ab44dce272e240661e06.tar.gz
llvm-c6c08508cab2fc4f52e9ab44dce272e240661e06.tar.bz2
llvm-c6c08508cab2fc4f52e9ab44dce272e240661e06.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190376 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
index 6e5fdca361..fcb48b9b1b 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ b/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");