<div dir="ltr">Hey all,<div style>I&quot;ve been doing some work to finish up my prefetch patch that  I hope to land in 7.8, and one design matter thats come up is what the optimization semantics should be!</div><div style>

<br></div><div style>is it appropriate to duplicate prefetches? (probably yes)</div><div style>is it appropriate to float OUT prefetched? (probably not?)</div><div style><br></div><div style>operations that are dupable which shouldn&#39;t float out are marked with the can_fail= true</div>

<div style>property,</div><div style>operations which cannot be safely floated out and can&#39;t be duped are marked as having side effects.</div><div style><br></div><div style>on the GHC irc channel, Duncan was patient enough to walk my through understanding this, and this makes me lean towards the conclusion that duplication is ok, but floating out isnt. Thus all the prefetch ops (pure or not) should have the attribute &quot;can fail&quot;, rather than no attribut or &quot;has effects&quot;.</div>

<div style><br></div><div style>this is exploiting that &quot;can fail&quot;  really just means &quot;don&#39;t float out&quot;.</div><div style><br></div><div style>thoughts and counter points?</div><div style><br></div>

<div style>thanks</div><div style><br></div><div style>-Carter</div><div style><br></div><div style><br></div><div style><br></div></div>