Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-10251

Double indirection causes bad loop performance

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Low Low

      The attached test case contains this loop.

          for (i=0; i<10; i++)
          {
              p1 = *list;
              p2 = *list++;
              *p2 = *p1 + 2;
          }
      

      Build it ...

      % cl6x -mv6740 -o3 -s -mw testcase.c
      

      Then inspect the resulting assembly file.

      All of the pointers are restrict qualified. Including list and *list. Despite that, the compiler generated comments indicate a dependence that is carried over from one loop to the next. The II (initiation interval) is 10, because each loop has to finish before the next one starts.

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: