Back in the 1970's, when I asked to resign from the church, I was told I would be excommunicated.
When I discussed this with the bishop, he checked the manual and told me there were two reasons for excommunication: stealing money from the church and something like denying the holy ghost (the latter apparently being my sin for asking to resign).
"You mean," I asked, "that if I were in prison for murder or rape, I wouldn't be excommunicated?"
Basically his response was: those aren't listed as reasons for excommunication.