Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2016-05

Improved inlining for generic specializations

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sven Barth

Hello together!

For those that are interested: I've improved the inlining for specializations of generics so that now the bodies of specialized routines (no matter whether they are normal methods of generic classes, records, etc. or true generic routines) are inlined as long as the body of the generic routine is already available (basically the same rules as for inlining normal routines) (see tests/test/ugeneric102.pp for an example). Of course there might still be cases when a routine isn't inlined, but more often than not that should be due to reasons that would apply for normal routines as well.

Regards,
Sven

Reply by email

Maciej Izak
to Sven Barth

2016-05-26 21:06 GMT+02:00 Sven Barth :

... as long as the body of the generic routine is already available (basically the same rules as for inlining normal routines) (see tests/test/ugeneric102.pp for an example)

Nice one Sven! :) Is there some warning when method is not inlined in the case of lacking body?

Best regards, Maciej Izak

Reply by email

Sven Barth
to Maciej Izak
"Maciej Izak" wrote
2016-05-26 21:06 GMT+02:00 Sven Barth : > > ... as long as the body of the generic routine is already available

(basically the same rules as for inlining normal routines) (see tests/test/ugeneric102.pp for an example)

Nice one Sven! :) Is there some warning when method is not inlined in the

case of lacking body?

No, there is not, cause that's basically the same for normal routines (where you don't get a warning either).
Though there might be a debug message, that gets printed if a routine can't be inlined... (with the correct verbosity setting) Also keep in mind that "inline" is merely a hint for the compiler. So not inlining a routine for whatever the reason is completely in the compiler's power to do.

Regards,
Sven

Reply by email

LacaK
to Sven Barth: Hello together! For those that are interested: I've improved the inlining for…

Thank you!
Is it for FPC 3.2 only or can it be backported to 3.0 series (3.0.4 probably?) ?
L.

Show quoted text 21 lines
Hello together! For those that are interested: I've improved the inlining for specializations of generics so that now the bodies of specialized routines (no matter whether they are normal methods of generic classes, records, etc. or true generic routines) are inlined as long as the body of the generic routine is already available (basically the same rules as for inlining normal routines) (see tests/test/ugeneric102.pp for an example). Of course there might still be cases when a routine isn't inlined, but more often than not that should be due to reasons that would apply for normal routines as well. Regards, Sven _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email