Skip to content

Commit 57d67be

Browse files
authored
[DAG] getNode() - reuse result type instead of calling getValueType again. NFC. (#159381)
We have assertions above confirming VT == N1.getValueType() for INSERT_VECTOR_ELT nodes.
1 parent 05c4681 commit 57d67be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8247,8 +8247,8 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
82478247
// INSERT_VECTOR_ELT into out-of-bounds element is an UNDEF, except
82488248
// for scalable vectors where we will generate appropriate code to
82498249
// deal with out-of-bounds cases correctly.
8250-
if (N3C && N1.getValueType().isFixedLengthVector() &&
8251-
N3C->getZExtValue() >= N1.getValueType().getVectorNumElements())
8250+
if (N3C && VT.isFixedLengthVector() &&
8251+
N3C->getZExtValue() >= VT.getVectorNumElements())
82528252
return getUNDEF(VT);
82538253

82548254
// Undefined index can be assumed out-of-bounds, so that's UNDEF too.

0 commit comments

Comments
 (0)