aeneas icon indicating copy to clipboard operation
aeneas copied to clipboard

Add a micro-pass to simplify array updates

Open sonmarcho opened this issue 1 year ago • 0 comments
trafficstars

Consider the following array update:

a[i] = v;

It gets extracted to:

let (_, index_mut_back) ← Array.index_mut_usize U32 16#usize a i
let a1 ← index_mut_back x

It would be good to implement a micro-pass which updates this pattern to something like this:

let a1 ← Array.update U32 16#usize a i x

sonmarcho avatar May 17 '24 08:05 sonmarcho