]> granicus.if.org Git - llvm/commitdiff
[DAGCombiner] Remove unnecessary check on the size of the type of the index of EXTRAC...
authorCraig Topper <craig.topper@gmail.com>
Sun, 29 Jan 2017 04:38:19 +0000 (04:38 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sun, 29 Jan 2017 04:38:19 +0000 (04:38 +0000)
The type system already requires that the number of vector elements must fit in 32-bits so an index should as well. Even if the type of the index were larger all we care about is that the constant index can fit in 64-bits so that we can call getZExtValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293413 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index dc6b0b11c0f0e6841c11351f02321a70321984cb..3ef801f52a4cadceb1dfad4fdba7ced781145850 100644 (file)
@@ -13916,9 +13916,7 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode* N) {
     ConstantSDNode *ExtIdx = dyn_cast<ConstantSDNode>(N->getOperand(1));
     ConstantSDNode *InsIdx = dyn_cast<ConstantSDNode>(V->getOperand(2));
 
-    if (InsIdx && ExtIdx &&
-        InsIdx->getValueType(0).getSizeInBits() <= 64 &&
-        ExtIdx->getValueType(0).getSizeInBits() <= 64) {
+    if (InsIdx && ExtIdx) {
       // Combine:
       //    (extract_subvec (insert_subvec V1, V2, InsIdx), ExtIdx)
       // Into: