Disable function inlining

58 vues
Passer au premier message non lu

Vishal Sharma

non lue,
25 mai 2015, 14 h 04 min 22 s2015-05-25
à ispc...@googlegroups.com

   Hi,

   How can I force ISPC not to inline certain functions?

   Does it support something like "_attribute__ ((noinline))" which is available in gcc and clang?

   Thanks,
   Vishal

Dmitry Babokin

non lue,
25 mai 2015, 14 h 08 min 01 s2015-05-25
à ispc...@googlegroups.com
AFAIK, there's no such attribute.

--
You received this message because you are subscribed to the Google Groups "Intel SPMD Program Compiler Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispc-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vishal Sharma

non lue,
26 mai 2015, 11 h 30 min 23 s2015-05-26
à ispc...@googlegroups.com
Thanks Dmitry!

In my case, I am trying to implement a transformation pass which looks for call instructions calling one of the functions that I have implemented. These functions don't do anything useful, just a placeholder (which is the reason why they are getting inlined). However, I use these function-calls as identifiers at IR level to identify sections where I should apply my transformation. So it is very important in my case that they don't get inlined.

I would really appreciate if you could provide some pointers for disabling automatic inlining in the ISPC code, thanks!

Vishal


--
Thanks
Vishal

Matt Pharr

non lue,
26 mai 2015, 12 h 02 min 48 s2015-05-26
à ispc...@googlegroups.com
How about declaring your special functions as 'extern' functions (without a definition)? Then they'll survive in the IR...

(ispc does effectively this with scatters and gathers; they are turned into unresolved function calls at first, which later passes try to simplify into simple loads/stores when possible, and are otherwise eventually turned into either native instructions or expanded out into individual loads/stores, depending on the target...)

Thanks,
Matt

Vishal Sharma

non lue,
27 mai 2015, 04 h 20 min 47 s2015-05-27
à ispc...@googlegroups.com
Great, it works! Thanks, Matt!
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message