[PATCH] D86687: [DAGCombiner] Enhance (zext(setcc))

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 06:56:06 PDT 2020


spatel added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:10551
+              DL, N0.getOperand(0), N0.getOperand(1),
+              DAG.getBoolExtOrTrunc(DAG.getConstant(1, DL, VT), DL, N0VT,
+                                    N00VT),
----------------
Use 'DAG.getBoolConstant' ?

```
          EVT N0VT = N0.getValueType();
          EVT N00VT = N0.getOperand(0).getValueType();
          if (SDValue SCC = SimplifySelectCC(
                  DL, N0.getOperand(0), N0.getOperand(1),
                  DAG.getBoolConstant(true, DL, N0VT, N00VT),
                  DAG.getBoolConstant(false, DL, N0VT, N00VT),
                  cast<CondCodeSDNode>(N0.getOperand(2))->get(), true))
            return DAG.getNode(ISD::ZERO_EXTEND, DL, VT, SCC);

```


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:10556
+              cast<CondCodeSDNode>(N0.getOperand(2))->get(), true))
+        return DAG.getNode(ISD::ZERO_EXTEND, DL, VT, SCC);
+    }
----------------
I think you can delete the existing transform as a special-case - the ZERO_EXTEND node will not be created if VT == N0VT.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86687



More information about the llvm-commits mailing list