I have asked to resign for poor performance during my pregnancy

Hi, I am working in a very reputed IT company. I got transfer to mumbai office after my marriage. I used my references to get this transferred as this mumbai manager was not interested to take me here for two reasons - 1. My salary was higher than him, 2. He was taking off on Mondays, going out in office hours, checking share market full day on office PC using office internet, using office phone for personal calls. All this would have been disclosed to his manager if i got to know all this. In short he was misusing his authorities. He was getting all the work done by his subordinates and was presenting in front of his bosses who were sitting in Pune. On very first day he told me that i was not required here but as i have came through some higher reference he can't do anything now. He purposely putted me under a guy who is equal to my grade. He never talked to me regarding work nor he called me for any meeting. He tortured me mentally. I told this thing for several times to his manager who was sitting in Pune but he too was asking me only to go and talk to him. After few days I got pregnant and started neglecting all the things but he purposely started targeting me as now he knew that at any cost i have to stay in Mumbai and can't go against him. He was not considering me and not assigned anything to me. I went on maternity leave from August. Meanwhile our final appraisal was due and as expected he gave me poor rating. without discussing anything to me. And as my bad luck has to continue, this year company has asked all the low grade employees to resign. I extended my 3 months maternity leave to 6 months as my HR told me that no one can ask me to resign while on Maternity leave but i have to resign after i join back. I joined office this Monday after completion of leave and my manager has not even assigned me any project. If i talk to my HR he would ask me to resign. but i don't want to resign. I think i at least should deserve a chance to improve my performance. Please help me out. I am very much confused.