From: Craig Topper Date: Thu, 8 Aug 2013 07:38:55 +0000 (+0000) Subject: Optimize mask generation for one of the DAG combiner shufflevector cases. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=01d22aaa78b831ad4837f928e0554be7e65addaa;p=oota-llvm.git Optimize mask generation for one of the DAG combiner shufflevector cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187961 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index cb8894105b1..0d71761fd0f 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9358,10 +9358,10 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) { for (unsigned i = 0; i != NumElts; ++i) { int Idx = SVN->getMaskElt(i); if (Idx >= 0) { - if (Idx < (int)NumElts) - Idx += NumElts; - else + if (Idx >= (int)NumElts) Idx -= NumElts; + else + Idx = -1; // remove reference to lhs } NewMask.push_back(Idx); }