[llvm] 91dd2f2 - [Statepoint] Delete more dead code from old wrappers

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 20:11:19 PDT 2020


Author: Philip Reames
Date: 2020-06-03T20:10:30-07:00
New Revision: 91dd2f2536474df92b92250e1eb2ee9c30ffeb9a

URL: https://github.com/llvm/llvm-project/commit/91dd2f2536474df92b92250e1eb2ee9c30ffeb9a
DIFF: https://github.com/llvm/llvm-project/commit/91dd2f2536474df92b92250e1eb2ee9c30ffeb9a.diff

LOG: [Statepoint] Delete more dead code from old wrappers

The verify() routine duplicates IR/Verifier.cpp checks, so while not technically dead it doesn't add any value either.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/Statepoint.h b/llvm/include/llvm/IR/Statepoint.h
index 0ef9f01b0e26..92b0e2ac1488 100644
--- a/llvm/include/llvm/IR/Statepoint.h
+++ b/llvm/include/llvm/IR/Statepoint.h
@@ -238,20 +238,13 @@ class StatepointBase {
     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 @@ class StatepointBase {
   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

diff  --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index 522fc88d42b3..4bff97ffe50f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -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");


        


More information about the llvm-commits mailing list