From a4249525ab08310a11b16d7255936c030dc43d6f Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 29 Jan 2017 04:38:21 +0000 Subject: [PATCH] [DAGCombiner] Use unsigned for a constant vector index instead of APInt. 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 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 3ef801f52a4..33863ca16f9 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -14543,8 +14543,8 @@ SDValue DAGCombiner::visitINSERT_SUBVECTOR(SDNode *N) { // 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(N2)->getAPIntValue(); + isa(N2)) { + unsigned InsIdx = cast(N2)->getZExtValue(); // Lower half: fold (insert_subvector (concat_vectors X, Y), Z) -> // (concat_vectors Z, Y) -- 2.50.1