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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 08:51:16 PST 2020


spatel 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
----------------
laytonio wrote:
> 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.
@rksimon - are you ok with this extension to solve the crash, or should we change course as suggested (and revert D91589 to solve the crash)?


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

https://reviews.llvm.org/D93274



More information about the llvm-commits mailing list