Optimize bounds checks with correct assertion set
Assertion prop defers removing redundant bounds checks until processing
the parent comma, because the rewrite involves the comma as well. The
code currently has a bug in that its check for whether the bounds check
is redundant also occurs when processing reaches the comma, which is wrong
because the assertion set may then include assertions generated by the RHS
of the comma (there is code to compensate for the assertion generated by
the bounds check itself, which is the LHS of the comma, but no compensation
for the RHS).
This change moves the analysis of whether bounds checks are redundant to
the proper spot in the processing order, and delays only the rewrite to
the processing of the comma; the redundancy of the bounds check is
communicated via a new opcode-specific flag: GTF_ARR_BOUND_INBND.
Fixes dotnet/coreclr#6318.
Commit migrated from https://github.com/dotnet/coreclr/commit/
16c65845eef41548c5653f14fede5a8c5c0be30f