The current primops for prefetching do not properly work in pure code; namely, the primops are not 'hoisted' into the correct call sites based on when arguments are evaluated. Instead, they should use a seq-like interface, which will cause it to be evaluated when the needed term is.

i was doing some sanity checking locally, and its pretty clear that the test file wasn't being run by validate somehow (as in, theres no way it compiled, i'm fixing that locally and hopefully things will then be OK)

i seem to have discovered a problem wrt let/app invariant with the api / semantics i have for prefetch value. However, I only seem to get the problem to happen locally on my mac (though I cant even run validate locally for other reasons i can't yet track down).

when we ran the same codes using a version of GHC that treated the primops as being "pure", there was a teeny (but measurable) change in the resulting application performance (where the resulting performance was worse by ~ 5% of total runtime I think).

austin retitled this revision from Changing the pure prefetch primops to have seqlike behavior so that prefetch can be used effectively in pure codes! This is based upon design discused on trac ticket #9353 to Changing prefetch primops to have a `seq`-like interface.Dec 15 2014, 9:42 AM