[LLVMdev] Optimized code analysis problems

Nipun Arora nipun2512 at gmail.com
Sun Feb 1 11:45:32 PST 2009


Hi Eli,

Well I think a way to hack it might be better for my purposes, can you
suggest any ways of getting started on that and where.

Essentially I'm developing an IDE and need to extract the dependency graphs
while retaining the actual function names rather than them being converted
to llvm.* names. If I go for the other option you suggested. I'd have to do
a one-to one mapping of all possible optimized function calls that could be
made from different libraries imported by the user.

Thanks
Nipun

On Sat, Jan 31, 2009 at 4:48 PM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Sat, Jan 31, 2009 at 1:14 PM, Nipun Arora <nipun2512 at gmail.com> wrote:
> > Hii,
> >
> > Thanks for the response, yes I couldn't find any way to extract the names
> > through any of the passes.
> > Where could I potentially insert a hack so that any function call to
> > intrinsic functions or library functions can be retrieved?
> > Could you gimme any ideas for the start?
>
> Basically, there is no mapping from the llvm.* names to the _mm_*
> names; the transformation is lossy.
>
> You have a couple options here: one is to manipulate the source to let
> you see the _mm_ names, and the other is to catch the _mm_ names
> before the inliner runs.
>
> Manipulating the source isn't actually very hard, although it's a
> non-trivial amount of work; basically, you create your own xmmintrin.h
> that doesn't have inline implementations, and mess with the include
> paths so the compiler picks your version rather than the builtin
> version.  That way, once you transform to IL, the _mm_ calls will stay
> as _mm_ calls.
>
> If you're using the standard headers, the _mm_ function are defined as
> inline functions, so at least in trunk LLVM builds, they exist in the
> IL at some point.  They're gone by the time llvm-gcc outputs the IL,
> though, because the inliner unconditionally inlines them.  So to get
> the _mm_ names, you'll have to hack the llvm-gcc source to disable the
> inlining pass.
>
> -Eli
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090201/0cb19677/attachment.html>


More information about the llvm-dev mailing list