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

Double indirection causes bad loop performance

    XMLWordPrintable

Details

    • Enhancement
    • Status: New
    • Low
    • Resolution: Unresolved

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: