[EXT_EP-10854] Compiler fails to optimize out short lived variables, which causes loop to run slower Created: 23/Jun/22  Updated: 05/Jan/23

Status: New
Project: Embedded Software & Tools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Low
Reporter: TI User Assignee: TI User
Resolution: Unresolved Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Product: Code Generation Tools
Internal ID: CODEGEN-10124
Forum URL: https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/81/t/1111294
Found In Release: C6000_8.3.12
Affected Platform/Device: default

 Description   

The attached source file contains an implementation of convolution of integer values. It has one loop that makes 4 calls to an inlined function. Build it with version 7.4.24 ...

% cl6x -@options.txt file.c

Inspect the resulting assembly code, and see the loop gets II=4. Build it again with 8.3.12, and the loop gets II=7.

Somehow, version 7.4.24 optimizes out some short-lived variables in the inlined function. They do not appear in the optimizer generated comments. But 8.3.12 has them. That generates more MV and ADD instructions in the loop, driving up the resource bound.


Generated at Wed Apr 16 05:06:19 CDT 2025 using Jira 9.12.17#9120017-sha1:aba4002bcd633f188b6a4bb5dd8a0e1f20b79ee4.