The text for spell resistance specifically says "The defender's spell resistance is like an Armor Class against magical attacks." From what I'm reading SR only takes place if the spell being cast is an attack as opposed to a non-attack spell. I've learned in the past DnD/Pathfinder/etc typically use very specific words in order to ensure things are not misconstrued. Such as "all creatures" vs "all allies".