Hi Richard, hi all, On 11/21/19 2:16 PM, Tobias Burnus wrote:
I wonder whether there is a 'fn attr' which can tell that the first argument of 'print_i' does not cause the address of 'i' escape.
I think one needs two attributes, one which tells that the address of the object itself does not escape. I think that covers all scalars and, hence, things which can then easily optimized.
And another one which tells (for a struct) that this address and all pointers in that struct do not escape – or something like that. Here, I am many thinking of arrays with array descriptors. There one has a struct consisting of the meta data (array bounds) and of one element called 'data' which points to the actual array data. There might be fewer optimization possibilities in general (as keeping track of a whole array is more involved), but there should be still some important ones.
Cheers, Tobias