-
Notifications
You must be signed in to change notification settings - Fork 189
Open
Description
It is time to support LMAD slicing properly. It works fine in the IR, but exposing it in the source language requires solving three problems:
- How do we bounds check them?
- How do we avoid doing in-place updates into slices that have strides of length zero (banning these is not an option)?
- What should the syntax be?
@coancea says that (1) is not difficult. I have an idea how how to do (2) by simply making it impossible to consume the result of an LMAD slice. This can be done using machinery similar to how we track aliases of top level constants (which also may not be consumed).
The syntax is clearly the most difficult part. In the papers, we use the notation A[L]
where L
is then an LMAD, but since LMAD notation is something like x+(o1,n1)...(o2,n2)
, that may be ambiguous with ordinary slicing (and it may also not be the syntax we want).