6 Replies Latest reply on Feb 11, 2013 11:29 PM by pssingh1001

    Aggressive Optimizations

    Calli82

      Hi,

      i would like to compile a shared library for an embedded system with Geode processor (32bit). There are hundreds of optimization flags in gcc and AMD x86 Open 64 Compiler Suite. Which options would be effective behind -Ofast in AMD CS? Is it actually useful to compile for the geode with the AMD CS instead of gcc?

      Thank you for your opinions.

      Calli82

        • Aggressive Optimizations
          kvikrant

          Hi,

          The performance difference between gcc and open64 will depend on the kind of code you have. So to know that you will have to actually go ahead and do a comparison. Some people on the forum have already posted good performance improvements using Open64 over GCC. But those have been for Phenom's, a much newer architecture as compared to Geode which is quite similar to Athlon cores (to the best of my knowledge, I'm not a geode expert). So your mileage may vary.

          Since I dont know your code behaviour, I can only suggest very general things like: feedback directed optimization, inlining, loop optimizations, etc. Theses are very well described in the users guide, which I encourage you to explore in depth and do multiple tests.

          Regards

          Vikrant

            • Re: Aggressive Optimizations
              erotavlas

              Hi all,

               

              I have found this guide http://developer.amd.com/Assets/CompilerOptQuickRef-61004100.pdf on ufficial AMD website. I'm compiling with GCC 4.6.2 and I would like to know if the parameters specified in guide are the best or I can add other parameters like the following example:

               

              from the guide

              -O3 -march=barcelona -fschedule-insns -fschedule-insns2 -fsched-pressure -funroll-all-loops -fprefetch-loop-arrays --param prefetch-latency=300 -minline-all-stringops -fno-tree-pre -ftree-vectorize

               

              additional parameters

                Compiler

              -O3 -fwhole-program -flto -fsplit-stack -march=barcelona -fschedule-insns -fschedule-insns2 -fsched-pressure -funroll-all-loops -fprefetch-loop-arrays --param prefetch-latency=300 -minline-all-stringops -fno-tree-pre -ftree-vectorize

              Linker

              -flto

               

              Thank you

                • Re: Aggressive Optimizations
                  santosh.zanjurne

                  Hi,

                  Compiler Quick reference guide is a short catalog of most common and relevant out-of-the box flags for the platform. We have a quick reference guide for AMD’s latest processor Bulldozer based platforms at  following link.

                   

                  http://developer.amd.com/Assets/CompilerOptQuickRef-62004200.pdf

                   

                  While out-of-the-box flags like Ofast may give you good performance, depending on the application one may have to add more flags to get the best performance. If you could share your application or key functions or test cases, we can help you with the flags to the best we can.

                   

                  Some queries to help you better

                  -    Whats the processor family you are using ( MagnyCour/Bulldozer etc) or let us know the part number of the processor?

                  -    What OS and version you are working on?

                  -    As mentioned above if you can share the application/ hot function or test case?

                   

                  Let me know.

                   

                  Regards,

                  Santosh

                    • Re: Aggressive Optimizations
                      erotavlas

                      Hi,

                       

                      I have a system with four Magny-Cours Opteron 6168. I'm under linux Ubuntu 11.10 64 bit and I'm using GCC 4.6.2. As I have specified in my previous post, my question is about the compilation flags reported here http://developer.amd.com/Assets/CompilerOptQuickRef-61004100.pdf. The parameters specified in guide are the following:

                       

                      -O3 -march=barcelona -fschedule-insns -fschedule-insns2 -fsched-pressure -funroll-all-loops -fprefetch-loop-arrays --param prefetch-latency=300 -minline-all-stringops -fno-tree-pre -ftree-vectorize

                       

                      I would like to know if the parameters are the best, because for example it's known that the parameter -funroll-all-loops leads to less performance as specified here http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#Optimize-Options. The parameter -fprefetch-loop-arrays can or can't lead to better performance depending on the code. So my question is about the reliability of the parameters.

                       

                      After this I know that in the code the Pareto's principle or 80–20 rule is valid i.e. the 80% (also 90%) of the time is spent inside the 20% (10%) of the code. In my case inside two functions.

                       

                      But this is another question, first I would like to know the answer at my first question.

                       

                      Thank you

                        • Re: Aggressive Optimizations
                          santosh.zanjurne

                          The flags listed in the document are proven to give better performance for some applications and as you know you have to check what flag suite's your applications to get the better performance.  In some cases some optimization do result in performance degradation also.  In the example of loop rolling, you can control the heuristics with other loop unrolling flags, same applies to other optimizations also.

                           

                          I can help you get the best performance for your app if its possible for you to share the application.  We can take this offline, my email is address is santosh.zanjurne@amd.com.

                           

                          Regards,

                          Santosh

                            • Re: Aggressive Optimizations
                              pssingh1001
                              Hi All!!!!!!!!!   From " I N D I A "
                              Hi Friends!
                              I am the newbie  of this forum ...........
                              So first of all I would like say ".............HELLO........"
                              to all of u Dear..................
                              This comes from another forum but is an excellent tutorial
                              on how to best use the forum...
                              Regards
                              prem