[ArgPromotion][TTI] Pass types to ABI compatibility hook
authorNikita Popov <npopov@redhat.com>
Mon, 20 Dec 2021 11:27:05 +0000 (12:27 +0100)
committerNikita Popov <npopov@redhat.com>
Wed, 22 Dec 2021 08:37:51 +0000 (09:37 +0100)
commitf5ac23b5ae090d64d31f0b6624470af97dc20bf6
treea6781c1c134cec588501291a87c1894743df8cfe
parent958e7a284d1146842ee2b115172b5eed00e56649
[ArgPromotion][TTI] Pass types to ABI compatibility hook

The areFunctionArgsABICompatible() hook currently accepts a list of
pointer arguments, though what we're actually interested in is the
ABI compatibility after these pointer arguments have been converted
into value arguments.

This means that a) the current API is incompatible with opaque
pointers (because it requires inspection of pointee types) and
b) it can only be used in the specific context of ArgPromotion.
I would like to reuse the API when inspecting calls during inlining.

This patch converts it into an areTypesABICompatible() hook, which
accepts a list of types. This makes the method more generally usable,
and compatible with opaque pointers from an API perspective (the
actual usage in ArgPromotion/Attributor is still incompatible,
I'll follow up on that in separate patches).

Differential Revision: https://reviews.llvm.org/D116031
llvm/include/llvm/Analysis/TargetTransformInfo.h
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
llvm/lib/Analysis/TargetTransformInfo.cpp
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/lib/Target/X86/X86TargetTransformInfo.h
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp