Loop – how to get previous/next post for first/last post?

You can loop the slides quite simply:

$prev_index = ( $loop->current_post == 0 ) ? count( $loop->posts ) - 1 : $loop->current_post - 1;
$next_index = ( $loop->current_post == count( $loop->posts ) - 1 ) ? 0 : $loop->current_post + 1;

$prev_post = $loop->posts[ $prev_index ];
$next_post = $loop->posts[ $next_index ];

echo $next_post->post_title;
echo $next_post->post_title;

This takes the last post for the previous post if the current post is the first post, and the first post for the next post if the current post is the last post.