Skip to content

Commit 97988f6

Browse files
[SelectionDAG] Update canCreateUndefOrPoison to handle VECTOR_COMPRESS case
1 parent 182c415 commit 97988f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5702,6 +5702,11 @@ bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
57025702
return false;
57035703
}
57045704

5705+
case ISD::VECTOR_COMPRESS:
5706+
// Return true only if undef is checked and at least one element is
5707+
// demanded.
5708+
return !PoisonOnly && !DemandedElts.isZero();
5709+
57055710
default:
57065711
// Allow the target to implement this method for its nodes.
57075712
if (Opcode >= ISD::BUILTIN_OP_END || Opcode == ISD::INTRINSIC_WO_CHAIN ||

0 commit comments

Comments
 (0)