Issue 24816 - backend optimizer slowdown on large for loop body
Summary: backend optimizer slowdown on large for loop body
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: industry
Depends on:
Blocks: 21121
  Show dependency treegraph
 
Reported: 2024-10-15 08:52 UTC by Dennis
Modified: 2024-10-15 08:52 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dennis 2024-10-15 08:52:40 UTC
Change the size of the static foreach to arbitrarily explode compilation time when compiling with -O:

```
void f()
{
    for (int i = 0; i < 1; i++)
    {
        int j = 0;
        static foreach (k; 0 .. 1000)
            j++;
    }
}
```

The optimizer should stop trying to do quadratic time loop optimizations past a certain threshold.