The type system requires that the number of vector elements should fit in 32-bits so this should be safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293414
91177308-0d34-0410-b5e6-
96231b3b80d8
// If the input vector is a concatenation, and the insert replaces
// one of the halves, we can optimize into a single concat_vectors.
if (N0.getOpcode() == ISD::CONCAT_VECTORS && N0->getNumOperands() == 2 &&
- N2.getOpcode() == ISD::Constant) {
- APInt InsIdx = cast<ConstantSDNode>(N2)->getAPIntValue();
+ isa<ConstantSDNode>(N2)) {
+ unsigned InsIdx = cast<ConstantSDNode>(N2)->getZExtValue();
// Lower half: fold (insert_subvector (concat_vectors X, Y), Z) ->
// (concat_vectors Z, Y)