[NOT] Optimizing compiler

Just starting out? Need help? Post your questions and find answers here.
User avatar
useful
Enthusiast
Enthusiast
Posts: 403
Joined: Fri Jul 19, 2013 7:36 am

Re: [NOT] Optimizing compiler

Post by useful »

https://sol.gfxile.net/soloud/soloud_20 ... troduction
"The engine has been designed to make simple things easy, while not making harder things impossible."

When I read that, I immediately thought that engine in that sentence could easily be replaced by pure and spider basic-s
Dawn will come inevitably.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: [NOT] Optimizing compiler

Post by Tenaja »

chi wrote:
Everything wrote:Is it possible to do something else in the field of code optimization?
You could try pbOptimizer, although there aren't many ASM optimizations yet (like removing PUSH/POP). Maybe I'll add them later?!
Yes, THAT!
I will share my call tree analyzer when I get a chance. (Don't hold your breath... Don't get a lot of time on my PC that isn't work.) This will help to eliminate unused procs, but it's not set up to account for those called by pointer.

I would also suggest a local var initializing analyzer... If you declare a local variable with an assignment, pb clears it anyway. Since I can't be the only one who refused to rely on that --partially due to habit, but partially not wanting to lose the habit--(and, often locals are set to non-zero), eliminating the redundant "set all locals to zero" might be appreciated by anybody wanting improved performance.
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: [NOT] Optimizing compiler

Post by chi »

Tenaja wrote:I will share my call tree analyzer when I get a chance. (Don't hold your breath... Don't get a lot of time on my PC that isn't work.) This will help to eliminate unused procs, but it's not set up to account for those called by pointer.
This is already implemented under Settings/Create .pb/Remove Uncalled Procs. Edit: But it's not perfect... Proc calls inside an uncalled procedure will not remove the called proc (if also redundant), yet. It's on my to-do list ^^
Tenaja wrote:I would also suggest a local var initializing analyzer... If you declare a local variable with an assignment, pb clears it anyway. Since I can't be the only one who refused to rely on that --partially due to habit, but partially not wanting to lose the habit--(and, often locals are set to non-zero), eliminating the redundant "set all locals to zero" might be appreciated by anybody wanting improved performance.
Could you please post a short test code in the pbOptimizer thread showing exactly what you want and how my program should handle it? Much easier this way ;)


Other suggestions are welcome as well... (with code samples, please)
Et cetera is my worst enemy
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: [NOT] Optimizing compiler

Post by Keya »

a recent (March 2021) blog post by Fred suggests PB is getting rewritten to have a C backend instead of asm (im guessing gcc on Win/Mac/Linux), so that should in theory also open the gate to all the compiler optimisation options as well. I for one am super excited about this!
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: [NOT] Optimizing compiler

Post by Tenaja »

chi wrote:
Tenaja wrote:I will share my call tree analyzer when I get a chance. (Don't hold your breath... Don't get a lot of time on my PC that isn't work.) This will help to eliminate unused procs, but it's not set up to account for those called by pointer.
This is already implemented under Settings/Create .pb/Remove Uncalled Procs. Edit: But it's not perfect... Proc calls inside an uncalled procedure will not remove the called proc (if also redundant), yet. It's on my to-do list ^^
Tenaja wrote:I would also suggest a local var initializing analyzer... If you declare a local variable with an assignment, pb clears it anyway. Since I can't be the only one who refused to rely on that --partially due to habit, but partially not wanting to lose the habit--(and, often locals are set to non-zero), eliminating the redundant "set all locals to zero" might be appreciated by anybody wanting improved performance.
Could you please post a short test code in the pbOptimizer thread showing exactly what you want and how my program should handle it? Much easier this way ;)


Other suggestions are welcome as well... (with code samples, please)
The dead code, as you said, doesn't remove dead code called b dead code. My call tree analyzer does. Maybe Fred will implement something like it in the new back end.

Having a C target backend will open a lot of doors. We'll be able to compile with gcc if we want a coffee break, or something faster for debug... And I wouldn't be surprised if that debug system isn't one of the hardest things for them to convert.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: [NOT] Optimizing compiler

Post by Tenaja »

Also, a C backend could make using C libraries as simple as an include...
User avatar
skywalk
Addict
Addict
Posts: 4223
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [NOT] Optimizing compiler

Post by skywalk »

Or, inline C. 8)
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Keya
Addict
Addict
Posts: 1890
Joined: Thu Jun 04, 2015 7:10 am

Re: [NOT] Optimizing compiler

Post by Keya »

inline C ... inline asm ... an optimising compiler ... the POWER!!!
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: [NOT] Optimizing compiler

Post by chi »

Very exciting news!
Et cetera is my worst enemy
Post Reply