Differences between -fast and -Ox options


What are the differences between the options -fast and -O2 or -O3 options in pgcc? Is -fast included in -O3 or vice-versa? Can be mixed both options in compilation?


-fast is a good first choice for optimizations. It is a result of years of testing
on many examples.

-fast -Mipa=inline,fast

is our recommended optimization as well.

-O2 are billed as ‘safe optimizations’ that usually will improve results.

-O3 optimizations are less likely to usually improve performance.

I would check
-fast -Mipa=inline,fast

and select the best among these. Setting all the switches is usually fruitless.