The United States has discussed the threat posed by Islamic State militants with envoys from its traditional foe Iran on the sidelines of nuclear talks, the State Department revealed Friday.