mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 20:33:15 +00:00
Tidy up to match coding standards. Remove 'else' after 'return' and moving operators to end of preceding line. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164887 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
32b7343a96
commit
0eb5dadf65
@ -3003,7 +3003,7 @@ SDValue DAGCombiner::MatchBSwapHWord(SDNode *N, SDValue N0, SDValue N1) {
|
||||
SDValue ShAmt = DAG.getConstant(16, getShiftAmountTy(VT));
|
||||
if (TLI.isOperationLegalOrCustom(ISD::ROTL, VT))
|
||||
return DAG.getNode(ISD::ROTL, N->getDebugLoc(), VT, BSwap, ShAmt);
|
||||
else if (TLI.isOperationLegalOrCustom(ISD::ROTR, VT))
|
||||
if (TLI.isOperationLegalOrCustom(ISD::ROTR, VT))
|
||||
return DAG.getNode(ISD::ROTR, N->getDebugLoc(), VT, BSwap, ShAmt);
|
||||
return DAG.getNode(ISD::OR, N->getDebugLoc(), VT,
|
||||
DAG.getNode(ISD::SHL, N->getDebugLoc(), VT, BSwap, ShAmt),
|
||||
@ -3275,14 +3275,14 @@ SDNode *DAGCombiner::MatchRotate(SDValue LHS, SDValue RHS, DebugLoc DL) {
|
||||
}
|
||||
|
||||
// Look for sign/zext/any-extended or truncate cases:
|
||||
if ((LHSShiftAmt.getOpcode() == ISD::SIGN_EXTEND
|
||||
|| LHSShiftAmt.getOpcode() == ISD::ZERO_EXTEND
|
||||
|| LHSShiftAmt.getOpcode() == ISD::ANY_EXTEND
|
||||
|| LHSShiftAmt.getOpcode() == ISD::TRUNCATE) &&
|
||||
(RHSShiftAmt.getOpcode() == ISD::SIGN_EXTEND
|
||||
|| RHSShiftAmt.getOpcode() == ISD::ZERO_EXTEND
|
||||
|| RHSShiftAmt.getOpcode() == ISD::ANY_EXTEND
|
||||
|| RHSShiftAmt.getOpcode() == ISD::TRUNCATE)) {
|
||||
if ((LHSShiftAmt.getOpcode() == ISD::SIGN_EXTEND ||
|
||||
LHSShiftAmt.getOpcode() == ISD::ZERO_EXTEND ||
|
||||
LHSShiftAmt.getOpcode() == ISD::ANY_EXTEND ||
|
||||
LHSShiftAmt.getOpcode() == ISD::TRUNCATE) &&
|
||||
(RHSShiftAmt.getOpcode() == ISD::SIGN_EXTEND ||
|
||||
RHSShiftAmt.getOpcode() == ISD::ZERO_EXTEND ||
|
||||
RHSShiftAmt.getOpcode() == ISD::ANY_EXTEND ||
|
||||
RHSShiftAmt.getOpcode() == ISD::TRUNCATE)) {
|
||||
SDValue LExtOp0 = LHSShiftAmt.getOperand(0);
|
||||
SDValue RExtOp0 = RHSShiftAmt.getOperand(0);
|
||||
if (RExtOp0.getOpcode() == ISD::SUB &&
|
||||
@ -4421,7 +4421,6 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
|
||||
// If the desired elements are smaller or larger than the source
|
||||
// elements we can use a matching integer vector type and then
|
||||
// truncate/sign extend
|
||||
else {
|
||||
EVT MatchingElementType =
|
||||
EVT::getIntegerVT(*DAG.getContext(),
|
||||
N0VT.getScalarType().getSizeInBits());
|
||||
@ -4436,7 +4435,6 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
|
||||
return DAG.getSExtOrTrunc(VsetCC, N->getDebugLoc(), VT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sext(setcc x, y, cc) -> (select_cc x, y, -1, 0, cc)
|
||||
unsigned ElementWidth = VT.getScalarType().getSizeInBits();
|
||||
@ -5244,10 +5242,9 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
|
||||
// if the source is smaller than the dest, we still need an extend
|
||||
return DAG.getNode(N0.getOpcode(), N->getDebugLoc(), VT,
|
||||
N0.getOperand(0));
|
||||
else if (N0.getOperand(0).getValueType().bitsGT(VT))
|
||||
if (N0.getOperand(0).getValueType().bitsGT(VT))
|
||||
// if the source is larger than the dest, than we just need the truncate
|
||||
return DAG.getNode(ISD::TRUNCATE, N->getDebugLoc(), VT, N0.getOperand(0));
|
||||
else
|
||||
// if the source and dest are the same type, we can drop both the extend
|
||||
// and the truncate.
|
||||
return N0.getOperand(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user