[llvm] r270454 - SDAG: Remove the transitional default Select() implementation

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 09:52:56 PDT 2016


Author: bogner
Date: Mon May 23 11:52:53 2016
New Revision: 270454

URL: http://llvm.org/viewvc/llvm-project?rev=270454&view=rev
Log:
SDAG: Remove the transitional default Select() implementation

In r268693, we started requiring that SelectionDAGISel::Select return
void, but provided a default implementation that did just that by
calling into the old interface. Now that all targets have been
updated, we'll just remove the default implementation.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h?rev=270454&r1=270453&r2=270454&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGISel.h Mon May 23 11:52:53 2016
@@ -77,39 +77,7 @@ public:
   virtual void PostprocessISelDAG() {}
 
   /// Main hook for targets to transform nodes into machine nodes.
-  ///
-  /// All targets should implement this hook. The default implementation will be
-  /// made abstract once all targets are migrated off of the legacy hook.
-  virtual void Select(SDNode *N) {
-    SDNode *New = SelectImpl(N);
-    // TODO: Checking DELETED_NODE here is undefined behaviour, which will be
-    // fixed by migrating backends to implement the void Select interface
-    // instead or returning a node.
-    if (New == N || N->getOpcode() == ISD::DELETED_NODE)
-      // If we ask to replace the node with itself or if we deleted the original
-      // node, just move on to the next one. This case will go away once
-      // everyone migrates to stop implementing SelectImpl.
-      return;
-    if (New) {
-      // Replace the node with the returned node. Originally, Select would
-      // always return a node and the caller would replace it, but this doesn't
-      // work for more complicated selection schemes.
-      ReplaceUses(N, New);
-      CurDAG->RemoveDeadNode(N);
-    } else if (N->use_empty())
-      // Clean up dangling nodes if the target didn't bother. These are
-      // basically bugs in the targets, but we were lenient in the past and did
-      // this for them.
-      CurDAG->RemoveDeadNode(N);
-  }
-
-  /// Legacy hook to support transitioning to the return-less Select().
-  ///
-  /// This exposes the old style Select hook. New code should implement void
-  /// Select() instead.
-  virtual SDNode *SelectImpl(SDNode *N) {
-    llvm_unreachable("Subclasses must implement one of Select or SelectImpl");
-  }
+  virtual void Select(SDNode *N) = 0;
 
   /// SelectInlineAsmMemoryOperand - Select the specified address as a target
   /// addressing mode, according to the specified constraint.  If this does




More information about the llvm-commits mailing list