summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-08-31 01:13:31 +0000
committerBill Wendling <isanbard@gmail.com>2008-08-31 01:13:31 +0000
commit11284ea499c5f2f1ef81b162503e5b4928d152f7 (patch)
tree344283da4284c4c6375dbc4d72fceac4ad1f765e /llvm/lib
parent4822a7ac8ada327008a4792db36fb645b003d02f (diff)
downloadbcm5719-llvm-11284ea499c5f2f1ef81b162503e5b4928d152f7.tar.gz
bcm5719-llvm-11284ea499c5f2f1ef81b162503e5b4928d152f7.zip
Another situation where ROTR is cheaper than ROTL.
llvm-svn: 55577
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2521609f5b6..e414fdfa7ab 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2044,10 +2044,10 @@ SDNode *DAGCombiner::MatchRotate(SDValue LHS, SDValue RHS) {
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();
}
}
}
OpenPOWER on IntegriCloud