[llvm] [RISCV] Implement foward inserting save/restore FRM instructions. (PR #77744)

Yeting Kuo via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 02:20:51 PST 2024


================
@@ -55,6 +61,82 @@ char RISCVInsertReadWriteCSR::ID = 0;
 INITIALIZE_PASS(RISCVInsertReadWriteCSR, DEBUG_TYPE,
                 RISCV_INSERT_READ_WRITE_CSR_NAME, false, false)
 
+// TODO: Use more accurate rounding mode at the start of MBB.
+bool RISCVInsertReadWriteCSR::emitWriteRoundingModeOpt(MachineBasicBlock &MBB) {
+  bool Changed = false;
+  MachineInstr *LastFRMChanger = nullptr;
+  unsigned CurrentRM = RISCVFPRndMode::DYN;
+  std::optional<Register> SavedFRM;
----------------
yetingk wrote:

Done. Thank you for your suggestion.

https://github.com/llvm/llvm-project/pull/77744


More information about the llvm-commits mailing list