[PATCH] D141256: [DAGCombine]Don't check for Undef/Poison if the node is deleted

Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 8 23:14:43 PST 2023


Naville created this revision.
Herald added subscribers: ecnelises, hiraditya.
Herald added a project: All.
Naville requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141256

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp


Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -14351,10 +14351,15 @@
       Op = DAG.getFreeze(Op);
   }
   // NOTE: this strips poison generating flags.
-  SDValue R = DAG.getNode(N0.getOpcode(), SDLoc(N0), N0->getVTList(), Ops);
-  assert(DAG.isGuaranteedNotToBeUndefOrPoison(R, /*PoisonOnly*/ false) &&
-         "Can't create node that may be undef/poison!");
-  return R;
+  if(N0.getOpcode() == ISD::DELETED_NODE){
+    return SDValue();
+  }
+  else{
+    SDValue R = DAG.getNode(N0.getOpcode(), SDLoc(N0), N0->getVTList(), Ops);
+    assert(DAG.isGuaranteedNotToBeUndefOrPoison(R, /*PoisonOnly*/ false) &&
+           "Can't create node that may be undef/poison!");
+    return R;
+  }
 }
 
 /// We know that BV is a build_vector node with Constant, ConstantFP or Undef


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141256.487297.patch
Type: text/x-patch
Size: 956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230109/ccd001bb/attachment.bin>


More information about the llvm-commits mailing list