mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-05 02:07:56 +00:00
Replace a couple if/elses around similar calls with conditional operators on the varying arguments. No functional change.
llvm-svn: 164886
This commit is contained in:
parent
37dcc09044
commit
36c4380c5c
@ -3221,11 +3221,8 @@ SDNode *DAGCombiner::MatchRotate(SDValue LHS, SDValue RHS, DebugLoc DL) {
|
||||
if ((LShVal + RShVal) != OpSizeInBits)
|
||||
return 0;
|
||||
|
||||
SDValue Rot;
|
||||
if (HasROTL)
|
||||
Rot = DAG.getNode(ISD::ROTL, DL, VT, LHSShiftArg, LHSShiftAmt);
|
||||
else
|
||||
Rot = DAG.getNode(ISD::ROTR, DL, VT, LHSShiftArg, RHSShiftAmt);
|
||||
SDValue Rot = DAG.getNode(HasROTL ? ISD::ROTL : ISD::ROTR, DL, VT,
|
||||
LHSShiftArg, HasROTL ? LHSShiftAmt : RHSShiftAmt);
|
||||
|
||||
// If there is an AND of either shifted operand, apply it to the result.
|
||||
if (LHSMask.getNode() || RHSMask.getNode()) {
|
||||
@ -3258,12 +3255,8 @@ SDNode *DAGCombiner::MatchRotate(SDValue LHS, SDValue RHS, DebugLoc DL) {
|
||||
if (ConstantSDNode *SUBC =
|
||||
dyn_cast<ConstantSDNode>(RHSShiftAmt.getOperand(0))) {
|
||||
if (SUBC->getAPIntValue() == OpSizeInBits) {
|
||||
if (HasROTL)
|
||||
return DAG.getNode(ISD::ROTL, DL, VT,
|
||||
LHSShiftArg, LHSShiftAmt).getNode();
|
||||
else
|
||||
return DAG.getNode(ISD::ROTR, DL, VT,
|
||||
LHSShiftArg, RHSShiftAmt).getNode();
|
||||
return DAG.getNode(HasROTL ? ISD::ROTL : ISD::ROTR, DL, VT, LHSShiftArg,
|
||||
HasROTL ? LHSShiftAmt : RHSShiftAmt).getNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3275,12 +3268,8 @@ SDNode *DAGCombiner::MatchRotate(SDValue LHS, SDValue RHS, DebugLoc DL) {
|
||||
if (ConstantSDNode *SUBC =
|
||||
dyn_cast<ConstantSDNode>(LHSShiftAmt.getOperand(0))) {
|
||||
if (SUBC->getAPIntValue() == OpSizeInBits) {
|
||||
if (HasROTR)
|
||||
return DAG.getNode(ISD::ROTR, DL, VT,
|
||||
LHSShiftArg, RHSShiftAmt).getNode();
|
||||
else
|
||||
return DAG.getNode(ISD::ROTL, DL, VT,
|
||||
LHSShiftArg, LHSShiftAmt).getNode();
|
||||
return DAG.getNode(HasROTR ? ISD::ROTR : ISD::ROTL, DL, VT, LHSShiftArg,
|
||||
HasROTR ? RHSShiftAmt : LHSShiftAmt).getNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user