Teach ISel not to optimize 'optnone' functions.

Based on work by Andrea Di Biagio.