[Statepoint] Determine return type from elementtype attribute

Based on the LangRef change in D117890, this uses the elementtype
attribute rather than the pointer element type to determine the
statepoint callee function type, making statepoints compatible
with opaque pointers.
This commit is contained in:
Nikita Popov 2022-02-04 14:37:02 +01:00
parent 8f8e13056a
commit f62a400cdf
2 changed files with 4 additions and 3 deletions

View File

@ -121,9 +121,9 @@ public:
/// Return the type of the value returned by the call underlying the
/// statepoint.
Type *getActualReturnType() const {
auto *CalleeTy =
getActualCalledOperand()->getType()->getPointerElementType();
return cast<FunctionType>(CalleeTy)->getReturnType();
auto *FT = cast<FunctionType>(
getAttributes().getParamElementType(CalledFunctionPos));
return FT->getReturnType();
}

View File

@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -verify-machineinstrs < %s | FileCheck %s
; RUN: llc -verify-machineinstrs -opaque-pointers < %s | FileCheck %s
; This file contains a collection of basic tests to ensure we didn't
; screw up normal call lowering when there are no deopt or gc arguments.