[PATCH] D93274: [DAGCombiner] Don't create sexts of deleted xors when they were in-visit replaced

Layton Kifer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 14:06:00 PST 2020


laytonio added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:10733
     // If we can eliminate the 'not', the sext form should be better
-    if (SDValue NewXor = visitXOR(N0.getNode()))
-      return DAG.getNode(ISD::SIGN_EXTEND, DL, VT, NewXor);
+    if (SDValue NewXor = visitXOR(N0.getNode())) {
+      // Returning N0 is a form of in-visit replacement that may have
----------------
RKSimon wrote:
> Instead of visitXOR() - do we need a visitXORLike op instead here? Or maybe this should be handled by SimplifyDemandedBits?
I was planning on trying to extend `extractBooleanFlip` to include more of the boolean fold and use that here as a follow up.


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

https://reviews.llvm.org/D93274



More information about the llvm-commits mailing list