This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320C6678: how to use from speculative load = 'auto'?

Part Number: TMS320C6678

Tool/software: Code Composer Studio

hi

I wanna to use --speculated_loads = 'auto' (-mh = 'auto) option in CCS. according to below document from TI, the compiler and linker must be communicate to use from this option. i dont know that select o2 or o3 optimization with this option. because o2 is function level and o3 is file level optimization.

The compiler and linker can provide automatic load speculation via the auto argument to the --
speculate_loads option (i.e. --speculate_loads=auto or -mh=auto). Use of the auto argument makes it
easier to use and benefit from speculative load optimizations. This option can generate speculative loads
of up to 256 bytes beyond memory that the compiler can prove to be allocated.
In addition, the compiler communicates information to the linker to help automatically ensure the required
pre- and post-padding:
• If the symbol of the speculatively loaded buffer is known at compile time, the linker ensures the object
pointed to by the symbol has the required padding to let the speculative load access legal memory.
• If the symbol information is not known during compile time, the linker will ensure that the placement of
data sections will allow legal accessing beyond the boundaries of the data sections. The linker does
this by simply padding the start and end of the memory range(s) where the data sections are placed.

other question is about the 'auto' application and it's work. when i select  --speculated_loads = 'auto' option I see .asm document changes but i dont know that this option how change to memory allocation?, because i don't see any change to .map file. has padding work on data sections only or on any array start and end on a loop?

please help me about this option and its work.

thanks

braian

 

  • braian powell said:
    i dont know that select o2 or o3 optimization with this option

    Either -o2 or -o3 will work.  Optimization and speculative loads are independent features.  Though it is generally true that, the higher the level of optimization, the more likely it is that speculative loads will be needed.

    braian powell said:
    when i select  --speculated_loads = 'auto' option I see .asm document changes but i dont know that this option how change to memory allocation?

    It is likely that no speculative loads are needed in your program.  For C6600 devices, it is rare (bordering on never) for a software pipeline loop to be constructed that does not use the SPLOOP instruction.  Software pipeline loops that use SPLOOP do not need speculative loads.

    If you did need speculative loads, then the compiler communicates this to the assembler and linker through build attributes.  To see them, search compiler generated assembly code, or the output of the utility ofd6x, for these build attribute names: Tag_pre_pad_bytesTag_post_pad_bytes.

    Thanks and regards,

    -George

  • Thanks for replying, but I have two more questions:

    First of all, I read the tms320C6678 documents; I noticed that when we select “auto” mode in –speculate_load (-mh), there will be some connection between linker and compiler, due to managing pre- and post-memory padding. And we know that O2 is a function-level optimization. So we assume that for “auto” mode, O3 level of optimization is more functional. My question is which of two optimization levels (O2 or O3) is totally more appropriate for “auto” mode?

    Another question is: We have a for loop in which some arrays are loaded (we read them), and we know that all arrays belong to one data section, which can contain other arrays as well. My question is what exactly happens when padding occurs in “auto” mode? I mean, does it allocate some memory space (speculative load) to the start and to the end of each array one by one? Or does it allocate memory space to the start and the end of data section totally?

    Regards,

    -braian

  • braian powell said:
    which of two optimization levels (O2 or O3) is totally more appropriate for “auto” mode?

    Either one will work fine.  If you use -o3, there is a small chance more speculative loads are generated, and thus more padding may be needed.  

    braian powell said:
    does it allocate some memory space (speculative load) to the start and to the end of each array one by one?

    No

    braian powell said:
    does it allocate memory space to the start and the end of data section totally?

    Yes

    Thanks and regards,

    -George