[llvm] r187961 - Optimize mask generation for one of the DAG combiner shufflevector cases.

Craig Topper craig.topper at gmail.com
Thu Aug 8 00:38:56 PDT 2013


Author: ctopper
Date: Thu Aug  8 02:38:55 2013
New Revision: 187961

URL: http://llvm.org/viewvc/llvm-project?rev=187961&view=rev
Log:
Optimize mask generation for one of the DAG combiner shufflevector cases.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=187961&r1=187960&r2=187961&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Thu Aug  8 02:38:55 2013
@@ -9358,10 +9358,10 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE
     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);
     }





More information about the llvm-commits mailing list