Add a RemoveFromWorklist method to DCI. This is needed to do some complicated
authorCameron Zwarich <zwarich@apple.com>
Sat, 2 Apr 2011 02:40:26 +0000 (02:40 +0000)
committerCameron Zwarich <zwarich@apple.com>
Sat, 2 Apr 2011 02:40:26 +0000 (02:40 +0000)
transformations in target-specific DAG combines without causing DAGCombiner to
delete the same node twice. If you know of a better way to avoid this (see my
next patch for an example), please let me know.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128758 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 6b3c45adc59d0cb74ad31310e10d826576c0339d..ac5b1f602fec3784f6f9895dd4b87fc74bd27886 100644 (file)
@@ -927,6 +927,7 @@ public:
     bool isCalledByLegalizer() const { return CalledByLegalizer; }
 
     void AddToWorklist(SDNode *N);
+    void RemoveFromWorklist(SDNode *N);
     SDValue CombineTo(SDNode *N, const std::vector<SDValue> &To,
                       bool AddTo = true);
     SDValue CombineTo(SDNode *N, SDValue Res, bool AddTo = true);
index f9f89858c97c4e8922b53c7494ad97cf72f8483c..a9afec8b21678b29ef639e1afe5dff612b55bd87 100644 (file)
@@ -319,6 +319,10 @@ void TargetLowering::DAGCombinerInfo::AddToWorklist(SDNode *N) {
   ((DAGCombiner*)DC)->AddToWorkList(N);
 }
 
+void TargetLowering::DAGCombinerInfo::RemoveFromWorklist(SDNode *N) {
+  ((DAGCombiner*)DC)->removeFromWorkList(N);
+}
+
 SDValue TargetLowering::DAGCombinerInfo::
 CombineTo(SDNode *N, const std::vector<SDValue> &To, bool AddTo) {
   return ((DAGCombiner*)DC)->CombineTo(N, &To[0], To.size(), AddTo);