offsetMemoryInStm :: RebaseMap -> Stm InKernel
                      -> (RebaseMap, Stm InKernel)
offsetMemoryInStm offsets (Let pat attr e) =
  (offsets', Let pat' attr $ offsetMemoryInExp offsets e)
  where (offsets', pat') = offsetMemoryInPattern offsets pat
offsetMemoryInStm :: RebaseMap -> Stm InKernel
                      -> (RebaseMap, Stm InKernel)
offsetMemoryInStm offsets (Let pat attr e) =
  (offsets', Let pat' attr $ offsetMemoryInExp offsets e)
  where (offsets', pat') = offsetMemoryInPattern offsets pat
offsetMemoryInStm offsets (Let pat attr e) =
  (offsets', Let pat' attr $ offsetMemoryInExp offsets e)
  where (offsets', pat') = offsetMemoryInPattern offsets pat