Skip to content

[Jit] Indexing mod array.Length not recognized as bounds safe #9421

@benaadams

Description

@benaadams

e.g.

var i = buckets[hashCode % buckets.Length];

Will introduce a range check, even though its always safe (though maybe not for Length == 0?)

category:cq
theme:bounds-checks
skill-level:intermediate
cost:small
impact:small

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions