[PATCH] D143838: [X86] Improve (select carry C1+1 C1)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 12 03:33:56 PST 2023


RKSimon added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:50051
+  if (N0.getOpcode() == ISD::ZERO_EXTEND && N0.hasOneUse() &&
+      N0.getOperand(0).getOpcode() == X86ISD::SETCC) {
+    if (ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1)) {
----------------
Move hasOneUse() to the end of the checks - its a slow function and we should avoid it if we can.
```
  if (N0.getOpcode() == ISD::ZERO_EXTEND &&
      N0.getOperand(0).getOpcode() == X86ISD::SETCC &&
      N0.hasOneUse()) {
```


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:52543
+  SDLoc DL(N);
+  if (N0.getOpcode() == ISD::ZERO_EXTEND && N0.hasOneUse() &&
+      N0.getOperand(0).getOpcode() == X86ISD::SETCC) {
----------------
Move hasOneUse() to the end of the checks


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143838



More information about the llvm-commits mailing list