<p dir="ltr"><br>
> You will need to do this in the frontend. The target independent optimizers are allowed to use the memory model.</p>
<p dir="ltr">We discussed doing this, and concluded that doing it pre-opt was overly restrictive on correct code. Doing it post-opt bakes the behavior into the portable code, so in a way it'll be reliably broken but won't penalize good code. </p>

<p dir="ltr">FWIW it's easy to change from one to the other: move one line of code. I hope my explanation makes sense, and it doesn't look like I'm dismissing your comment on implementation issues. </p>