[PATCH] D159406: [SelectionDAG] Generalise SelectionDAG::computeOverflowKind to support other opcodes

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 09:48:11 PDT 2023


RKSimon added a comment.

I've found an InstCombine patch which should handle the new smulo case and committed to the DAG codegen tests - please can you rebase on e086e0aeef6b <https://reviews.llvm.org/rGe086e0aeef6be3b1b3b403e54fbe2669c649973d> and run `ninja check-llvm-codegen-x86`



================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:5450
+        DAG.getSetCC(DL, CarryVT, And, DAG.getConstant(0, DL, VT), ISD::SETNE));
   }
 
----------------
elhewaty wrote:
> Isn't this a wrong formatting it becomes this every time I use git clang-format
It doesn't that pretty, you could refactor it slightly:
```
if (IsSigned && VT.getScalarSizeInBits() == 1) {
    SDValue And = DAG.getNode(ISD::AND, DL, VT, N0, N1);
    SDValue Cmp = DAG.getSetCC(DL, CarryVT, And, DAG.getConstant(0, DL, VT), ISD::SETNE);
    return CombineTo(N, And, Cmp);
  }
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159406/new/

https://reviews.llvm.org/D159406



More information about the llvm-commits mailing list