<div dir="ltr">woot, solved it, at least in a way thats OK for now.<div><br></div><div>if I mark the prefetchValue operations as has_side_effects=True, the core lint failure goes away! I'm not sure if thats the right semantics in the long term, but it does give me a simple way to make sure it works safely for 7.10</div><div><br></div><div>pardon all the noise </div><div>-Carter </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 23, 2014 at 4:26 PM, Carter Schonwald <span dir="ltr"><<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">ok, i'm getting a let/app invariant failure when i build my test case with O1 or O2 but not without<div><br></div><div><a href="http://lpaste.net/114881" target="_blank">http://lpaste.net/114881</a><br></div><div><br></div><div>any help would be appreciated on how to address that</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 23, 2014 at 4:13 PM, Carter Schonwald <span dir="ltr"><<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">yup, i have that!<div><br></div><div>    wrapFetch prefetchValue0# (error "this shouldn't get evaluated")<br></div><div><br></div><div>in the test suite! </div><div><br></div><div>in contrast </div><div>    wrapFetch prefetchValue0# $! (error "this shouldn't get evaluated") does explode<br></div><div><br></div><div>shall I add a "should fail" test with the latter? (it doesn't seem worthwhile)</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 23, 2014 at 3:53 PM, Edward Kmett <span dir="ltr"><<a href="mailto:ekmett@gmail.com" target="_blank">ekmett@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Maybe test for laziness in the argument by just putting something in that goes boom when forced, e.g. 'undefined'?<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Sun, Nov 23, 2014 at 2:04 PM, Carter Schonwald <span dir="ltr"><<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hey All,<div>as part of trying to get some fixups for how prefetch works into 7.10,</div><div>i'm adding a "prefetchValue" primop that prefetchs the memory location of a lifted heap value </div><div><br></div><div>namely </div><div><br></div><div>several operations of the following form</div><div><br></div><div><div>primop PrefetchValueOp1 "prefetchValue1#" GenPrimOp</div><div>   a -> State# s -> State# s</div><div>   with strictness  = { \ _arity -> mkClosedStrictSig [botDmd, topDmd] topRes }</div></div><div><br></div><div>I'd like some feedback on the strictness information design by someone who's familiar with how that piece of GHC. the idea being that prefetchValue is lazy in its polymorphic argument (it doesn't force it, it just does a prefetch on the heap location, which may or may not be evaluated).</div><div><br></div><div><a href="https://phabricator.haskell.org/D350" target="_blank">https://phabricator.haskell.org/D350</a><br></div><div><br></div><div>is the code in question. And i *believe* i'm testing for being lazy in that argument correctly.</div><div><br></div><div>thoughts?</div><div><br></div><div>many thanks!</div><span><font color="#888888"><div>-Carter</div><div><br></div></font></span></div>
<br></div></div>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>
</blockquote></div><br></div>