[llvm] 1897576 - Fold StatepointBB into checks as it's only used from an NDEBUG or ASSERT

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 25 18:37:05 PDT 2020


Author: Eric Christopher
Date: 2020-07-25T18:36:53-07:00
New Revision: 18975762c1974047baeeacb17879416410012a31

URL: https://github.com/llvm/llvm-project/commit/18975762c1974047baeeacb17879416410012a31
DIFF: https://github.com/llvm/llvm-project/commit/18975762c1974047baeeacb17879416410012a31.diff

LOG: Fold StatepointBB into checks as it's only used from an NDEBUG or ASSERT
context fixing an unused variable warning.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index 3063993ba97d..4d93dec9e1fa 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -1087,13 +1087,12 @@ void SelectionDAGBuilder::visitGCResult(const GCResultInst &CI) {
 }
 
 void SelectionDAGBuilder::visitGCRelocate(const GCRelocateInst &Relocate) {
-  const BasicBlock *StatepointBB = Relocate.getStatepoint()->getParent();
 #ifndef NDEBUG
   // Consistency check
   // We skip this check for relocates not in the same basic block as their
   // statepoint. It would be too expensive to preserve validation info through
   // 
diff erent basic blocks.
-  if (StatepointBB == Relocate.getParent())
+  if (Relocate.getStatepoint()->getParent() == Relocate.getParent())
     StatepointLowering.relocCallVisited(Relocate);
 
   auto *Ty = Relocate.getType()->getScalarType();
@@ -1117,7 +1116,8 @@ void SelectionDAGBuilder::visitGCRelocate(const GCRelocateInst &Relocate) {
   auto It = DPtrMap.find(DerivedPtr);
   if (It != DPtrMap.end()) {
     setValue(&Relocate, It->second);
-    assert(Relocate.getParent() == StatepointBB && "unexpected DPtrMap entry");
+    assert(Relocate.getParent() == Relocate.getStatepoint()->getParent() &&
+           "unexpected DPtrMap entry");
     return;
   }
 


        


More information about the llvm-commits mailing list