summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Statepoint.cpp8
-rw-r--r--llvm/lib/IR/Verifier.cpp4
2 files changed, 3 insertions, 9 deletions
diff --git a/llvm/lib/IR/Statepoint.cpp b/llvm/lib/IR/Statepoint.cpp
index 13e8c6312a6..63be1e780d8 100644
--- a/llvm/lib/IR/Statepoint.cpp
+++ b/llvm/lib/IR/Statepoint.cpp
@@ -45,13 +45,7 @@ bool llvm::isGCRelocate(ImmutableCallSite CS) {
}
bool llvm::isGCResult(ImmutableCallSite CS) {
- if (auto *F = getCalledFunction(CS))
- return F->getIntrinsicID() == Intrinsic::experimental_gc_result;
- return false;
-}
-
-bool llvm::isGCResult(const Value *V) {
- return isGCResult(ImmutableCallSite(V));
+ return CS.getInstruction() && isa<GCResultInst>(CS.getInstruction());
}
bool llvm::isStatepointDirectiveAttr(Attribute Attr) {
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 686c1ccfca5..8f055886efe 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -1774,11 +1774,11 @@ void Verifier::verifyStatepoint(ImmutableCallSite CS) {
const CallInst *Call = dyn_cast<const CallInst>(U);
Assert(Call, "illegal use of statepoint token", &CI, U);
if (!Call) continue;
- Assert(isa<GCRelocateInst>(Call) || isGCResult(Call),
+ Assert(isa<GCRelocateInst>(Call) || isa<GCResultInst>(Call),
"gc.result or gc.relocate are the only value uses"
"of a gc.statepoint",
&CI, U);
- if (isGCResult(Call)) {
+ if (isa<GCResultInst>(Call)) {
Assert(Call->getArgOperand(0) == &CI,
"gc.result connected to wrong gc.statepoint", &CI, Call);
} else if (isa<GCRelocateInst>(Call)) {
OpenPOWER on IntegriCloud