<div dir="ltr">never-mind. Just hit me already solved similar issue using Jhon's <div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">Function* callee = dyn_cast<Function>(call-></span><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">getCalledValue()-></span><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">stripPointerCasts());</span></div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 5, 2014 at 11:26 PM, Manish Gupta <span dir="ltr"><<a href="mailto:manishg@cs.ucsd.edu" target="_blank">manishg@cs.ucsd.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Any answer on this issue. I am not able to inline any function called using bitcast. </div><div class="HOEnZb">

<div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 9, 2012 at 5:09 PM, Relph, Richard <span dir="ltr"><<a href="mailto:Richard.Relph@amd.com" target="_blank">Richard.Relph@amd.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Spoke too soon... running the inst combine pass does seem to resolve the linker/inlining issue. But the resulting code fails to run correctly. I was expecting the same result that I get when running with unstripped modules, that is passing test runs. When it still failed, I guessed the failure mode to be the same, but it isn't.<br>



<br>
Not sure WHAT to make of this...<br>
________________________________________<br>
From: Eli Friedman [<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>]<br>
Sent: Friday, November 09, 2012 4:08 PM<br>
To: Relph, Richard<br>
Cc: <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a><br>
Subject: Re: [LLVMdev] Inlining bitcast functions...<br>
<div><div><br>
On Fri, Nov 9, 2012 at 3:58 PM, Relph, Richard <<a href="mailto:Richard.Relph@amd.com" target="_blank">Richard.Relph@amd.com</a>> wrote:<br>
> Eli,<br>
>     Thanks. I don't think it's a bug in the linker, really… it's required to treat (stripped) opaque types as different, since it really has no way to know if the caller and the callee really are referring to the same thing… though it then seems to turn right around and do exactly that by inserting the bitcast. ;-) (That does come from the linker.)<br>



>     That the linker 'works differently' if the modules are not stripped is arguably a 'bug', since even if the opaque types happen to have the same name, they still may not be referring to the same type.<br>



>     That said, I think what the linker is doing with unstripped modules is reasonable… Using an opaque structure's name to "match" types is really the only option. And they are, in fact, in this case, referring to the same type.<br>



>     I would go a bit further, though, and say that IF the linker is (as it seems to be) using opaque structure names to match types, then the "strip" pass ought to leave opaque structure names intact. In this particular case, the names aren't useless… Or perhaps ALL (stripped) opaque types should merely be smashed together to avoid the troublesome bitcast.<br>



<br>
The name isn't a fundamental property of an LLVM struct type; we<br>
preserve it for readability, but not at the expense of correctness.<br>
<br>
I think the linker uses the names as a hint to merge struct types, but<br>
it also should be taking the structure of globals and instructions<br>
which use the struct type into account.<br>
<br>
>     I'll look in to instcombine, but if you've got any further words of advice on how to use it, they would be greatly appreciated.<br>
<br>
It's a pass; you run it.<br>
<br>
-Eli<br>
<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>