MIPSpro compiler performance -
02girl - 09-13-2021
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?
RE: MIPSpro compiler performance -
Raion - 09-13-2021
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.
RE: MIPSpro compiler performance -
jan-jaap - 09-13-2021
-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.
RE: MIPSpro compiler performance -
vvuk - 09-13-2021
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++.
RE: MIPSpro compiler performance -
Raion - 09-14-2021
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.
RE: MIPSpro compiler performance -
02girl - 09-16-2021
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.
RE: MIPSpro compiler performance -
vishnu - 09-17-2021
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!
RE: MIPSpro compiler performance -
Raion - 09-17-2021
I've been posting basics onto the wiki as well.
The TARG format is:
-O2 -TARG:proc=r10000:platform=IP28
Or something like that
RE: MIPSpro compiler performance -
chulofiasco - 09-17-2021
(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
RE: MIPSpro compiler performance -
vishnu - 09-18-2021
(09-17-2021, 07:53 PM)chulofiasco Wrote: Check this out: MIPSproTM N32/64 Compiling and Performance Tuning Guide
Nice!