MIPSpro compiler performance
#1
MIPSpro compiler performance
Does anyone have any tutorials to get old Irix boxen to run a tiny bit faster? I'm using c99 compiler with -O3 OPT:Olimit=0:space=ON  , and I'm sure there's stuff I'm missing. What does -quickstart_info do? Does it only work on elf files or on shared libraries too?

Is it related to rqsall?


I've been looking into the linker too, using -IPA seems to help somewhat.

Also, I've had some success with pixie and prof.

Code:
pixie app
app.pixie -v neu
prof app app.Counts.9431 -feedback
cord -v app
strip -s app.cord -o app

And I seem to be able to strip -f shared libraries, which helps load times. Does anyone have any other tips?
02girl
O2

Trade Count: (0)
Posts: 34
Threads: 6
Joined: May 2020
Find Reply
09-13-2021, 01:13 PM
#2
RE: MIPSpro compiler performance
This is a pretty in depth question so lemme try to answer you succinctly and completely:

There is one setting faster than -O3, -Ofast. But that breaks any floating point stuff.

MIPSPRO has a performance bias in -TARG flags. This is because it likes to optimize for cache size and CPU type. You can do something like: -TARG:platform=IP30:proc=R10000 for an Octane for instance. The R12000+ don't have any additional opts so don't bother with those, same with GCC and the -mabi flag.

-OPT flags change how optimizing procedures go.

The last flag is auto parallelizing. But that doesn't work for a lot of workloads.

MIPSPRO can absolutely get better performance than GCC in many cases. I've done some basic tests with command line programs like archivers, parallel tests etc. And there's no significant difference between the different GCC versions between 4.7-9.x the reason I don't publish them is due to trolls from another group who have a tendency to harass people here insisting artificial benchmarks show a much better codegen, which is just not the case in anything I can objectively measure.

However you may wanna try a GCC version like 4.8.5 if you're on 6.5, I built it and it's the least broken GCC I've found around. Later versions don't work properly.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
09-13-2021, 01:22 PM
#3
RE: MIPSpro compiler performance
-O3 does aggressive loop unrolling, resulting in bigger binaries, more cache pressure, and therefore ... lower performance.

It should be reserved for hotspots in your code, not for everything.
(This post was last modified: 09-13-2021, 01:38 PM by jan-jaap.)
jan-jaap
SGI Collector

Trade Count: (0)
Posts: 1,048
Threads: 37
Joined: Jun 2018
Location: Netherlands
Website Find Reply
09-13-2021, 01:38 PM
#4
RE: MIPSpro compiler performance
So interestingly, I ended up doing some benchmarks on exactly this over the weekend, using the libtommath/libtomcrypt libraries -- so it's all integer heavy workloads. The full set of results are on a powered-down machine at the moment, but most of the benchmarks execute quickly and don't have much difference. But a few definitely do. This is on a 700MHz R16k in an O350:

gcc 9.2 -O3 -funroll-loops -mips3:
rsa_test............passed 73962.903ms
dh_test.............passed 979116.497ms

gcc 9.2: -O3 -funroll-loops -mips4 is terrible -- unclear why this happens, as mips4 doesn't really change much from mips3 as far as integer perf is concerned, so something bad is happening:
rsa_test............passed 156175.542ms
dh_test.............passed 1007183.697ms

mipspro is worse than gcc's mips3 codegen, better than mips4:
rsa_test............passed 104042.716ms
dh_test.............passed 1089367.364ms

mipspro didn't show a big difference between mips3/mips4.

clang 12, mips3, still WIP but not looking so hot. I killed dh_test:
rsa_test............passed 106281.262ms

at some point in the next few weeks I'm going to dig into the codegen for some of these, as I suspect there are just some optimization passes missing. I didn't look at gcc4 as it's quite ancient and not really useful for anything other than C code, though it might be an interesting comparison.

But mipspro seems like a middle of the road compiler, and is not useful for (modern) C++.
(This post was last modified: 09-13-2021, 06:46 PM by vvuk.)
vvuk
O2

Trade Count: (0)
Posts: 43
Threads: 4
Joined: Aug 2021
Location: California
Find Reply
09-13-2021, 06:45 PM
#5
RE: MIPSpro compiler performance
GCC codegen for IRIX IME is quite static across the different versions. You may get at most a 5% difference. Oddly, the best was GCC 5.4.0 when a difference was identified.

Yeah, GCC's mips4 codegen is rubbish because it was designed for and optimized on embedded MIPS, none of which use MIPSIV heavily.

I'm curious. Did you set the -TARG flags for MIPSPro?

I'm not surprised clang/llvm has some codegen problems as it performs generally weaker on even a more mainstream architecture. The main benefit it brings to the table is a less hacky compiler. The testsuite failures and random bugs I get from GCC versions past 4.9.5 is ridiculously strange. Also because their ABI for C++ is flexible enough we can in the future have C++ linking/mixing capability.

MIPSPro is limited to c99/c++03 with no thread-local storage, so it's a bit of a limited compiler. I don't usually build a lot with C++ for it except system libs I'm including for IRIXCE.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
09-14-2021, 12:04 AM
#6
RE: MIPSpro compiler performance
I tried the -TARG options, without success on my Indy. Most of the -O options are relatively well documented, but I am curious about the odd things like -IPA and pixie that gcc doesn't have. Pixie has worked on a few binaries, can't get it working on libraries. Thanks for all the comments.
02girl
O2

Trade Count: (0)
Posts: 34
Threads: 6
Joined: May 2020
Find Reply
09-16-2021, 08:24 PM
#7
RE: MIPSpro compiler performance
There's a not particularly recent (copyright 1996) MIPSPro compiling and performance tuning guide (SGI document number 007-2630-006) here:

https://irix7.com/techpubs/007-2360-006.pdf

If anyone knows of a more up-to-date version kindly us know!

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,247
Threads: 42
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
09-17-2021, 05:21 PM
#8
RE: MIPSpro compiler performance
I've been posting basics onto the wiki as well.

The TARG format is:

-O2 -TARG:proc=r10000:platform=IP28

Or something like that

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
09-17-2021, 06:28 PM
#9
RE: MIPSpro compiler performance
(09-17-2021, 05:21 PM)vishnu Wrote:  There's a not particularly recent (copyright 1996) MIPSPro compiling and performance tuning guide (SGI document number 007-2630-006) here:

https://irix7.com/techpubs/007-2360-006.pdf

If anyone knows of a more up-to-date version kindly us know!

Check this out: MIPSproTM N32/64 Compiling and Performance Tuning Guide

Indigo2 IMPACT  : R10K-195MHz, 1GB RAM, 146GB 15K, CD-ROM, AudioDAT, MaxImpact w/ TRAM.  IRIX 6.5.22

O2 : R12K-400MHz, 1GB RAM, 300GB 15K, DVD-ROM, CRM Graphics, AV1/2 Media Boards & O2 Cam, DV-Link, FPA & SW1600.  IRIX 6.5.30

 : 2 x R14K-600MHz, 6GB RAM, V12 Graphics, PCI Shoebox.  IRIX 6.5.30

IBM  : 7012-39H, 7043-140

chulofiasco
Hardware Junkie

Trade Count: (0)
Posts: 328
Threads: 51
Joined: May 2019
Location: New York, NY
Website Find Reply
09-17-2021, 07:53 PM
#10
RE: MIPSpro compiler performance
(09-17-2021, 07:53 PM)chulofiasco Wrote:  Check this out: MIPSproTM N32/64 Compiling and Performance Tuning Guide

Nice! Smile

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,247
Threads: 42
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
09-18-2021, 10:00 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)