[Statepoint] Delete more dead code from old wrappers
authorPhilip Reames <listmail@philipreames.com>
Thu, 4 Jun 2020 03:05:19 +0000 (20:05 -0700)
committerPhilip Reames <listmail@philipreames.com>
Thu, 4 Jun 2020 03:10:30 +0000 (20:10 -0700)
The verify() routine duplicates IR/Verifier.cpp checks, so while not technically dead it doesn't add any value either.

llvm/include/llvm/IR/Statepoint.h
llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

index 0ef9f01..92b0e2a 100644 (file)
@@ -238,20 +238,13 @@ public:
     return StatepointCall;
   }
 
-  size_t arg_size() const { return getCall()->actual_arg_size(); }
-  arg_iterator arg_begin() const { return getCall()->actual_arg_begin(); }
-  arg_iterator arg_end() const { return getCall()->actual_arg_end(); }
-  iterator_range<arg_iterator> call_args() const {
-    return getCall()->actual_args();
-  }
-
   /// Number of GC transition args.
   int getNumTotalGCTransitionArgs() const {
-    const Value *NumGCTransitionArgs = *arg_end();
+    const Value *NumGCTransitionArgs = *getCall()->actual_arg_end();
     return cast<ConstantInt>(NumGCTransitionArgs)->getZExtValue();
   }
   arg_iterator gc_transition_args_begin() const {
-    auto I = arg_end() + 1;
+    auto I = getCall()->actual_arg_end() + 1;
     assert((getCall()->arg_end() - I) >= 0);
     return I;
   }
@@ -288,34 +281,6 @@ public:
   iterator_range<arg_iterator> deopt_operands() const {
     return make_range(deopt_begin(), deopt_end());
   }
-
-  arg_iterator gc_args_begin() const {
-    auto I = getCall()->gc_args_begin();
-    assert(I == deopt_end());
-    return I;
-  }
-  arg_iterator gc_args_end() const { return getCall()->gc_args_end(); }
-  unsigned gcArgsStartIdx() const { return getCall()->gcArgsStartIdx(); }
-  iterator_range<arg_iterator> gc_args() const {
-    return getCall()->gc_args();
-  }
-
-#ifndef NDEBUG
-  /// Asserts if this statepoint is malformed.  Common cases for failure
-  /// include incorrect length prefixes for variable length sections or
-  /// illegal values for parameters.
-  void verify() {
-    // The internal asserts in the iterator accessors do the rest.
-    (void)arg_begin();
-    (void)arg_end();
-    (void)gc_transition_args_begin();
-    (void)gc_transition_args_end();
-    (void)deopt_begin();
-    (void)deopt_end();
-    (void)gc_args_begin();
-    (void)gc_args_end();
-  }
-#endif
 };
 
 /// A specialization of it's base class for read only access
index 522fc88..4bff97f 100644 (file)
@@ -820,11 +820,6 @@ SelectionDAGBuilder::LowerStatepoint(const GCStatepointInst &I,
          "anyregcc is not supported on statepoints!");
 
 #ifndef NDEBUG
-  // If this is a malformed statepoint, report it early to simplify debugging.
-  // This should catch any IR level mistake that's made when constructing or
-  // transforming statepoints.
-  ISP.verify();
-
   // Check that the associated GCStrategy expects to encounter statepoints.
   assert(GFI->getStrategy().useStatepoints() &&
          "GCStrategy does not expect to encounter statepoints");