I have an earlier post that discusses a couple of the optimizations that Harlan does: http://blog.theincredibleholk.org/blog/2013/06/10/some-simpl...
To me the win for Harlan over CUDA is its region system, which lets you work with more intricate pointer structures in the GPU. For example, there is an interpreter for the Lambda Calculus as one of the test cases, which would be much harder to do in straight CUDA: https://github.com/eholk/harlan/blob/master/test/lambda3.kfc
Very soon, Harlan will have support for higher order procedures, which is also not available in CUDA.
I'd be interested to hear more about what you're doing. Do you have any links you could share?
I guess if you generalize this transformation sufficiently you end up doing whole-program flattening like NESL and DPH. Or is there a less intrusive way to pull that off?
[1] http://blog.theincredibleholk.org/blog/2013/06/10/some-simpl... [2] http://www.cs.indiana.edu/~eholk/papers/parco2011.pdf