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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 21 09:48:30 PST 2020


RKSimon 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
----------------
spatel wrote:
> 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)?
As a first step I'm OK with this going in, but I think creating a visitXORLike helper would be better. 


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

https://reviews.llvm.org/D93274



More information about the llvm-commits mailing list