llvm.org GIT mirror llvm / e7b6244
[X86] Relax an assertion when legalizing vector types. WidenVSELECTAndMask can fold (and it folds in this case) so we get a BUILD_VECTOR of constants as mask. convertMask() seems to work fine when the input is a vector of constants, and we still need to call it to extend/add elements at the end. but the current code just asserts on anything but a SETCC or AND/OR/XOR of 2xSETCC. This change was discussed briefly with Simon Pilgrim, who also suggests we might consider dropping this assertion in the future. Fixes PR33715. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307508 91177308-0d34-0410-b5e6-96231b3b80d8 Davide Italiano 3 years ago
2 changed file(s) with 20 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
29762976
29772977 // Currently a SETCC or a AND/OR/XOR with two SETCCs are handled.
29782978 unsigned InMaskOpc = InMask->getOpcode();
2979
2980 // FIXME: This code seems to be too restrictive, we might consider
2981 // generalizing it or dropping it.
29792982 assert((InMaskOpc == ISD::SETCC ||
2983 ISD::isBuildVectorOfConstantSDNodes(InMask.getNode()) ||
29802984 (isLogicalMaskOp(InMaskOpc) &&
29812985 isSETCCorConvertedSETCC(InMask->getOperand(0)) &&
29822986 isSETCCorConvertedSETCC(InMask->getOperand(1)))) &&
0 ; Make sure we don't crash with a build vector of integer constants.
1 ; RUN: llc %s -o /dev/null
2
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
5
6 define i32 @patatino() {
7 %tmp = insertelement <4 x i32> , i32 1, i32 2
8 %tmp1 = insertelement <4 x i32> %tmp, i32 1, i32 3
9 %tmp2 = icmp ne <4 x i32> %tmp1, zeroinitializer
10 %tmp3 = icmp slt <4 x i32> %tmp1,
11 %tmp4 = or <4 x i1> %tmp2, %tmp3
12 %tmp5 = select <4 x i1> %tmp4, <4 x i32> zeroinitializer, <4 x i32>
13 %tmp6 = extractelement <4 x i32> %tmp5, i32 0
14 ret i32 %tmp6
15 }