[llvm-commits] [llvm] r55577 - /llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Bill Wendling isanbard at gmail.com
Sat Aug 30 18:13:32 PDT 2008


Author: void
Date: Sat Aug 30 20:13:31 2008
New Revision: 55577

URL: http://llvm.org/viewvc/llvm-project?rev=55577&view=rev
Log:
Another situation where ROTR is cheaper than ROTL.

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=55577&r1=55576&r2=55577&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Aug 30 20:13:31 2008
@@ -2044,10 +2044,10 @@
     if (ConstantSDNode *SUBC = 
           dyn_cast<ConstantSDNode>(LHSShiftAmt.getOperand(0))) {
       if (SUBC->getAPIntValue() == OpSizeInBits) {
-        if (HasROTL)
-          return DAG.getNode(ISD::ROTL, VT, LHSShiftArg, LHSShiftAmt).getNode();
-        else
+        if (HasROTR)
           return DAG.getNode(ISD::ROTR, VT, LHSShiftArg, RHSShiftAmt).getNode();
+        else
+          return DAG.getNode(ISD::ROTL, VT, LHSShiftArg, LHSShiftAmt).getNode();
       }
     }
   }





More information about the llvm-commits mailing list