【问题标题】:Simple nested loop not pipelining on TI C64x+TI C64x+ 上没有流水线的简单嵌套循环
【发布时间】:2015-09-25 00:44:32
【问题描述】:

以下代码在 C64x+ 上编译时不是流水线:

void main ()
{
    int a, b, ar[100] = {0};

    for (a = 0; a < 1000; a++)
        for (b = 0; b < 100; b++)
            ar[b]++;

    while(1);
}

我的 IDE (Code Composer v6) 为内部循环提供以下消息:“循环无法有效调度,因为它包含复杂的条件表达式。尝试简化条件。”

问题似乎出在嵌套循环上,但我找不到更多关于优化这么简单的信息。

以前有没有人解决过类似的问题?

-- 附加信息--

  • 处理器:TMS320C64x+

  • 编译器:TI v8.0.3

  • 编译器标志:-mv6400+ --abi=eabi -O3 --opt_for_speed=4 --include_path="D:/TI/ccsv6/tools/compiler/ti-cgt- c6000_8.0.3/include" --advice:performance -g --issue_remarks --verbose_diagnostics --diag_warning=225 --gen_func_subsections=on --debug_software_pipeline --gen_opt_info=2 --gen_profile_info -k --c_src_interlist --asm_listing -- output_all_syms

  • 链接器标志:-mv6400+ --abi=eabi -O3 --opt_for_speed=4 --advice:performance -g --issue_remarks --verbose_diagnostics --diag_warning=225 -- gen_func_subsections=on --debug_software_pipeline --gen_opt_info=2 --gen_profile_info -k --c_src_interlist --asm_listing --output_all_syms -z -m"dsp.map" -i"D:/TI/ccsv6/tools/compiler/ti- cgt-c6000_8.0.3/lib" -i"D:/TI/ccsv6/tools/compiler/ti-cgt-c6000_8.0.3/include" --reread_libs --warn_sections --xml_link_info="dsp_linkInfo.xml" --rom_model

【问题讨论】:

  • 这个信息是内循环还是外循环?
  • @user3528438 用于内部循环,刚刚更新了问题
  • 对于这个例子,你不能将ar中的每个元素都设置为1000,避免内循环吗?
  • 奇怪,使用 TI v6.1 我得到ii = 1 Schedule found with 7 iterations in parallel
  • @Alejandro 这是一个更复杂示例的测试用例。在这种情况下,这是可行的,但是对于更复杂的情况,会给出相同的循环调度消息,而这不会

标签: c nested-loops texas-instruments pipelining


【解决方案1】:

从编译器标志中删除 --gen_profile_info 解决了这个问题。我的循环已经解散了。

【讨论】:

    猜你喜欢
    • 2022-01-12
    • 2014-11-11
    • 2020-08-24
    • 2020-12-20
    • 2018-03-12
    • 1970-01-01
    • 1970-01-01
    • 2019-12-28
    • 2015-01-15
    相关资源
    最近更新 更多