<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">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:</div>
<div class="">declare @llvm.intrinsic(i8* p)</div>
<div class="">
<div class="">declare @llvm.intrinsic(i32* p)</div>
<div class="">Since they are different declarations they have to have different names. </div>
<div class=""><br class="">
</div>
<div class="">One of the options now is to use i8* pointers in intrinsic arguments. I experimented with this approach while fixing the remangling problem (<a href="https://reviews.llvm.org/D19373" class="">https://reviews.llvm.org/D19373</a>), but it involves
 argument type juggling in autoupgrade and IRBuilder for each intrinsic and in general seemed bulky and invasive. </div>
<div class=""><br class="">
</div>
<div class="">Artur</div>
<div class=""><br class="">
</div>
<div>
<blockquote type="cite" class="">
<div class="">On 03 Oct 2016, at 14:58, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com" class="">rafael.espindola@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">We have hit <a href="https://llvm.org/bugs/show_bug.cgi?id=30509" class="">
https://llvm.org/bugs/show_bug.cgi?id=30509</a> while LTOing<br class="">
some internal project, so I decided to at least familiarize myself<br class="">
with the issue.<br class="">
<br class="">
The bug is about the fact that a type renaming causes an intrinsic to<br class="">
be recreated, but that got me thinking why we do need to mangle the<br class="">
intrinsic names? Any information we could want is available from the<br class="">
type itself.<br class="">
<br class="">
This is particularly troublesome for typeless pointers as they require<br class="">
us to not look a the element type. Could we just mangle all pointer<br class="">
types as 'p'?<br class="">
<br class="">
Cheers,<br class="">
Rafael<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>