forked from OSchip/llvm-project
Another situation where ROTR is cheaper than ROTL.
llvm-svn: 55577
This commit is contained in:
parent
4822a7ac8a
commit
11284ea499
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue