From: Nikita Popov Date: Fri, 4 Feb 2022 13:37:02 +0000 (+0100) Subject: [Statepoint] Determine return type from elementtype attribute X-Git-Tag: upstream/15.0.7~17799 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f62a400cdf114ff97fee99d74234c889142a34e7;p=platform%2Fupstream%2Fllvm.git [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. --- diff --git a/llvm/include/llvm/IR/Statepoint.h b/llvm/include/llvm/IR/Statepoint.h index da9c732..8e997d97 100644 --- a/llvm/include/llvm/IR/Statepoint.h +++ b/llvm/include/llvm/IR/Statepoint.h @@ -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(CalleeTy)->getReturnType(); + auto *FT = cast( + getAttributes().getParamElementType(CalledFunctionPos)); + return FT->getReturnType(); } diff --git a/llvm/test/CodeGen/X86/statepoint-call-lowering.ll b/llvm/test/CodeGen/X86/statepoint-call-lowering.ll index 77421e6..b4a590a 100644 --- a/llvm/test/CodeGen/X86/statepoint-call-lowering.ll +++ b/llvm/test/CodeGen/X86/statepoint-call-lowering.ll @@ -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.