Intrinsic mangling and typeless pointers

Artur Pilipenko via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 06:46:03 PDT 2016


The only reason for intrinsic mangling is the way to get a unique symbolic name. One we have typeless pointers I expect that pointer arguments are mangled as ‘p’ and we won’t have any headache with remangling. But now we still can have two overloaded intrinsics which only differ by pointer type:
declare @llvm.intrinsic(i8* p)
declare @llvm.intrinsic(i32* p)
Since they are different declarations they have to have different names.

One of the options now is to use i8* pointers in intrinsic arguments. I experimented with this approach while fixing the remangling problem (https://reviews.llvm.org/D19373), but it involves argument type juggling in autoupgrade and IRBuilder for each intrinsic and in general seemed bulky and invasive.

Artur

On 03 Oct 2016, at 14:58, Rafael Espíndola <rafael.espindola at gmail.com<mailto:rafael.espindola at gmail.com>> wrote:

We have hit https://llvm.org/bugs/show_bug.cgi?id=30509 while LTOing
some internal project, so I decided to at least familiarize myself
with the issue.

The bug is about the fact that a type renaming causes an intrinsic to
be recreated, but that got me thinking why we do need to mangle the
intrinsic names? Any information we could want is available from the
type itself.

This is particularly troublesome for typeless pointers as they require
us to not look a the element type. Could we just mangle all pointer
types as 'p'?

Cheers,
Rafael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161003/26bab151/attachment.html>


More information about the llvm-commits mailing list