Re: [Ada] Improve performance of 'Image with enumeration types.

2017-09-26 Thread Duncan Sands
On 09/26/2017 12:17 PM, Eric Botcazou wrote: By the way, why not always do this "inlining", even when not optimizing? Because this generates more bloated code and inferior debugging experience. This is a trick question, because when you answer "because XYZ" I will then reply "but XYZ is a com

Re: [Ada] Improve performance of 'Image with enumeration types.

2017-09-26 Thread Duncan Sands
Hi Arno, it looks like this is in essence inlining the run-time library routine. In which case, shouldn't you only do it if inlining is enabled?  For example, it seems rather odd to do this if compiling with -Os. Actually, measurements showed that this instance of inlining is a win for both pe

Re: [Ada] Improve performance of 'Image with enumeration types.

2017-09-26 Thread Eric Botcazou
> By the way, why not always do this "inlining", even when not optimizing? Because this generates more bloated code and inferior debugging experience. > This is a trick question, because when you answer "because XYZ" I will then > reply "but XYZ is a common reason that people disable inlining whe

Re: [Ada] Improve performance of 'Image with enumeration types.

2017-09-26 Thread Arnaud Charlet
Duncan, > >>it looks like this is in essence inlining the run-time library > >>routine. In which case, shouldn't you only do it if inlining is > >>enabled?  For example, it seems rather odd to do this if > >>compiling with -Os. > > > >Actually, measurements showed that this instance of inlining is

Re: [Ada] Improve performance of 'Image with enumeration types.

2017-09-26 Thread Duncan Sands
Hi Pierre-Marie, On 09/26/2017 11:30 AM, Pierre-Marie de Rodat wrote: On 09/25/2017 02:47 PM, Duncan Sands wrote: it looks like this is in essence inlining the run-time library routine. In which case, shouldn't you only do it if inlining is enabled?  For example, it seems rather odd to do this

Re: [Ada] Improve performance of 'Image with enumeration types.

2017-09-26 Thread Pierre-Marie de Rodat
On 09/25/2017 02:47 PM, Duncan Sands wrote: it looks like this is in essence inlining the run-time library routine. In which case, shouldn't you only do it if inlining is enabled?  For example, it seems rather odd to do this if compiling with -Os. Actually, measurements showed that this insta

Re: [Ada] Improve performance of 'Image with enumeration types.

2017-09-25 Thread Duncan Sands
Hi, On 09/25/2017 10:54 AM, Pierre-Marie de Rodat wrote: This patch improves the performance of the code generated by the compiler for attribute Image when applied to user-defined enumeration types and the sources are compiled with optimizations enabled. it looks like this is in essence inlini