Skip to content

Commit 33a7bb1

Browse files
authored
DAG: Use poison when legalizing scalar_to_vector results (#167751)
1 parent 67f61df commit 33a7bb1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/include/llvm/CodeGen/ISDOpcodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,8 @@ enum NodeType {
655655

656656
/// SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a
657657
/// scalar value into element 0 of the resultant vector type. The top
658-
/// elements 1 to N-1 of the N-element vector are undefined. The type
659-
/// of the operand must match the vector element type, except when they
658+
/// elements 1 to N-1 of the N-element vector are poison. The type of
659+
/// the operand must match the vector element type, except when they
660660
/// are integer types. In this case the operand is allowed to be wider
661661
/// than the vector element type, and is implicitly truncated to it.
662662
SCALAR_TO_VECTOR,

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,7 @@ void DAGTypeLegalizer::SplitVecRes_ScalarOp(SDNode *N, SDValue &Lo,
21862186
std::tie(LoVT, HiVT) = DAG.GetSplitDestVTs(N->getValueType(0));
21872187
Lo = DAG.getNode(N->getOpcode(), dl, LoVT, N->getOperand(0));
21882188
if (N->getOpcode() == ISD::SCALAR_TO_VECTOR) {
2189-
Hi = DAG.getUNDEF(HiVT);
2189+
Hi = DAG.getPOISON(HiVT);
21902190
} else {
21912191
assert(N->getOpcode() == ISD::SPLAT_VECTOR && "Unexpected opcode");
21922192
Hi = Lo;

0 commit comments

Comments
 (0)