Yielding, shear banding, and brittle failure of amorphous materials