# Changeset View

Changeset View

# Standalone View

Standalone View

# lib/CodeGen/SelectionDAG/DAGCombiner.cpp

- This file is larger than 256 KB, so syntax highlighting is disabled by default.

Show First 20 Lines • Show All 2513 Lines • ▼ Show 20 Line(s) | 2475 | SDValue DAGCombiner::visitADDCARRY(SDNode *N) { | |||
---|---|---|---|---|---|

2514 | } | 2514 | } | ||

2515 | 2515 | | |||

2516 | if (SDValue Combined = visitADDCARRYLike(N0, N1, CarryIn, N)) | 2516 | if (SDValue Combined = visitADDCARRYLike(N0, N1, CarryIn, N)) | ||

2517 | return Combined; | 2517 | return Combined; | ||

2518 | 2518 | | |||

2519 | if (SDValue Combined = visitADDCARRYLike(N1, N0, CarryIn, N)) | 2519 | if (SDValue Combined = visitADDCARRYLike(N1, N0, CarryIn, N)) | ||

2520 | return Combined; | 2520 | return Combined; | ||

2521 | 2521 | | |||

2522 | // We want to avoid useless duplication. | ||||

2523 | SDValue Ops[] = {N1, N0, CarryIn}; | ||||

2524 | SDNode *CSENode = DAG.getNodeIfExists(ISD::ADDCARRY, N->getVTList(), Ops, | ||||

2525 | N->getFlags()); | ||||

2526 | if (CSENode) | ||||

2527 | return SDValue(CSENode, 0); | ||||

RKSimon: We already do this in DAGCombiner::combine for plain commutative binops, is it worth… | |||||

deadalnixAuthorUnsubmitted Done ReplyThe problem is that this is not a binary operation so it doesn't fit in the existing machinery. If this end up being common enough, we can generalize. deadalnix: The problem is that this is not a binary operation so it doesn't fit in the existing machinery. | |||||

RKSimonUnsubmitted Not Done ReplyOK - please add a TODO suggesting this. Should the ConstantSDNode handling be done here as well? RKSimon: OK - please add a TODO suggesting this. Should the ConstantSDNode handling be done here as well? | |||||

deadalnixAuthorUnsubmitted Done ReplyYou mean moving a constant argument on RHS when it is on RHS ? deadalnix: You mean moving a constant argument on RHS when it is on RHS ? | |||||

RKSimonUnsubmitted Not Done Replyyes RKSimon: yes | |||||

2528 | | ||||

2522 | return SDValue(); | 2529 | return SDValue(); | ||

2523 | } | 2530 | } | ||

2524 | 2531 | | |||

2525 | /** | 2532 | /** | ||

2526 | * If we are facing some sort of ddamoni carry propapagtion patternq try to | 2533 | * If we are facing some sort of ddamoni carry propapagtion patternq try to | ||

2527 | * break it up to generate something like: | 2534 | * break it up to generate something like: | ||

2528 | * (addcarry X, 0, (addcarry A, B, Z):Carry) | 2535 | * (addcarry X, 0, (addcarry A, B, Z):Carry) | ||

2529 | * | 2536 | * | ||

▲ Show 20 Lines • Show All 16977 Lines • Show Last 20 Lines |

We already do this in DAGCombiner::combine for plain commutative binops, is it worth generalizing that code?