Avoiding Range Checks in Slice Expressions

"Nordlöw" per.nordlow at gmail.com
Mon Mar 31 13:21:15 PDT 2014


> If they are range-checked, it would be a good addition to the 
> optimizer to remove them. My guess is that it is range-checked.
>

$/n is of course always within range if n is positive integer >= 
1.

But what about in the general indexing/slicing case? In that case 
it would be useful if we could reuse value range propagation 
(VRP) in DMD, to figure out which other expressions that don't 
need range checking.


More information about the Digitalmars-d-learn mailing list