[RISCV] Don't emit save-restore call if function is a interrupt handler
authorJim Lin <jim@andestech.com>
Fri, 16 Apr 2021 04:50:51 +0000 (12:50 +0800)
committerJim Lin <jim@andestech.com>
Fri, 16 Apr 2021 04:54:47 +0000 (12:54 +0800)
commit2893570e86dbb6b9b6b7f7779d9988ff6a686fe1
tree8712ce1a3b605d91fcbbb6de6c5c8c2df49dde34
parent0e2f9b61fd9a30b152e9c80178b3bcc4b171b416
[RISCV] Don't emit save-restore call if function is a interrupt handler

It has to save all caller-saved registers before a call in the handler.
So don't emit a call that save/restore registers.

Reviewed By: simoncook, luismarques, asb

Differential Revision: https://reviews.llvm.org/D100532
llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h
llvm/test/CodeGen/RISCV/saverestore.ll