diff options
Diffstat (limited to 'lib/CodeGen/SelectionDAG/StatepointLowering.h')
-rw-r--r-- | lib/CodeGen/SelectionDAG/StatepointLowering.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/StatepointLowering.h b/lib/CodeGen/SelectionDAG/StatepointLowering.h index 372c82a359f6..70507932681d 100644 --- a/lib/CodeGen/SelectionDAG/StatepointLowering.h +++ b/lib/CodeGen/SelectionDAG/StatepointLowering.h @@ -1,9 +1,8 @@ //===- StatepointLowering.h - SDAGBuilder's statepoint code ---*- C++ -*---===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -67,13 +66,18 @@ public: /// before the next statepoint. If we don't see it, we'll report /// an assertion. void scheduleRelocCall(const CallInst &RelocCall) { - PendingGCRelocateCalls.push_back(&RelocCall); + // We are not interested in lowering dead instructions. + if (!RelocCall.use_empty()) + PendingGCRelocateCalls.push_back(&RelocCall); } /// Remove this gc_relocate from the list we're expecting to see /// before the next statepoint. If we weren't expecting to see /// it, we'll report an assertion. void relocCallVisited(const CallInst &RelocCall) { + // We are not interested in lowering dead instructions. + if (RelocCall.use_empty()) + return; auto I = llvm::find(PendingGCRelocateCalls, &RelocCall); assert(I != PendingGCRelocateCalls.end() && "Visited unexpected gcrelocate call"); |