Open BruceForstall opened 1 year ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
Author: | BruceForstall |
---|---|
Assignees: | - |
Labels: | `area-CodeGen-coreclr` |
Milestone: | 8.0.0 |
Just a question out of curiousity: I guess you can't guarantee that someone else doesn't change the array reference while looping.
What would be the criterias for assuming that the code up to the element-access is "short" enough / that it's safe to fetch the instance once, check and then access it without bound-checks?
Currently, if the array being iterated is a class member (and not a function local), we can't analyze the access (e.g., can't determine if the array object is loop-invariant).
e.g.,
category:cq theme:loop-opt skill-level:expert cost:large impact:medium