JIT suggestion: optimize comparisons of uint against int.MaxValue #37462
Open
Description
We have a few places in the code where we compare locals of type uint
against int.MaxValue
.
runtime/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs
Lines 180 to 183 in a0c3324
There's an opportunity for a few bytes of codegen savings across these methods if the JIT treat these calls as (int)value < 0
or (int)value >= 0
instead of performing a direct comparison against the constant value 0x7FFFFFFF
.
category:cq
theme:codegen
skill-level:intermediate
cost:small
Activity