[llvm] 57d67be - [DAG] getNode() - reuse result type instead of calling getValueType again. NFC. (#159381)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 17 08:52:13 PDT 2025
Author: Simon Pilgrim
Date: 2025-09-17T15:52:09Z
New Revision: 57d67bec6d708b8266f09d06d7841739d4f53d5a
URL: https://github.com/llvm/llvm-project/commit/57d67bec6d708b8266f09d06d7841739d4f53d5a
DIFF: https://github.com/llvm/llvm-project/commit/57d67bec6d708b8266f09d06d7841739d4f53d5a.diff
LOG: [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.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 029eb025ff1de..5b2c09ffecbe2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -8247,8 +8247,8 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT,
// INSERT_VECTOR_ELT into out-of-bounds element is an UNDEF, except
// for scalable vectors where we will generate appropriate code to
// deal with out-of-bounds cases correctly.
- if (N3C && N1.getValueType().isFixedLengthVector() &&
- N3C->getZExtValue() >= N1.getValueType().getVectorNumElements())
+ if (N3C && VT.isFixedLengthVector() &&
+ N3C->getZExtValue() >= VT.getVectorNumElements())
return getUNDEF(VT);
// Undefined index can be assumed out-of-bounds, so that's UNDEF too.
More information about the llvm-commits
mailing list